aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix hardclock build on 64bitEtienne Brateau2020-03-281-1/+1
| | | | * i386/i386/hardclock.c [ATX86_64]: Include <i386/ipl.h>.
* build system: Add 64bit variantSamuel Thibault2020-03-284-1/+331
| | | | | | | | | Only Xen platform for now. * Makefrag.am [HOST_x86_64]: Include x86_64/Makefrag.am. * configure.ac: Include x86_64/configfrag.ac. [default:x86_64] (host_platform): Set platform to xen. * x86_64/Makefrag.am, x86_64/configfrag.ac: New files.
* Add 64bit/32bit compatibility symlinksSamuel Thibault2020-03-282-0/+2
| | | | | | This makes inclusions easier. * x86_64/include/mach/x86_64, x86_64/x86_64: New symlinks.
* xen: Add 64bit variantSamuel Thibault2020-03-282-0/+335
| | | | * x86_64/xen_boothdr.S, x86_64/xen_locore.S: New files.
* spl: Add 64bit variantSamuel Thibault2020-03-281-0/+255
| | | | * x86_64/spl.S: New file.
* locore: Add 64bit variantSamuel Thibault2020-03-281-0/+1580
| | | | * x86_64/locore.S: New file.
* ldscript: Add 64bit variantSamuel Thibault2020-03-281-0/+219
| | | | * x86_64/ldscript: New file.
* idt_inittab: Add 64bit variantSamuel Thibault2020-03-281-0/+146
| | | | * x86_64/idt_inittab.S: New file.
* debug_trace: Add 64bit variantSamuel Thibault2020-03-281-0/+56
| | | | * x86_64/debug_trace.S: New file.
* cswitch: Add 64bit variantSamuel Thibault2020-03-281-0/+150
| | | | * x86_64/cswitch.S: New file.
* Fix 64bit linkSamuel Thibault2020-03-281-0/+1
| | | | * Makefile.am (clib_routines): Add __rela_iplt_start __rela_iplt_end.
* pmap.h: Add 64bit variantSamuel Thibault2020-03-283-18/+153
| | | | | | | | | | | | | | * i386/intel/pmap.h (L4SHIFT, L4MASK, lin2l4num): New macros (PDPNUM, PDPMASK, set_pmap): Add 64bit variant. Make PAE use the 64bit mask too. (pmap): Add l4base, user_l4base, user_pdpbase fields. * i386/intel/pmap.c (pmap_bootstrap): Clear the whole PDP. Enable write bit in PDP. Set user pagetable to NULL. Initialize l4base. (pmap_clear_bootstrap_pagetable): Add 4th-level support. (pmap_ceate): Clear the whole PDP. Enable write bit in PDP. Initialize l4base, user_pdpbase, user_l4base. (pmap_destroy): Clear l4base, user_pdpbase, user_l4base. * i386/i386at/model_dep.c (i386at_init): Load l4base on 64bits.
* trap.c: Add 32bit lcall 7 emulation on 64bitSamuel Thibault2020-03-281-0/+16
| | | | * i386/i386/trap.c: Detect lcall 7 instructions.
* bootstrap.c: Add 32-on-64bit supportSamuel Thibault2020-03-281-2/+20
| | | | | * kern/bootstrap.c (bootstrap_create): Support loading 32bit binaries on 64bit.
* Fix tab vs spacesSamuel Thibault2020-03-285-15/+15
|
* * xen/evt.c: Add 64bit variantSamuel Thibault2020-03-281-0/+5
| | | | * xen/evt.c (hyp_intrinit): Fix hyp_set_callbacks for 64bit.
* syscall_sw.h: Add 64bit variantSamuel Thibault2020-03-281-0/+3
| | | | * kern/syscall_sw.h (mach_trap_t): Fix structure for 64bit.
* include/mach/xen.h: Add 64bit variantSamuel Thibault2020-03-281-0/+4
| | | | * include/mach/xen.h (PFN_LIST): Set to MACH2PHYS_VIRT_START.
* multiboot.h: Add 64bit variantSamuel Thibault2020-03-281-0/+17
| | | | | * i386/include/mach/i386/multiboot.h (multiboot32_module): New structure.
* asm.h: Add 64bit variantSamuel Thibault2020-03-281-0/+27
| | | | | | * i386/include/mach/i386/asm.h (S_ARG0, S_ARG1, S_ARG2, S_ARG3, S_ARG4, S_ARG5, FRAME, EMARF, B_ARG0, B_ARG1, B_ARG2, B_ARG3, INT_FIX): Add 64bit variants.
* xen.h: Add 64bit variantSamuel Thibault2020-03-281-46/+86
| | | | | | | | | | | * i386/i386/xen.h (_hypcall_ret, _hypcall_arg1, _hypcall_arg2, _hypcall_arg3, _hypcall_arg4, _hypcall_arg5): New macros. (_hypcall0, _hypcall1, _hypcall2, _hypcall3, _hypcall4, _hypcall5): Fix parameters and return type. (set_callbacks, update_descriptor, set_segment_base, update_va_mapping, set_timer_op): Add 64bit variant. (hyp_set_user_cr3): New macro. (iretq): New macro.
* vm_param: Add 64bit variantSamuel Thibault2020-03-281-3/+16
| | | | | | * i386/i386/vm_param.h (VM_MIN_KERNEL_ADDRESS, HYP_VIRT_START, LINEAR_MIN_KERNEL_ADDRESS, LINEAR_MAX_KERNEL_ADDRESS): Add 64bit variants.
* thread.h: Add 64bit variantSamuel Thibault2020-03-281-0/+26
| | | | | * i386/i386/thread.h (i386_saved_state, i386_kernel_state, i386_interrupt_state): Add 64bit registers.
* setjmp: Add 64bit variantSamuel Thibault2020-03-282-0/+69
| | | | | * x86_64/_setjmp.S: New file * i386/i386/setjmp.h (jmp_buf): Add 64bit variant.
* i386asm.sym: Add 64bit variantSamuel Thibault2020-03-281-0/+11
| | | | | * i386/i386/i386asm.sym (KSS_ESI, KSS_EDI): Remove. (KSS_R12, KSS_R13, KSS_R14, KSS_R15, r15): Add.
* gdt: 64bit VariantSamuel Thibault2020-03-281-0/+2
| | | | | | There is no segmentation in 64bit mode. * i386/i386/gdt.c (gdt_init): Do not load segments on 64bit.
* db_trace: Add 64bit variantSamuel Thibault2020-03-281-0/+8
| | | | | * i386/i386/db_trace.c (i386_kregs): On 64bit, remove edi and esi, and add r12, r13, r14, r15.
* db_interface: Add 64bit variantSamuel Thibault2020-03-281-0/+14
| | | | | * i386/i386/db_interface.c (int_regs): Drop edi/esi fields on 64bit. (kdb_kentry): Fix saving rsi/rdi.
* cpu_number: Add 64bit variantSamuel Thibault2020-03-281-0/+5
| | | | * i386/i386/cpu_number.h (CX): Add 64bit variant.
* Fix inl result sizeEtienne Brateau2020-03-281-1/+1
| | | | | * i386/i386/pio.h (inl): Make result unsigned int instead of unsigned long.
* vm_object_copy_call: Make sure vm_object_enter succeedsSamuel Thibault2020-03-151-0/+1
| | | | | | | Suggested by guy fleury iteriteka <gfleury@disroot.org> * vm/vm_object.c (ipc/mavm_object_copy_call): Make sure vm_object_enter call succeeds.
* Set readtodc parameter 64bitSamuel Thibault2020-03-094-10/+7
| | | | | | | | | In order to fix year 2038 limit. * i386/i386at/rtc.h (readtodc): Make tp parameter uint64_t *. * i386/i386at/rtc.c (readtodc): Likewise. * xen/time.c (readtodc): Likewise. * i386/i386at/model_dep.c (inittodr): Pass uint64_t pointer to readtodc.
* Set time_t type to 64bitSamuel Thibault2020-01-282-2/+2
| | | | | | | In order to fix year 2038 limit in RTC driver * include/sys/types.h (time_t): Bump type to 64bit. * Makefile.am (clib_routines): Also allow __moddi3.
* doc: Fix mapped-time exampleSamuel Thibault2020-01-271-0/+2
| | | | | | | | One needs to use memory barriers to be sure to be reading values in the proper order. * doc/mach.texi (Host Time): Add __sync_synchronize() in mapped-time example.
* Cope with machine_info.memory_size overflowSamuel Thibault2020-01-011-1/+6
| | | | | * kern/startup.c (setup_main): When memory size overflows machine_info.memory_size, set to maximum size.
* i386: use 64bit precision by defaultSamuel Thibault2019-12-011-4/+4
| | | | | | | This is the System V ABI default. * i386/i386/fpu.c (fpinit): Use FPC_PC_64 instead of FPC_PC_53. (fp_state_alloc): Likewise.
* irq: Add disabling counterSamuel Thibault2019-11-122-4/+53
| | | | | | | | | | | * linux/dev/arch/i386/kernel/irq.c (ndisabled_irq): New array. (__disable_irq, __enable_irq): New functions, count with ndisabled_irq before really calling mask_irq/unmask_irq. (linux_pic_mask): New variable. (disable_irq, enable_irq): Manage linux_pic_mask and call __disable_irq/__enable_irq instead of calling mask_irq/unmask_irq. * linux/src/include/asm-i386/irq.h (__disable_irq, __enable_irq): New prototypes.
* PIC: Acknowledge interrupts more carefullySamuel Thibault2019-11-111-7/+37
| | | | | | | | | Specs seems to be saying that we should mask an irq out while acknowledging it with EOI. Also, better acknowledge only the concerned irq. * i386/i386at/interrupt.S (interrupt): Mask irq before notifying EOI. Using specific EOI instead of unspecific EOI.
* PIC: fix EOI valuesSamuel Thibault2019-11-111-6/+6
| | | | | * i386/i386/pic.h (SPECIFIC_EOI, ROT_NON_SPEC, SET_ROT_AEOI, ROT_SPEC_EOI, SET_PRIORITY, NO_OPERATION): Shift value left by one bit.
* intnull: Only warn once.Samuel Thibault2019-11-111-1/+10
| | | | | | | On real hardware, irq 7 seems to get raised often for some reason. * i386/i386/pic.c (intnull): Only print once the warning about interrupt being unexpectedly raised.
* spl: Remove intpri arraySamuel Thibault2019-11-1012-89/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And simplify prtnull vs intnull vs linux_bad_intr. * i386/i386/ipl.h (intpri): Remove declaration * i386/i386/pic.c (prtnull_count): Remove variable. (prtnull): Remove function. * i386/i386/pic.h (prtnull): Remove declaration. * i386/i386at/autoconf.c (take_dev_irq, take_ctlr_irq): Use ivect instead of intpri to determine irq availability. Do not set intpri. * i386/i386at/pic_isa.c (ivect): Replace prtnull with intnull. (intpri): Remove array. * linux/dev/arch/i386/kernel/irq.c (linux_intr_pri): Remove variable. (linux_bad_intr): Remove function. (setup_x86_irq): Do not check intpri coherency. Do not set intpri. Set default ivect to intnull instead of linux_bad_intr. (probe_irq_on): Check ivect against intnull instead of linux_bad_intr. Do not set intpri. (probe_irq_off): Likewise. (reserve_mach_irqs): Do not check against prtnull. (old_clock_pri): Remove variable. (init_IRQ): Do not set intpri. Do not set ivect to linux_bad_intr. (restore_IRQ): Do not set ivect. * i386/i386/pit.c (clkstart): Do not set intpri. * i386/i386at/kd_mouse.c (kd_mouse_open, kd_mouse_close): Likewise. * linux/dev/drivers/block/genhd.c (device_setup): Do not set linux_intr_pri. * linux/dev/glue/block.c (init_partition, device_open): Likewise. * linux/dev/glue/net.c (device_open): Likewise. * linux/dev/glue/glue.h (linux_intr_pri, linux_bad_intr): Remove declarations.
* Make default boot less scarySamuel Thibault2019-11-102-10/+19
| | | | | | | | * linux/configfrag.ac (AM53C974, aha1542, eata, eata_pio, ppa, wd7000, 3c515, de600, de620): Disable by default drivers for elder hardware, which have scary boot messages. * linux/pcmcia-cs/modules/ds.c (init_pcmcia_ds): Make message about socket not being found less scary.
* Fix build warningSamuel Thibault2019-11-101-0/+1
| | | | * ddb/db_command.c: Include <ipc/mach_port.h>.
* Run interrupt handlers at spl7Samuel Thibault2019-11-101-2/+1
| | | | | * i386/i386at/interrupt.S (interrupt): Call spl7 instead of the intpri-provided one.
* simplify interrupt handlingDamien Zammit2019-11-1012-133/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We have removed spl levels, now remove the machinery to manage different PIC masks according to levels. Only keep machinery to disable interrupts whatever the level. * i386/i386/pic.c (pic_mask): Remove array. (picinit): Do not form PIC mask. Set initial PIC mask to 0. (form_pic_mask): Remove function. * i386/i386/pic.h (form_pic_mask, pic_mask): Remove declarations. * i386/i386/spl.S (SETMASK): Remove macro. (XEN_SETMASK): Add macro, containing the Xen version of SETMASK. (spl0, splx_cli, spl) [MACH_XEN]: Call XEN_SETMASK instead of SETMASK. * i386/i386/pit.c (clkstart): Do not call form_pic_mask. * i386/i386at/autoconf.c (take_dev_irq, take_ctlr_irq): Likewise. * i386/i386at/kd_mouse.c (kd_mouse_open, kd_mouse_close): Likewise. * linux/dev/arch/i386/kernel/irq.c (mask_irq, unmask_irq): Directly update curr_pic_mask without using pic_mask array. (init_IRQ, restore_IRQ): do not call form_pic_mask. * linux/dev/include/asm-i386/system.h: Include <i386/ipl.h>. (__save_flags, __restore_flags): Use curr_ipl and splx instead of hardware flags. * linux/dev/init/main.c (linux_init): Do not call cli. * linux/dev/kernel/sched.c (linux_timer_intr): Do not use pic_mask. * linux/src/drivers/block/ide.c (try_to_identify): Disable irq probing. * linux/src/drivers/scsi/NCR53c406a.c (NCR53c406a_detect): Disable irq probing.
* ide: Use default IRQ by defaultSamuel Thibault2019-11-101-0/+1
| | | | | | | | To avoid even trying to probe IRQs. Nowadays' hardware use the default IRQ anyway. * linux/src/drivers/block/ide.c (init_hwif_data): Set hwif->irq to default_irqs[index].
* spl: Squash levels 1-6 into level 7Damien Zammit2019-11-101-32/+11
| | | | | | * i386/i386/spl.S (SETIPL): Remove macro. (splsoftclock, spl1, spl2, spl3, splnet, splhdw, spl4, splbio, spldcm, spl5, spltty, splimp, splvm, spl6): Move entries to the spl7 entry.
* pmap: fix format warningsSamuel Thibault2019-11-101-20/+20
| | | | | | | * i386/intel/pmap.c (pmap_bootstrap, pmap_set_page_readwrite, pmap_set_page_readonly, pmap_set_page_readonly_init, pmap_clear_bootstrap_pagetable, pmap_map_mfn, pmap_destroy, pmap_enter, pmap_collect, phys_attribute_clear): Fix format warnings.
* Xen: fix bootSamuel Thibault2019-11-101-2/+1
| | | | | | | Xen seems to want a whole page for the PAE pdp. * i386/intel/pmap.c (pmap_init): Make pdpt cache use page-size allocation.
* sched: cause ast on master processor tooSamuel Thibault2019-11-011-7/+2
| | | | | | | Nowadays' processors are way fast enough to handle everything fine. * kern/sched_prim.c (thread_setrun): Do not check against target processor being master.