summaryrefslogtreecommitdiff
path: root/i386
AgeCommit message (Collapse)Author
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.
2011-02-27Add prototypes for x86 debug registersSamuel Thibault
* i386/i386/db_interface.h (I386_DB_TYPE_X, I386_DB_TYPE_W, I386_DB_TYPE_RW, I386_DB_LEN_1, I386_DB_LEN_2, I386_DB_LEN_4, I386_DB_LOCAL, I386_DB_GLOBAL): New macros. (dr0, dr1, dr2, dr3): New function prototypes.
2011-02-27Fix for kdb watch commandSamuel Thibault
* i386/intel/pmap.c (pmap_remove_range): Do not update pvlist for kernel_map. [MACH_KBD] (pmap_enter): Allow physical memory remapping.
2011-02-26Add console=comN boot option to enable serial consoleSamuel Thibault
* i386/configfrag.ac (RCLINE, RCADDR): Remove defines. * i386/i386at/com.c: Include <string.h> and <util/atoi.h> [!RCLINE] (RCBAUD, comcndev, comcnprobe, comcninit, comcngetc, comcnputc): Declare and define macro, variable, and functions. (rcline): New variable. (kernel_cmdline): New declaration. (comcnprobe): Detect "console=comN" option and set rcline accordingly, use rcline instead of RCLINE for serial console selection. * i386/i386at/cons_conf.c [NCOM>0 && !RCLINE] (comcnprobe, comcninit, comcngetc, comcnputc): Declare functions. [NCOM>0 && !RCLINE] (constab): Enable "com" console. * i386/i386at/kd_event.c (kbdopen): Call kdinit function, for when the VGA+pckbd console was not initialized.
2011-01-31Enable pae_extended_cr3 in pmap_bootstrapSamuel Thibault
* i386/i386/gdt.c (gdt_init): Do not enable VMASST_TYPE_pae_extended_cr3. * i386/intel/pmap.c (pmap_bootstrap): Enable VMASST_TYPE_pae_extended_cr3.
2011-01-31Enable Xen >4GiB physical memory supportSamuel Thibault
* i386/i386/gdt.c (gdt_init): Enable VMASST_TYPE_pae_extended_cr3. * i386/i386/xen.h: Drop actually-unneeded comment. * i386/xen/xen_boothdr.S (FEATURES) [MACH_PSEUDO_PHYS]: Add pae_pgdir_above_4gb. (XEN_ELFNOTE_FEATURES) [MACH_PSEUDO_PHYS]: Add pae_pgdir_above_4gb.
2011-01-31Drop kbd device on xenSamuel Thibault
* i386/Makefrag.am (libkernel_a_SOURCES): Move i386/i386at/kd_event.[ch] and i386/i386at/kd_queue.[ch] to [PLATFORM_at]. * i386/i386at/conf.c (dev_name_list): Move kbd device to [!MACH_HYP].
2011-01-15Avoid dropping kd_intr when RCLINE is >= 0Samuel Thibault
* i386/i386at/kd.c (kdintr): Return immediately if !kd_initialized. * i386/i386at/pic_isa.c (ivect) [RCLINE >= 0]: Enable kdintr in that case too.