summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-03-09Set readtodc parameter 64bitv1.8+git20200309Samuel Thibault
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.
2020-01-28Set time_t type to 64bitSamuel Thibault
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.
2020-01-27doc: Fix mapped-time exampleSamuel Thibault
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.
2020-01-01Cope with machine_info.memory_size overflowSamuel Thibault
* kern/startup.c (setup_main): When memory size overflows machine_info.memory_size, set to maximum size.
2019-12-01i386: use 64bit precision by defaultSamuel Thibault
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.
2019-11-12irq: Add disabling counterSamuel Thibault
* 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.
2019-11-11PIC: Acknowledge interrupts more carefullySamuel Thibault
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.
2019-11-11PIC: fix EOI valuesSamuel Thibault
* 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.
2019-11-11intnull: Only warn once.Samuel Thibault
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.
2019-11-10spl: Remove intpri arraySamuel Thibault
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.
2019-11-10Make default boot less scarySamuel Thibault
* 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.
2019-11-10Fix build warningSamuel Thibault
* ddb/db_command.c: Include <ipc/mach_port.h>.
2019-11-10Run interrupt handlers at spl7Samuel Thibault
* i386/i386at/interrupt.S (interrupt): Call spl7 instead of the intpri-provided one.
2019-11-10simplify interrupt handlingDamien Zammit
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.
2019-11-10ide: Use default IRQ by defaultSamuel Thibault
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].
2019-11-10spl: Squash levels 1-6 into level 7Damien Zammit
* 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.
2019-11-10pmap: fix format warningsSamuel Thibault
* 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.
2019-11-10Xen: fix bootSamuel Thibault
Xen seems to want a whole page for the PAE pdp. * i386/intel/pmap.c (pmap_init): Make pdpt cache use page-size allocation.
2019-11-01sched: cause ast on master processor tooSamuel Thibault
Nowadays' processors are way fast enough to handle everything fine. * kern/sched_prim.c (thread_setrun): Do not check against target processor being master.
2019-10-31pit: fix buildSamuel Thibault
* i386/i386/pit.c: Include <kern/cpu_number.h>
2019-10-31pit: avoid initializating several timesSamuel Thibault
i386/i386/pit.c (clkstart): Do not initialize PIT if cpu_number() is not 0.
2019-10-30Drop spurious changeSamuel Thibault
* version.m4: Remove spurious git tag qualifier.
2019-10-27patch: add last_processor to thread info structuresAlmudena Garcia
* include/mach/thread_info.h (thread info structures): Add new member "last_processor" in thread_sched_info. * kern/thread.c (thread management): Fill new member "last_processor" in thread_info() function.
2019-10-24Fix build with texinfo 6.7Luca Weiss
doc/mach.texi: Specify document encoding as ISO-8859-1.
2019-09-06compiler-gcc*.h: Keep on the gcc 5 version for nowSamuel Thibault
We can introduce other versions if we ever need to (which is unlikely since we plan to get rid of the Linux drivers). * compiler-gcc.h: Include compiler-gcc5.h for all compiler versions starting from gcc 5. * compiler-gcc6.h, compiler-gcc7.h, compiler-gcc8.h, compiler-gcc9.h: Remove.
2019-08-31satisfy 'werror=parantheses'.guy fleury iteriteka
* vm/vm_map.c(vm_map_msync): explit group of first condition.
2019-08-31Fix the pointer comparison of different type.guy fleury iteriteka
* vm/vm_map.c(vm_map_fork): use VM_MAP_NULL instead of PMAP_NULL when compare with new_map.
2019-08-31Add gcc-9 compatibilitySamuel Thibault
* linux/src/include/linux/compiler-gcc9.h: New file.
2019-08-30fix return KERN_INVALID_ARGUMENT when the map is NULL.guy fleury iteriteka
* vm/vm_map.c(vm_map_msync): Add missing return keyword.
2019-08-11Fix formatSamuel Thibault
* ipc/mach_port.c (mach_port_mod_refs): Fix passing string size.
2019-08-11Fix formatSamuel Thibault
* kern/task.c (task_create_kernel): Fix passing string size.
2019-08-11Fix allocation testSamuel Thibault
* vm/vm_map.c (vm_map_fork): Check for `new_map` being non-NULL, and not for `new_pmap` a second time.
2019-08-11Fix printk formatSamuel Thibault
* linux/dev/drivers/block/ahci.c (ahci_identify, ahci_probe_port): Fix format.
2019-08-11Fix printf formatSamuel Thibault
* ipc/mach_port.c (mach_port_destroy, mach_port_deallocate): Fix format.
2019-08-11Fix uninitialized valueSamuel Thibault
* kern/gsync.c (temp_mapping): Initialize start address to VM_MIN_KERNEL_ADDRESS.
2019-04-28Avoid calling biosmem with size 0Samuel Thibault
* i386/i386at/model_dep.c (register_boot_data): Register reserved biosmem areas only when they have a non-zero size.
2019-04-28Avoid calling biosmem with size 0Samuel Thibault
* i386/configfrag.ac (register_boot_data): Process modules only when their count is non-zero. (i386at_init): Likewise.
2019-04-27ahci: Ignore multifunction bit in PCI header typeSamuel Thibault
* linux/dev/drivers/block/ahci.c (ahci_probe_dev): Clear bit 7 of hdrtype.
2018-12-30Move -D__ASSEMBLY__ to general AM_CCASFLAGSSamuel Thibault
Since it is used not only by linux bits. * linux/Makefrag.am (liblinux_a_CCASFLAGS): Remove -D__ASSEMBLY__ * Makefile.am (AM_CCASFLAGS): Add -D__ASSEMBLY__
2018-12-05io_perm: Rename macro to better nameSamuel Thibault
* i386/i386/io_perm.c (IS_IN_PROTECTED_RANGE): Rename to CONTAINS_PCI_CFG.
2018-12-05Restrict access to PCI cfg io ports to one processDamien Zammit
* i386/i386/io_perm.c (PCI_CFG1_START, PCI_CFG1_END, PCI_CFG2_START, PCI_CFG2_END, IS_IN_PROTECTED_RANGE): New macros. (taken_pci_cfg): New variable. (io_perm_deallocate): New function. (i386_io_perm_create): Return KERN_PROTECTION_FAILURE if requested port range contains PCI config registers and that is already taken. Set taken_pci_cfg to true when taking them. * i386/i386/io_perm.h (io_perm_deallocate): New declaration. * i386/include/mach/i386/mach_i386.defs (io_perm_t): Add io_perm_deallocate destructor.
2018-11-26Add GPLv3 license textKalle Olavi Niemitalo
To help people satisfy the license when they convey clones of the gnumach Git repository, in which gitlog-to-changelog and some deleted files are licensed under GPLv3-or-later. A normal build does not use the GPLv3-or-later files. "make dist" runs gitlog-to-changelog but does not copy it to gnumach-*.tar. Bug: https://savannah.gnu.org/bugs/?49024
2018-11-19Fix interactivity of inactive threadsSamuel Thibault
A new thread will mosty probably start working, assume it will take its share of CPU, to avoid having to find it out slowly. Decaying will however fix that quickly if it actually does not work. This fixes stalling issues when a program keeps creating threads. * kern/thread.c (thread_create): Set new_thread's cpu_usage and sched_usage to a fair share of the current load.
2018-11-19Fix task and thread collection frequencySamuel Thibault
sched_tick is incremented only once per second, not once per tick. * kern/task.c (consider_task_collect): Divide task_collect_max_rate by (hz / 1) to get a number of scheduler ticks. * kern/thread.c (consider_thread_collect): Divide thread_collect_max_rate by (hz / 1) to get a number of scheduler ticks.
2018-11-19Drop SIMPLE_CLOCK supportSamuel Thibault
This wasn't building and is not useful with nowaday's hardware. * configfrag.ac (SIMPLE_CLOCK): Do not define. * kern/sched.h [SIMPLE_CLOCK] (sched_usec): Remove variable declaration. * kern/sched_prim.c [SIMPLE_CLOCK] (sched_usec): Remove variable. [SIMPLE_CLOCK] (sched_init): Do not initialize sched_usec variable. [SIMPLE_CLOCK] (recompute_priorities): Do not tinker sched_usec variable. * kern/thread.c [SIMPLE_CLOCK] (thread_info): Do not ajust for clock drift.
2018-11-19Make scheduling more reactiveSamuel Thibault
Give smaller quantums to processes, to get more frequent context switches. This fixes some reactivity for concurrent processes. * kern/sched.h (MIN_QUANTUM): Define to hz / 33. * kern/sched_prim.c (sched_init): Use MIN_QUANTUM instead of hz / 10.
2018-11-06build: Distribute tarball compressed with xz instead of bzip2Guillem Jover
* configure.ac (AM_INIT_AUTOMAKE): Change dist-bzip2 to dist-xz.
2018-11-04Fix using all dynamic prioritiesSamuel Thibault
6a2342010811 ("Increase number of priorities") increased NRQS but didn't increase PRI_SHIFT to extend the use of the additional queues by the scheduler. This does it. While at it, extend to NRQS to 64, the double of the original 32, to keep all values coherent. * i386/i386/sched_param.h (PRI_SHIFT): Set from 18 to 17. * kern/sched.h (PRI_SHIFT): Set from 18 to 17. (NRQS): Set to 64.
2018-11-03Add missing patch fileSamuel Thibault
* Makefile.am (EXTRA_DIST): Add Makefile.in.dep.patch.
2018-11-03Add vm_object_sync supportSamuel Thibault
* include/mach/vm_sync.h: New file. * include/mach/mach_types.h: Include <mach/vm_sync.h> * Makefrag.am (include_mach_HEADERS): Add include/mach/vm_sync.h. * include/mach/mach_types.defs (vm_sync_t): Add type. * include/mach/gnumach.defs (vm_object_sync, vm_msync): Add RPCs. * vm/vm_map.h: Include <mach/vm_sync.h>. (vm_map_msync): New declaration. * vm/vm_map.c (vm_map_msync): New function. * vm/vm_user.c: Include <mach/vm_sync.h> and <kern/mach.server.h>. (vm_object_sync, vm_msync): New functions.