summaryrefslogtreecommitdiff
path: root/i386
AgeCommit message (Collapse)Author
2013-11-15i386/i386/fpu.c: remove register qualifiersMarin Ramesa
* i386/i386/fpu.c: Remove register qualifiers.
2013-11-15i386/i386/db_trace.c: qualify constants with constMarin Ramesa
* i386/i386/db_trace.c: Qualify constants with const.
2013-11-15i386/i386/db_trace.c: remove register qualifiersMarin Ramesa
* i386/i386/db_trace.c: Remove register qualifiers.
2013-11-15i386/i386/db_interface.c: remove register qualifiersMarin Ramesa
* i386/i386/db_interface.c: Remove register qualifiers.
2013-11-15Fix typoMarin Ramesa
2013-11-15i386/i386/vm_tuning.h: remove fileMarin Ramesa
* i386/Makefrag.am: Remove i386/i386/vm_tuning.h. * i386/i386/vm_tuning.h: Remove file. * vm/vm_pageout.c: Don't include i386/i386/vm_tuning.h.
2013-11-15i386/i386at: add ifndefsMarin Ramesa
* i386/i386at/kd_queue.h: Add ifndef. * i386/i386at/kdsoft.h: Likewise. * i386/i386at/lprreg.h: Likewise. * i386/i386at/rtc.h: Likewise.
2013-11-09Remove lint codeMarin Ramesa
2013-08-28Drop FXSR initialization messageSamuel Thibault
* i386/i386/fpu.c (init_fpu): Drop FXSR initialization message
2013-07-18ddb: cleanup db_command.cMarin Ramesa
* ddb/db_command.c (_longjmp): Remove prototype. (vm_map_print): Likewise. (vm_object_print): Likewise. (vm_page_print): Likewise. (vm_map_copy_print): Likewise. (ipc_port_print): Likewise. (ipc_pset_print): Likewise. (db_show_all_slocks): Likewise. (ipc_kmsg_print): Likewise. (ipc_msg_print): Likewise. Include <vm/vm_print.h>. Include <ipc/ipc_print.h>. Include <kern/lock.h>. * i386/i386/setjmp.h [__GNUC__] (_longjmp): Add prototype.
2013-07-07fix implicit declarationsMarin Ramesa
* ddb/db_trap.c: Include <machine/setjmp.h>. * i386/i386/setjmp.h (_setjmp): Add prototype.
2013-06-10Add missing 4KiB memorySamuel Thibault
* i386/i386at/model_dep.c (init_alloc_aligned): Let allocated area last until end of memory map.
2013-06-10Add non-contiguous mmap supportSamuel Thibault
* i386/include/mach/i386/multiboot.h (multiboot_mmap): New structure * i386/i386at/model_dep.c (mem_size_init): Parse boot_info.mmap_addr if available. (init_alloc_aligned): Likewise.
2013-03-11Fix build without kdbSamuel Thibault
* i386/i386/db_interface.h [! MACH_KBD] (db_set_hw_watchpoint, db_clear_hw_watchpoint, db_dr): Do not declare functions.
2013-02-04Plug hw debug register support into kdbSamuel Thibault
Make the `watch' command use hw debug registers whenever possible. * ddb/db_watch.c (db_set_hw_watchpoint, db_clear_hw_watchpoint): Add functions prototypes. (db_set_watchpoints): Try to call db_set_hw_watchpoint. (db_clear_watchpoints): Call db_clear_hw_watchpoint. * i386/i386/db_interface.c: Include <ddb/db_watch.h> (db_set_hw_watchpoint): Take a db_watchpoint_t WATCH parameter instead of its content. Remove support for clearing a debug register. (db_clear_hw_watchpoint): Add function. * i386/i386/db_interface.h: Include <ddb/db_watch.h>. (db_set_hw_watchpoint): Fix function prototype. (db_clear_hw_watchpoint): Add function prototype. * i386/i386/db_machdep.h: Do not include <machine/db_interface.h>
2013-02-04Add x86 hardware debugging register supportSamuel Thibault
This adds using the x86 hardware debugging registers, either from the kernel through db_set_hw_watchpoint, or from userland through i386_DEBUG_STATE. While the kernel is using the registers, the userland values are ignored. * i386/i386/db_interface.c (kernel_dr, ids): New variables. (db_load_context, db_get_debug_state, db_set_debug_state, db_dr, db_set_hw_watchpoint): New functions. (kdb_trap): Use get_dr* instead of dr_addr[]. * i386/i386/db_interface.h (db_user_to_kernel_address, db_set_hw_watchpoint) (db_dr, db_get_debug_state, db_set_debug_state, db_load_context): Add functions prototypes. (dr0, dr1, dr2, dr3): Remove functions prototypes. * i386/i386/locore.S (dr6, dr0, dr1, dr2, dr3): Remove functions. (dr_msk, dr_addr): Remove variables. * i386/include/mach/i386/thread_status.h (i386_DEBUG_STATE): Add macro. (i386_debug_state): Add structure. (i386_DEBUG_STATE_COUNT): Add macro. * i386/i386/thread.h: Include <mach/machine/thread_status.h>. (i386_machine_state): Add `struct i386_debug_state ids' field. * i386/i386/pcb.c: Include <i386/db_interface.h>. (switch_ktss): Call db_load_context. (thread_setstatus, thread_getstatus): Add I386_DEBUG_STATE case. * i386/i386/proc_reg.h (get_dr0, set_dr0, get_dr1, set_dr1, get_dr2, set_dr2, get_dr3, set_dr3, get_dr6, set_dr6, get_dr7, set_dr7): Add macros.
2013-02-03Prevent the kernel from making any FPU useSamuel Thibault
* i386/Makefrag.am (AM_CFLAGS): Add -mno-3dnow -mno-mmx -mno-sse -mno-sse2.
2013-01-31Implement pmap_map_mfn for the PVH caseSamuel Thibault
* i386/intel/pmap.c (pmap_map_mfn) [MACH_XEN && !MACH_PV_PAGETABLES]: Implement.
2013-01-31Make the PVH variant get sure that the support is available in the hypervisorSamuel Thibault
* i386/xen/xen_boothdr.S (FEATURES): Mark PVH features as required.
2013-01-30Add comment for TODOSamuel Thibault
2013-01-30Do not use 4gb segment assistance in PVHSamuel Thibault
* i386/i386/gdt.c (gdt_init) [MACH_PV_DESCRIPTORS && !MACH_PV_PAGETABLES]: Do not enable VMASST_TYPE_4gb_segments. * i386/i386/trap.c (user_trap): Do not handle trap 15, 4gb segment assist notification.
2013-01-30Drop spurious inclusionSamuel Thibault
* i386/i386/vm_param.h [MACH_XEN && !MACH_PV_PAGETABLES]: Do not include <xen/public/xen.h>.
2013-01-30Increase VM_MAX_KERNEL_ADDRESS for PVH caseSamuel Thibault
* i386/i386/vm_param.h (VM_MAX_KERNEL_ADDRESS) [MACH_XEN && !MACH_PV_PAGETABLES]: Remove hypervisor area from VM_MAX_KERNEL_ADDRESS restriction.
2013-01-28More ifdef fixes for ring1 support and pv descriptors supportSamuel Thibault
* i386/i386/idt_inittab.S: Turn MACH_XEN test into MACH_PV_DESCRIPTORS test. * i386/i386/fpu.c: Turn appropriate MACH_HYP/XEN tests into MACH_RING1 tests. * i386/i386/ktss.c: Likewise. * i386/i386/locore.S: Likewise. * i386/i386/mp_desc.c: Likewise. * i386/i386/pcb.c: Likewise. * i386/i386/proc_reg.h: Likewise. * i386/i386/trap.c: Likewise.
2013-01-28Add initial code for disabling PV pagetablesSamuel Thibault
* xen/configfrag.ac (--disable-pv-pagetables): Add option. * i386/xen/xen_boothdr.S (XEN_ELFNOTE_FEATURES) [!MACH_PV_PAGETABLES]: Add writable_page_tables. * i386/i386/gdt.c: Turn appropriate MACH_XEN/MACH_HYP tests into MACH_PV_PAGETABLES tests. * i386/i386/i386asm.sym: Likewise * i386/i386/ldt.c: Likewise * i386/i386/locore.S: Likewise * i386/i386/proc_reg.h: Likewise * i386/i386/user_ldt.c: Likewise * i386/i386/vm_param.h: Likewise * i386/i386/xen.h: Likewise * i386/i386at/model_dep.c: Likewise * i386/intel/pmap.h: Likewise * include/mach/xen.h: Likewise * xen/console.c: Likewise * xen/store.c: Likewise * i386/intel/pmap.c: Likewise. Define pmap_map_mfn as TODO stub.
2013-01-28Fix commentsSamuel Thibault
2013-01-28Fix build with --disable-pseudo-physSamuel Thibault
* i386/i386/i386asm.sym (PFN_LIST) [!MACH_PSEUDO_PHYS]: Do not define.
2013-01-28Add initial code for disabling ring1 xen executionSamuel Thibault
* xen/configfrag.ac (--disable-ring1): Add option. * i386/xen/xen_boothdr.S (XEN_ELFNOTE_FEATURES) [!MACH_RING1]: Add supervisor_mode_kernel. * i386/i386/seg.h (KERNEL_RING) [!MACH_RING1]: Set macro to 0.
2013-01-28Add initial code for disabling PV descriptorsSamuel Thibault
* xen/configfrag.ac (--disable-pv-descriptors): Add option * i386/xen/xen_boothdr.S (XEN_ELFNOTE_FEATURES) [!MACH_PV_DESCRIPTORS]: Add writable_descriptor_tables. * i386/i386/gdt.c: Turn appropriate MACH_XEN/MACH_HYP tests into MACH_PV_DESCRIPTORS tests. * i386/i386/gdt.h: Likewise. * i386/i386/i386asm.sym: Likewise. * i386/i386/idt.c: Likewise. * i386/i386/idt_inittab.S: Likewise. * i386/i386/ldt.c: Likewise. * i386/i386/pcb.c: Likewise. * i386/i386/seg.h: Likewise. * i386/i386/user_ldt.c: Likewise. * i386/i386/user_ldt.h: Likewise.
2012-07-14Fix Xen boot at linear address 0xC0000000Samuel Thibault
* i386/intel/pmap.c (pmap_bootstrap): Interate over linear addresses and compute l3 and l2 offsets from it instead of assuming nul l3 offset.
2012-05-05Offset kernel addresses by 3GiBSamuel Thibault
This permits better trace support in kdb. * i386/i386/vm_param.h (VM_MIN_KERNEL_ADDRESS): Set to 0xC0000000 * i386/Makefrag.am (_START): Set to 0xC0100000.
2012-05-05Document how to offset the kernel to get better debuggingSamuel Thibault
* i386/i386/vm_param.h (VM_MIN_KERNEL_ADDRESS): Document that it can be changed, but _START has to be offset too. (INIT_VM_MIN_KERNEL_ADDRESS): Document that it should remain 0.
2012-04-06Check hyp_stack_switch returnSamuel Thibault
* i386/i386/pcb.c (switch_ktss): Check value returned by hyp_stack_switch.
2012-03-24Fix Xen boot after c74adfeSamuel Thibault
* i386/Makefrag.am (_START_MAP): Define symbol to 0x100000. * i386/xen/Makefrag.am (_START_MAP): Define symbol to 0xC0000000. * i386/ldscript: Use _START_MAP instead of hardcoding 0x100000.
2012-03-24Relocate kernel at bootupSamuel Thibault
Grub is not able to map us at high addresses. We can however make it load us at low addresses (through the linker script mapping), then use segmentation to move ourselves to high addresses, and switch to C which uses high addresses (through _START definition). * i386/ldscript: Force mapping kernel at 0x100000, regardless of the value of _START. * i386/i386at/boothdr.S (boot_entry): Set up initial segments to project the bootstrap linear space to high addresses.
2012-03-24Make sure BIOS area is mapped in kernel threadsSamuel Thibault
* i386/i386at/model_dep.c (i386at_init): Map BIOS memory at 0. * i386/intel/pmap.c (pmap_create): Do not map BIOS memory in user tasks.
2012-03-24Separate INIT_VM_MIN_KERNEL_ADDRESS from VM_MIN_KERNEL_ADDRESSSamuel Thibault
The former is the initial value set by the bootloader. It may not be the same as what Mach will set up. * i386/i386/vm_param.h (INIT_VM_MIN_KERNEL_ADDRESS): New macro. * i386/i386at/model_dep.c (i386at_init): Use INIT_VM_MIN_KERNEL_ADDRESS instead of VM_MIN_KERNEL_ADDRESS.
2012-03-24Add missing phystokv/kvtophys callsSamuel Thibault
* i386/i386/vm_param.h [!MACH_XEN]: Do not include <xen/public/xen.h>. * i386/i386at/model_dep.c (init_alloc_aligned): Use phystokv to compare physical memory addresses with kernel start, end, and symbol table. * i386/intel/pmap.c (pmap_enter): Use kvtophys to convert ptp pointer to pte entry. * linux/dev/init/main.c (alloc_contig_mem, linux_init): Use phystokv to convert allocated pages to virtual pointer. * linux/src/include/asm-i386/io.h: Include <machine/vm_param.h>. (virt_to_phys): Call _kvtophys. (phys_to_virt): Call phystokv. * linux/src/include/linux/compatmac.h: Include <asm/io.h>. (ioremap): Use phys_to_virt to convert physical address to virtual pointer. (my_iounmap): Likewise. * linux/dev/include/asm-i386/page.h: Include <mach/vm_param.h>. (PAGE_SHIFT, PAGE_SIZE, PAGE_MASK): Remove macros. * linux/src/drivers/scsi/ncr53c8xx.c (vm_size_t): Remove type. * linux/dev/glue/net.c: Include <machine/vm_param.h> (device_write): Call phystokv to convert from physical page address to virtual pointer. * linux/dev/glue/block.c (alloc_buffer, free_buffer, rdwr_full): Likewise.
2012-03-24Fix wrap-around in pmap bootstrapSamuel Thibault
* i386/intel/pmap.c (pmap_bootstrap): Check against `va' wrap around 0xffffffff.
2012-03-23Fix boot with big values of _startSamuel Thibault
When _start is not close to 0, just using init_alloc_aligned() is not enough to know how much should be duplicated between linear and virtual mappings. Just mapping everything that can be is not very costly and should just work when it can work. * i386/i386at/model_dep.c (i386at_init) [VM_MIN_KERNEL_ADDRESS != LINEAR_MIN_KERNEL_ADDRESS]: Extend `nb_direct' to VM_MIN_KERNEL_ADDRESS - LINEAR_MIN_KERNEL_ADDRESS.
2012-03-22Refer to `PFN_LIST' on Xen only.Ludovic Courtès
* i386/i386/i386asm.sym (PFN_LIST): Enclose in #ifdef MACH_XEN. Thanks to Samuel Thibault for the suggestion.
2012-03-20Use long typesSamuel Thibault
* ddb/db_examine.c (db_xcdump): Do not cast addr before passing to db_read_bytes. * ddb/db_macro.c (db_arg_variable): Return long. * ddb/db_macro.h (db_arg_variable): Likewise. * ddb/db_sym.c (db_maxoff): Set type to unsigned long. * ddb/db_task_thread.c (db_set_default_thread, db_get_task_thread): Return long. * ddb/db_variables.h (db_variable): Make fcn function field to return long. (FCN_NULL): Make function type return long. * i386/i386/db_interface.c (int_regs): Set field sizes to long. * i386/i386/db_machdep.h (db_expr_t): Set type to long. * i386/i386/db_trace.c (db_i386_reg_value): Return long. Use long types. (i386_frame, i386_kregs, interrupt_frame, db_nextframe): Set field sizes to long. (db_regs, i386_kregs): Use long * pointers. (db_lookup_i386_kreg): Return long *. (db_numargs, db_nextframe, db_stack_trace_cmd, db_i386_stack_trace): Use long types. * i386/i386/debug_i386.c (dump_ss): Fix format. * i386/i386/ktss.c (ktss_init): Use long type. * i386/i386/pcb.c (set_user_regs): Likewise. * i386/i386/thread.h (i386_saved_state, v86_segs, i386_kernel_state, i386_interrupt_state): Set field sizes to long. * i386/i386/trap.c (kernel_trap, user_trap): Fix formats. * kern/ast.h (ast_t): Set type to long. * kern/boot_script.c (create_task, resume_task, prompt_resume_task, boot_script_set_variable): Use long types. * kern/boot_script.h (boot_script_set_variable): Use long type. * kern/bootstrap.c (bootstrap_create): Pass long type. * kern/lock.c (simple_lock, simple_lock_try): Use long type. * linux/dev/kernel/softirq.c (linux_soft_intr): Fix format.
2012-03-20Make xchgl arch-neutralSamuel Thibault
* i386/i386/xen.h (xchgl): Use xchg instruction instead of xchgl, so the assembler can detect unsigned long size.
2012-03-20Use compiler defined __i386__ symbol instead of use defined i386Guillem Jover
* i386/configfrag.ac (i386): Remove definition. * i386/intel/pmap.c (pmap_update_interrupt): Rename i386 to __i386__. * i386/intel/pmap.h: Likewise. * kern/debug.c (Debugger): Likewise. * kern/lock.c (simple_lock, simple_lock_try, db_show_all_slocks): Likewise.
2012-03-20Match type for count with tty_get_status and tty_set_statusGuillem Jover
* i386/i386at/com.c (comgetstat): Use natural_t instead of `unsigned int'. (comsetstat): Likewise. * i386/i386at/kd.c (kdgetstat, kdsetstat): Likewise. * i386/i386at/lpr.c (lprgetstat, lprsetstat): Likewise.
2012-03-19Use unsigned int for ELF 32bit valuesSamuel Thibault
* i386/include/mach/i386/exec/elf.h (Elf32_Addr, Elf32_Off, Elf32_Sword, Elf32_Word): Use int type instead of long.
2012-03-18Use unsigned long types for addressesSamuel Thibault
* i386/include/mach/i386/vm_param.h (i386_btop, i386_ptob, i386_round_page, i386_trunc_page): Cast to unsigned long.
2012-03-18Use unsigned long for registersSamuel Thibault
* i386/i386/proc_reg.h (get_eflags, get_esp, get_eflags, get_cr0, get_cr2, get_cr3, get_cr4): Return unsigned long type. (set_eflags, set_cr0, set_cr3, set_cr4): Take unsigned long type.
2012-03-18Do not hardcode structure offsetSamuel Thibault
* i386/i386/i386asm.sym (R_EDI): Define macro. * i386/i386/locore.S (t_page_fault): Use R_CR2-R_EDI instead of hardcoded 12.
2012-03-18Set Xen kernel virtual address to 0xC0000000Samuel Thibault
That makes the virtual addressing equal to linear addressing, thus optimizing some computations away. * i386/i386/vm_param.h (VM_MIN_KERNEL_ADDRESS) [MACH_XEN]: Set to 0xC0000000UL. * i386/xen/Makefrag.am (gnumach_LINKFLAGS): Set _START to 0xC0000000. * i386/xen/xen_boothdr.S (VIRT_BASE, ELF_PADDR_OFFSET): Set to 0xC0000000.