summaryrefslogtreecommitdiff
path: root/i386
AgeCommit message (Collapse)Author
2012-02-19Fix format for string printSamuel Thibault
* i386/i386at/model_dep.c (c_boot_entry): Use %s format for printing a mere string, not the string.
2012-01-28Merge branch 'master' into master-slabSamuel Thibault
2011-12-29Fix typoSamuel Thibault
2011-12-17Remove arbitrary limits used by the zone systemRichard Braun
The zone allocator could limit the size of its zones to an arbitrary value set at zinit() time. There is no such parameter with the slab module. As a result of removing those limits, the kern/mach_param.h header becomes empty, and is simply removed altogether. * Makefrag.am (libkernel_a_SOURCES): Remove kern/mach_param.h. * i386/i386/fpu.c: Remove #include <kern/mach_param.h>. * i386/i386/machine_task.c: Likewise. * i386/i386/pcb.c: Likewise. * ipc/ipc_init.c: Likewise. (ipc_space_max): Remove variable. (ipc_tree_entry_max): Likewise. (ipc_port_max): Likewise. (ipc_pset_max): Likewise. * ipc/ipc_init.h (IPC_ZONE_TYPE): Remove macro. (ipc_space_max): Remove extern declaration. (ipc_tree_entry_max): Likewise. (ipc_port_max): Likewise. (ipc_pset_max): Likewise. * ipc/ipc_hash.c (ipc_hash_init): Don't use ipc_tree_entry_max to compute ipc_hash_global_size. * ipc/ipc_marequest.c: Remove #include <kern/mach_param.h>. (ipc_marequest_max): Remove variable. (ipc_marequest_init): Don't use ipc_marequest_max to compute ipc_marequest_size. (ipc_marequest_info): Return (unsigned int)-1 in maxp. * kern/act.c: Remove #include <kern/mach_param.h>. * kern/mach_clock.c: Likewise. * kern/priority.c: Likewise. * kern/task.c: Likewise. * kern/thread.c: Likewise. * vm/memory_object_proxy.c: Likewise. * vm/vm_fault.c: Likewise.
2011-12-17Fix kern/kalloc.h includesRichard Braun
* device/dev_pager.c: Remove #include <kern/kalloc.h>. * i386/i386/io_perm.c: Add #include <kern/kalloc.h>. * kern/bootstrap.c: Likewise. * kern/ipc_tt.c: Likewise. * kern/pc_sample.c: Likewise. * kern/processor.c: Likewise. * kern/server_loop.ch: Likewise. * kern/thread.c: Likewise. * linux/dev/glue/block.c: Likewise. * linux/dev/glue/net.c: Likewise. * vm/vm_map.c: Likewise. * xen/block.c: Likewise. * xen/net.c: Likewise. * xen/store.c: Likewise.
2011-12-17Adjust the kernel to use the slab allocatorRichard Braun
* device/dev_lookup.c: Replace zalloc header, types and function calls with their slab counterparts. * device/dev_pager.c: Likewise. * device/ds_routines.c: Likewise. * device/io_req.h: Likewise. * device/net_io.c: Likewise. * i386/i386/fpu.c: Likewise. * i386/i386/io_perm.c: Likewise. * i386/i386/machine_task.c: Likewise. * i386/i386/pcb.c: Likewise. * i386/i386/task.h: Likewise. * i386/intel/pmap.c: Likewise. * i386/intel/pmap.h: Remove #include <kernel/zalloc.h>. * include/mach_debug/mach_debug.defs (host_zone_info): Replace routine declaration with skip directive. (host_slab_info): New routine declaration. * include/mach_debug/mach_debug_types.defs (zone_name_t) (zone_name_array_t, zone_info_t, zone_info_array_t): Remove types. (cache_info_t, cache_info_array_t): New types. * include/mach_debug/mach_debug_types.h: Replace #include <mach_debug/zone_info.h> with <mach_debug/slab_info.h>. * ipc/ipc_entry.c: Replace zalloc header, types and function calls with their slab counterparts. * ipc/ipc_entry.h: Likewise. * ipc/ipc_init.c: Likewise. * ipc/ipc_marequest.c: Likewise. * ipc/ipc_object.c: Likewise. * ipc/ipc_object.h: Likewise. * ipc/ipc_space.c: Likewise. * ipc/ipc_space.h: Likewise. * ipc/ipc_table.c (kalloc_map): Remove extern declaration. * kern/act.c: Replace zalloc header, types and function calls with their slab counterparts. * kern/kalloc.h: Add #include <vm/vm_types.h>. (MINSIZE): Remove definition. (kalloc_map): Add extern declaration. (kget): Remove prototype. * kern/mach_clock.c: Adjust comment. * kern/processor.c: Replace zalloc header, types and function calls with their slab counterparts. * kern/startup.c: Remove #include <kernel/zalloc.h>. * kern/task.c: Replace zalloc header, types and function calls with their slab counterparts. * kern/thread.c: Likewise. * vm/memory_object_proxy.c: Likewise. * vm/vm_external.c: Likewise. * vm/vm_fault.c: Likewise. * vm/vm_init.c: Likewise. * vm/vm_map.c: Likewise. * vm/vm_object.c: Likewise. * vm/vm_page.h: Remove #include <kernel/zalloc.h>. * vm/vm_pageout.c: Replace zalloc header, types and function calls with their slab counterparts. * vm/vm_resident.c: Likewise. (zdata, zdata_size): Remove declarations. (vm_page_bootstrap): Don't steal memory for the zone system.
2011-12-17Import the slab allocatorRichard Braun
As it is intended to completely replace the zone allocator, remove it on the way. So long to the venerable code ! * Makefrag.am (libkernel_a_SOURCES): Add kern/slab.{c,h}, remove kern/kalloc.c and kern/zalloc.{c,h}. * configfrag.ac (SLAB_VERIFY, SLAB_USE_CPU_POOLS): Add defines. * i386/Makefrag.am (libkernel_a_SOURCES): Remove i386/i386/zalloc.h. * i386/configfrag.ac (CPU_L1_SHIFT): Remove define. * include/mach_debug/slab_info.h: New file. * kern/slab.c: Likewise. * kern/slab.h: Likewise. * i386/i386/zalloc.h: Remove file. * include/mach_debug/zone_info.h: Likewise. * kern/kalloc.c: Likewise. * kern/zalloc.c: Likewise. * kern/zalloc.h: Likewise.
2011-10-16Increase kmem area for the Xen case.Samuel Thibault
Kernel tacks are 4 pages in the Xen case, so we need more kmem space. * i386/i386/vm_param.h (VM_KERNEL_MAP_SIZE) [MACH_XEN]: Increase to 224MiB.
2011-09-12Remove unused [!MACH_KERNEL] driver codeGuillem Jover
Use «unifdef -DMACK_KERNEL=1» as a starting point, but only remove the code not exposed on public headers, the rest is needed to build properly from userland. * device/cons.c [!MACH_KERNEL]: Remove includes. [!MACH_KERNEL] (constty): Remove variable. (cninit, cnmaygetc) [MACH_KERNEL]: Remove preprocessor conditionals. [!MACH_KERNEL] (cnopen, cnclose, cnread, cnwrite, cnioctl, cnselect) (cncontrol): Remove functions. * device/cons.h (struct consdev) [MACH_KERNEL]: Remove preprocessor conditional. * device/kmsg.h [MACH_KERNEL]: Likewise. * i386/i386at/autoconf.c [!MACH_KERNEL]: Remove includes. * i386/i386at/kd_event.c [!MACH_KERNEL]: Likewise. [!MACH_KERNEL] (kbd_sel, kbdpgrp, kbdflag): Remove variables. [!MACH_KERNEL] (KBD_COLL, KBD_ASYNC, KBD_NBIO): Remove macros. (kbdopen, kbdclose, kbd_enqueue) [!MACH_KERNEL]: Remove code. [!MACH_KERNEL] (kbdioctl, kbdselect, kbdread): Remove functions. [!MACH_KERNEL] (X_kdb_enter_init, X_kdb_exit_init: Likewise. * i386/i386at/kd_mouse.c [!MACH_KERNEL]: Remove includes. [!MACH_KERNEL] (mouse_sel, mousepgrp, mouseflag): Remove variables. [!MACH_KERNEL] (MOUSE_COLL, MOUSE_ASYNC, MOUSE_NBIO): Remove macros. (mouseopen, mouseclose, kd_mouse_read, mouse_enqueue) [!MACH_KERNEL]: Remove code. [!MACH_KERNEL] (mouseioctl, mouseselect, mouseread): Remove functions. * i386/i386at/lpr.c [!MACH_KERNEL]: Remove includes. (lpropen) [MACH_KERNEL]: Remove preprocessor conditionals. (lpropen, lprclose, lprstart) [!MACH_KERNEL]: Remove code. [!MACH_KERNEL] (lprwrite, lprioctl, lprstop): Remove functions. * i386/i386at/rtc.c (readtodc, writetodc) [!MACH_KERNEL]: Remove code. * kern/mach_factor.c [MACH_KERNEL]: Remove preprocessor conditional. * xen/time.c (readtodc) [!MACH_KERNEL]: Remove code.
2011-09-06* .gitignore: Tighten some rules, and distribute others to...Thomas Schwinge
* doc/.gitignore: ... here; * i386/i386/.gitignore: ... here; * tests/.gitignore: ..., and here.
2011-09-06* i386/i386/pcb.h (stack_attach): Parameterize the continuation parameter'sThomas Schwinge
parameter list. * i386/i386/pcb.c (stack_attach): Likewise.
2011-09-06Move i386/i386/locore.S declarations.Thomas Schwinge
* i386/i386/trap.c (recover_table, recover_table_end, retry_table) (retry_table_end): Move declarations to... * i386/i386/locore.h: ... here.
2011-09-02Use Mach native error codes instead of POSIX errno E* onesGuillem Jover
* device/errno.h: Remove file. * Makefrag.am (libkernel_a_SOURCES): Remove `device/errno.h'. * i386/i386at/com.c: Include <device/device_types.h> instead of <device/errno.h>. (comopen): Replace ENXIO with D_NO_SUCH_DEVICE. * i386/i386at/kd_event.c: Include <device/device_types.h> instead of <device/errno.h>. * i386/i386at/kd_mouse.c: Likewise. (mouseopen): Replace ENODEV with D_NO_SUCH_DEVICE and EBUSY with D_ALREADY_OPEN. * i386/i386at/lpr.c: Include <device/device_types.h> instead of <device/errno.h>. (lpropen): Replace ENXIO with D_NO_SUCH_DEVICE and EBUSY with D_ALREADY_OPEN.
2011-09-01Fix documentationSamuel Thibault
2011-09-01Close kernel stacks.Samuel Thibault
* i386/i386/pcb.c (stack_attach): Initialize ebp to 0.
2011-09-01Fix PC samplingSamuel Thibault
interrupt.S now saves the IRQ on the stack to acknowledge it later. * i386/i386/hardclock.c (hardclock): Add irq parameter. * i386/i386at/kd.c (kdintr, kdcheckmagic): Remove regs parameter. * i386/i386at/kd.h (kdintr): Likewise.
2011-08-31Optimize copyout pathSamuel Thibault
* i386/i386/locore.S (copyout): Remove RETRY() use from >=i486 variant. Move copyout_ret and copyout_fail.
2011-08-31Fix copyout retry on lazy allocation on >= i486Samuel Thibault
* i386/i386/locore.S (copyout): Add a >=i486 variant of copyout which uses no loop, but simply retries rep mov.
2011-08-31Disable global page while writing in kernel spaceSamuel Thibault
* i386/i386/db_interface.c (db_write_bytes): If CPU has PGE feature, disable CR4_PGE before enabling kernel page write access, and re-enable the former after disabling the latter.
2011-08-31Protect set_cr3 against compiler assignment optimizationsSamuel Thibault
This fixes the kdb `break' command. i386/i386/proc_reg.h (set_cr3): Add "memory" clobber.
2011-08-31Fix declarationsSamuel Thibault
* device/ds_routines.h (io_done_list): Add variable declaration. (device_io_map): Keep variable declaration and move definition to... * device/ds_routines.c: ... here. * i386/i386/fpu.c: Include <i386/pic.h> (curr_ipl): Remove declaration. (fpintr): Add int unit parameter. * linux/dev/glue/glue.h: New header. * i386/i386/fpu.h (fpintr): Add function prototype. * i386/i386/hardclock.c (clock_interrupt, linux_timer_intr): Remove prototypes. [LINUX_DEV]: Include <linux/dev/glue/glue.h> * i386/i386/ipl.h (curr_ipl): Add declaration. * i386/i386/pic.h (curr_pic_mask, pic_mask, prtnull, intnull): Add declarations. * i386/i386at/kd.h (kdintr): Add declaration. * i386/i386at/pic_isa.c: Include <i386/fpu.h> and <i386at/kd.h> (intnull, fpintr, hardclock, kdintr, prtnull): Remove prototypes. * i386/xen/xen.c: Include <kern/mach_clock.h> (clock_interrupt): Remove prototype. * linux/dev/arch/i386/kernel/irq.c: Include <linux/dev/glue/glue.h> and <machine/machspl.h> (linux_timer_intr, splhigh, spl0, curr_ipl, curr_pic_mask, pic_mask, get_options): Remove declarations. * linux/dev/drivers/block/floppy.c: Include <linux/dev/glue/glue.h> (issig, get_options): Remove declarations. * linux/dev/drivers/block/genhd.c: Include <linux/dev/glue/glue.h> (linux_intr_pri): Remove declaration. * linux/dev/glue/block.c: Include <devices/ds_routines.h> and <linux/dev/glue/glue.h>. (device_io_map, blksize_size): Remove declarations. * linux/dev/glue/kmem.c: Include <kern/printf.h> and <linux/dev/glue/glue.h> (alloc_contig_mem, printf): Remove declarations. * linux/dev/glue/misc.c: Include <printf.h> and <linux/dev/glue/glue.h> (vm_map_lookup_entry, printf): Remove prototypes. * linux/dev/glue/net.c: Include <kern/printf.h>, <device/ds_routines.h> and <linux/dev/glue/glue.h>. (linux_intr_pri, io_done_list): Remove declarations. * linux/dev/init/main.c: Include <machine/model_dep.h> and <linux/dev/glue/glue.h>. (phys_last_addr, alloc_contig_mem, free_contig_mem, init_IRQ, restore_IRQ, startrtclock, linux_version_init, linux_kmem_init, pci_init, linux_net_emulation_init, device_setup, linux_printk, linux_timer_intr, spl0, splhigh, form_pic_mask, linux_bad_intr, prtnull, intnull, linux_sched_init, pcmcia_init): Remove declarations. * linux/dev/kernel/sched.c: Include <kern/printf.h>, <machine/machspl.h> and <linux/dev/glue/glue.h>. (alloc_contig_mem, free_contig_mem, splhigh, splx, linux_soft_intr, issig, printf, linux_auto_config): Remove prototypes. * linux/dev/kernel/softirq.c: Include <linux/dev/glue/glue.h>. * linux/src/drivers/block/floppy.c: Include <linux/dev/glue/glue.h>. (get_options): Remove prototype. * linux/src/init/main.c: Include <linux/dev/glue/glue.h> (init_IRQ): Remove prototype.
2011-08-30Add linux_timer_intr function declarationGuillem Jover
* i386/i386/hardclock.c [LINUX_DEV] (linux_timer_intr): New prototype.
2011-08-30Remove unused variableGuillem Jover
* i386/i386at/rtc.c (rtc): Remove variable.
2011-08-30Cast function timeout() argument to fix a warningGuillem Jover
* kern/mach_clock.h (timer_func_t): New function type. (struct timer_elt): Change fcn type to timer_func_t. * i386/i386at/com.c (comstart): Cast `ttrstrt' to `timer_funct_t *' in `timeout' call. * i386/i386at/lpr.c (lprstart): Likewise,
2011-08-30Return a value on non-void functionGuillem Jover
* i386/i386at/com.c (comcnprobe, comcninit, comcnputc): Return 0.
2011-08-30Fix copyright assignmentSamuel Thibault
I have assigned copyright to the Free Software Foundation. * i386/i386/xen.h: Fix copyright assignment * i386/xen/xen.c: Likewise. * i386/xen/xen_boothdr.S: Likewise. * i386/xen/xen_locore.S: Likewise. * include/mach/xen.h: Likewise. * xen/block.c: Likewise. * xen/block.h: Likewise. * xen/console.c: Likewise. * xen/console.h: Likewise. * xen/evt.c: Likewise. * xen/evt.h: Likewise. * xen/grant.c: Likewise. * xen/grant.h: Likewise. * xen/net.c: Likewise. * xen/net.h: Likewise. * xen/ring.c: Likewise. * xen/ring.h: Likewise. * xen/store.c: Likewise. * xen/store.h: Likewise. * xen/time.c: Likewise. * xen/time.h: Likewise. * xen/xen.c: Likewise. * xen/xen.h: Likewise.
2011-08-30Console declaration cleanupSamuel Thibault
* device/cons.h: Add multiple inclusion _DEVICE_CONS_H macro protector. (struct consdev): Add function members prototypes. * i386/i386/xen.h: Include <mach/xen.h>. * i386/i386at/com.c (comcnprobe, comcninit, comcngetc, comcnputc): Move prototypes... * i386/i386at/com.h: ... here. Include <device/cons.h>. * i386/i386at/cons_conf.c [MACH_HYP]: Include <xen/console.h>. [!MACH_HYP]: Include "kd.h". [!MACH_HYP && NCOM > 0]: Include "com.h". (hypcnprobe, hypcninit, hypcngetc, hypcnputc, kdcnprobe, kdcninit, kdcngetc, kdcnputc comcnprobe, comcninit, comcngetc, comcnputc): Remove prototypes. * i386/i386at/kd.c (kdcnputc): Make it return int, -1 on error, 0 on success. (kdcnprobe, kdcninit, kdcngetc, kdcnputc): Move prototypes... * i386/i386at/kd.h: ... here. Include <device/cons.h>. * xen/console.c (hypcnprobe): Remove unused `my_console' local variable. * xen/console.h: Include <device/cons.h> (hypcnputc, hypcngetc, hypcnprobe, hypcninit): Add prototypes.
2011-08-29Make copyout run in 1 loop on >= i486Samuel Thibault
* i386/i386/locore.S (copyout): On >= i486, skip WP-check loop split and just use byte count.
2011-08-28Skip kernel WP check on i486 and aboveSamuel Thibault
* i386/i386/i386asm.sym (machine_slot.sub_type): Define. * i386/i386/locore.S (copyout_retry): Skip if machine_slot[0].cpu_type > 3.
2011-08-28Enable >4GiB cr3Samuel Thibault
* i386/xen/xen_boothdr.S (__xen_guest): Add [extended-cr3] to PAE (XEN_ELFNOTE_PAE_MODE): Likewise.
2011-08-28Disable (<i486)-only WP workaround on Xen & PAESamuel Thibault
i386 didn't support PAE anyway. * i386/i386/locore.S (copyout_retry) [MACH_HYP || PAE]: Remove. * xen/xen.c (hyp_invalidate_pte): Remove function. * xen/xen.h (hyp_invalidate_pte): Remove prototype.
2011-08-28Fix pmap_clear_bootstrap_pagetable with >4G mfnsSamuel Thibault
* i386/intel/pmap.c (pmap_clear_bootstrap_pagetable): Use pte_to_pa instead of atop.
2011-08-28Rework memory mapping reservationSamuel Thibault
* i386/i386/vm_param.h (VM_KERNEL_MAP_SIZE): Define to 192MiB. * i386/i386at/model_dep.c (mem_size_init): Use VM_KERNEL_MAP_SIZE instead of 1/6 factor. * i386/intel/pmap.c (morevm): Remove. (pmap_bootstrap): Use VM_KERNEL_MAP_SIZE instead of morevm.
2011-08-27Disable unused variablesGuillem Jover
* i386/i386at/com.c (comstart): Disable `i' variable. * linux/src/drivers/net/at1700.c (net_close): Disable `lp' variable. * linux/dev/include/linux/blk.h (end_request): Disable `nsect' variable on MACH.
2011-08-27Add prototypes for locore functionsGuillem Jover
* i386/i386at/model_dep.c (discover_x86_cpu_type): Move ... * i386/i386/locore.h: ... here. (inst_fetch, cpu_shutdown): New prototypes. * i386/i386at/kd.c: Include <i386/locore.h>.
2011-08-21Add 8byte breakpoint macroSamuel Thibault
* i386/i386/db_interface.h (I386_DB_LEN_8): Define macro.
2011-04-23Enable all cachesSamuel Thibault
* i386/i386at/model_dep.c (i386at_init): Set CR0_CD and CR0_NW in CR0 register.
2011-04-22Update constants to nowadays standardsSamuel Thibault
Follow-up to fa6c711d * vm/vm_object.c (DEVICE_IO_MAP_SIZE): Increase to 16MiB. * kern/kalloc.c (kalloc_map_size): Increase to 64MiB. * i386/intel/pmap.c (morevm): Increase to 128MiB.
2011-04-19Close call stack on continuationSamuel Thibault
* i386/i386/locore.S (call_continuation): Push dummy return address instead of letting the callee get a random one.
2011-04-03Fix build with kdb from make dist-generated tarballSamuel Thibault
* Makefrag.am (libkernel_a_SOURCES): Add ddb/db_cond.h, ddb/db_examine.h, ddb/db_input.h, ddb/db_macro.h, ddb/db_trap.h. * i386/Makefrag.am (libkernel_a_SOURCES): Add i386/i386/db_interface.h
2011-03-21Fix typoSamuel Thibault
* i386/i386at/kd.c (key_map): Fix K_PERIOD typo.
2011-03-20Clean kd.[ch]Samuel Thibault
* i386/i386at/kd.h (NUMSTATES): Fix comment about NORM_STATE. * i386/i386at/kd.c (key_map): Use K_* macros instead of numeric values.
2011-03-11Fix continuation after keyboard debugger invocationSamuel Thibault
According to stack layout change in 5da1aea7 * i386/i386/locore.S [!MACH_XEN] (RET_OFFSET): Define to 12 instead of 8.
2011-03-06Enable global pages after enabling pagingSamuel Thibault
* i386/i386at/model_dep.c (i386at_init): Enable CR4_PGE after enabling CR0_PG.
2011-03-05Fix temporary direct mapping during page table enablingSamuel Thibault
* i386/i386at/model_dep.c (i386at_init): Count the number of actually needed temporary L1 direct mapping by getting the last used address from init_alloc_aligned(), instead of hardcoding it to 1 or 3, and then use a for loop.
2011-03-03Keep supplementary L1 pages read-onlySamuel Thibault
* i386/intel/pmap.c (pmap_bootstrap): Fix loop which keeps supplementary L1 pages read-only: break as soon as one of the L1 supplementary pages has been recognized, so that its pte does not get rewritten read-write.
2011-02-27Re-enable updating pvlist for kernel_pmapSamuel Thibault
This partially reverts 0744feb6 * i386/intel/pmap.c (pmap_remove_range): Update pvlist for kernel_pmap too.
2011-02-27Acknoledge interrupt after handler callSamuel Thibault
This fixes interrupt overflows when software interrupts processing gets slower than hardware. * i386/i386at/interrupt.S (interrupt): Issue EOI to PICs after having called the interrupt handler and disabled interrupts through cli.
2011-02-27Detect interrupt overflowSamuel Thibault
* i386/i386/locore.S (int_from_instack): Check %esp against _intstack, issue ud2 on stack overflow.
2011-02-27Add x86 debug register Xen supportSamuel Thibault
* i386/xen/xen_boothdr.S: Add global visibility to __hyp_* symbols. * i386/i386/locore.S [MACH_XEN] (dr6,dr0,dr1,dr2,dr3): Make get_debugreg and set_debugreg hypercalls to manipulate debug registers. (dr0,dr1,dr2,dr3): Fix dr7 field shift. * i386/i386/xen.h (hyp_set_debugreg, hyp_get_debugreg): New prototypes.