summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-12-24Add missing htonsSamuel Thibault
2022-12-24Xen: Fix warningSamuel Thibault
2022-12-24ld_magic_routines: Restore yet more symbolSamuel Thibault
cef6d34aa026 ("Implement our own functions to convert between host and network values") dropped the glibc pieces from clib_routines, but dropped too many ld symbols.
2022-12-24ld_magic_routines: Restore more more symbolsSamuel Thibault
cef6d34aa026 ("Implement our own functions to convert between host and network values") dropped the glibc pieces from clib_routines, but dropped too many ld symbols.
2022-12-22Drop spurious changesv1.8+git20221224Samuel Thibault
2022-12-22Warn only once about not being able to recycle pagesSamuel Thibault
2022-12-21Use -Wstrict-prototypes and fix warningsFlavio Cruz
Most of the changes include defining and using proper function type declarations (with argument types declared) and avoiding using the K&R style of function declarations. Message-Id: <Y6Jazsuis1QA0lXI@mars>
2022-12-19x86_64: stdint.h no longer exists so don't install itFlavio Cruz
Message-Id: <Y6Bw/vU85SK5GrMZ@mars>
2022-12-19time_value: Fix usage in e.g. c89 programsSamuel Thibault
The inline keyword was not defined there, so we need to use __inline__. This fixes make check in glibc.
2022-12-19Remove custom stdint.h and rely on freestanding headersFlavio Cruz
GCC already provides this so we don't need to have our own. Message-Id: <Y5+02FVA6jf4GPgA@mars>
2022-12-18Use long_natural_t for recnum_tFlavio Cruz
For 64 bits, device operations will provide an addressing space of 64 bits. Also define the translation functions if long_natural_t or long_integer_t are ever used in RPCs. Note that MIG does not implicitly inherit the translation functions from types hence the need to redefine them for recnum_t. Message-Id: <Y59MFzekEA0YUXIw@mars>
2022-12-18libgcc_routines: Restore some symbolsSamuel Thibault
cef6d34aa026 ("Implement our own functions to convert between host and network values") dropped the glibc pieces from clib_routines, but missed moving all its gcc symbols into libgcc_routines.
2022-12-18vm_page_evict: avoid crashingSamuel Thibault
It seems we hit he "unable to recycle any page" even when there is no memory pressure, probably just because the pageout thread somehow to kicked but there's nothing to page out left.
2022-12-17Use struct for time_value_t and define seconds as long_integer_t.Flavio Cruz
On 64 bit kernels, seconds will be 64 bits long and won't suffer from the 2038 problem. We also add a new type rpc_time_value_t to handle the conversion between 32 bit userland and 64 bit kernel. Message-Id: <Y50kIaIgaIdGjDAk@mars>
2022-12-17Fix compiler warnings due to use of inline for mask_irq/unmask_irqFlavio Cruz
Message-Id: <Y5z01C/L+pnSVNIP@mars>
2022-12-17Implement our own functions to convert between host and network valuesFlavio Cruz
We add htonl, ntohl and ntohs which were the last symbols we relied on from libc. The Makefile.am file was updated to reflect the fact that we only require libgcc. Message-Id: <Y5zNdOJ/YnyYCOhX@mars>
2022-12-15Use __builtin_ffs instead of libc provided ffs in vm_map.cFlavio Cruz
We already use this built-in in other places and this will move us closer to being able to build the kernel without libc. Message-Id: <Y5l80/VUFvJYZTjy@jupiter.tail36e24.ts.net>
2022-12-12copy_to/from_phys: fix non-page-aligned caseSamuel Thibault
The vaddr field of the returned map only points to the base address, we have to add the offset within the page before reading/writing. This fixes accessing tasks different from the current task, and the user part of ddb backtraces.
2022-12-11db: Add support for CSI-based arrowsSamuel Thibault
2022-12-11i386 db: Fix db_read_bytes over multiple pagesSamuel Thibault
The target pointer was not getting advanced between page chunks.
2022-12-11i386 db: Add ud2 instructionSamuel Thibault
2022-12-11Delete rpc copyout multiname codeFlavio Cruz
Message-Id: <Y5V+BovjWo1CCjBc@jupiter.tail36e24.ts.net>
2022-12-11Delete thread_get_state_KERNEL and thread_set_state_KERNELFlavio Cruz
These are not used. Message-Id: <Y5V95ibk9Z+3OJxN@jupiter.tail36e24.ts.net>
2022-12-07Use mach_port_name in db_lookup_portFlavio Cruz
Message-Id: <Y5AdTQfSxStjbhsj@reue>
2022-12-07Update kern/ directory to use mach_port_name_t.Flavio Cruz
Make it clear where exactly we use port names vs port addresses. Message-Id: <Y5AdJGuzXBMO7YRK@reue>
2022-12-07Use long_natural_t in kern/task.h and kern/slab.hFlavio Cruz
RPC interfaces already use long_natural_t so internally we can also use this type. Message-Id: <Y5AdPNqg4l5jAZ3n@reue>
2022-12-06Define vm_size_t and vm_offset_t as __mach_uintptr_t.Flavio Cruz
This allows *printf to use %zd/%zu/%zx to print vm_size_t and vm_offset_t. Warnings using the incorrect specifiers were fixed. Note that MACH_PORT_NULL became just 0 because GCC thinks that we were comparing a pointer to a character (due to it being an unsigned int) so I removed the explicit cast. Message-Id: <Y47UNdcUF35Ag4Vw@reue>
2022-12-06Make task_info.h structs more portableFlavio Cruz
Changed vm_size_t to rpc_size_t so that both userland and kernel agree on the same size. Also changed the denominator for the maximum struct sizes to be integer_t to match the other declarations. Introduced long_natural_t and rpc_long_natural_t to represent large counters. Replaced rpc_unsigned_long with rpc_long_natural_t. Message-Id: <Y47UhaOzKnqhgYq4@reue>
2022-12-03task: Add task_set_essentialSamuel Thibault
Whenever a Hurd essential task crashes, startup just reboots the system since there's not much that can be done at that point. When we have a kernel debugger, however, we could at least get crashing information, so let's let Hurd's startup tell the kernel which tasks are essential, and trigger the debugger whenever they crash.
2022-12-03Use mach_port_name_t in a few more placesFlavio Cruz
A few places that I missed in 958686efa2175abe3f7044890c2c2370e29147f2. Message-Id: <Y4g+4THLC/1NvnkM@viriathus>
2022-11-30Update ipc/ directory to use mach_port_name_tFlavio Cruz
Make it explicit where we use port names versus actual ports. For the 64 bit kernel, port names and ports are of different size so this corrects the syscall arguments and internal structs to have the right size. This patch also uncovered several issues we need to solve to make GNUMach work well on 64 bits. First, the mach_msg call will receive 4 byte port names while the kernel "thinks" they are 8 bytes, which will be a problem. Also, when we send a message, the kernel translates the port names into port pointers in the message copied from user space. This also won't work on 64 bits. In this patch, I added several TODOs to fix the issues later. Message-Id: <Y4cCzNmc6vC4bjsX@viriathus>
2022-11-29Add missing gitignore rulesSamuel Thibault
2022-11-28Use portable rpc types to define 'struct sample'.Flavio Cruz
Message-Id: <Y4QQFkTUR4M60Gx0@viriathus>
2022-11-28Update mach_port_status_t definition to use the new structFlavio Cruz
Also update C definition to use proper types. Message-Id: <Y4QKgh0zHdB8pWhD@viriathus>
2022-11-28Delete mach_debug/pc_info.hFlavio Cruz
mach/pc_sample.h has the definitions that the kernel actually uses. Message-Id: <Y4QKGtUdbz+AVO3l@viriathus>
2022-11-27x86_64: fix buildSamuel Thibault
2022-11-27Revert "x86_64: fix installing x86_64-specific headers"v1.8+git20221127Samuel Thibault
This reverts commit 8c58257c4da364ffcb797f9d454c37de939a052b. These headers are actually coming from i386. This change was making `make dist` try to build the x86_64/include/mach/x86_64 directory in the dist tarball.
2022-11-27vm_wire_all: Fix vm_map_protect caseSamuel Thibault
If a "wire_required" process calls vm_map_protect(0), the memory gets unwired as expected. But if the process then calls vm_map_protect(VM_PROT_READ) again, we need to wire that memory. (This happens to be exactly what glibc does for its heap) This fixes Hurd hangs on lack of memory, during which mach was swapping pieces of mach-defpager out.
2022-11-27Update kdb_kintr according to new interrupt stack layoutSamuel Thibault
e2fcf261076b ("interrupt: Fix saving irq/ipl when linux drivers are disabled") changed the stack layout for interrupt handlers, but missed updating kdb_kintr's code that tries to mangle it. This restores the control-alt-d shortcut.
2022-11-25Update mach_debug interfaces to use struct.Flavio Cruz
The new interfaces will be compatible both with a 64 bits kernel and userland and 64 bits kernel and 32 bit userland. Also removed many of the uses of natural_t where an unsigned int suffices. Ideally we should replace natural_t with something more portable such as uintptr_t or a basic int type for counters since for the most part we don't need counters to have the same width as the pointer type. * i386/include/mach/i386/vm_types.h: Define rpc_unsigned_long. * include/mach/mach_types.defs: Define type rpc_vm_offset_t. * include/mach_debug/hash_info.h: Use unsigned int instead of natural_t. * include/mach_debug/mach_debug_types.defs: Update cache_info_t, hash_info_bucket_t, vm_region_info_t, vm_object_info_t and vm_page_info_t to use struct. * include/mach_debug/slab_info.h: Use rpc_vm_size_t and rpc_unsigned_long for compatibility with 32 bits userland. * include/mach_debug/vm_info.h: Update struct fields to use the correct types and avoid natural_t whenever we just want to keep a count of something. Message-Id: <Y32lp1SuV01ImCx9@viriathus>
2022-11-25Delete ipc_info.h since it is not usedFlavio Cruz
Message-Id: <Y35PHuUNCFb6sQO0@viriathus>
2022-11-15x86_64: Add missing int_entry_table entries for APICSamuel Thibault
214866d58ac2 ("Add ioapic support disabled by default") missed adding them for x86_64.
2022-11-11default_pager_types.defs: define existing struct types as true structsFlavio Cruz
Message-Id: <Y23fab31RM6HcCyb@viriathus>
2022-11-10interrupt: Fix passing parameter to splx_cli and ioapic_irq_eoiSamuel Thibault
e2fcf261076b (""interrupt: Fix saving irq/ipl when linux drivers are disabled") broke booting under some conditions, because the parameters were erroneously written 4 bytes too far for splx_cli and ioapic_irq_eoi to read them.
2022-11-06doc: Add hints on using convenience variables in show commandsSamuel Thibault
2022-11-06Remove unused mig type definitions in gnumachFlavio Cruz
* include/mach/mach_types.defs: host_basic_info_data_t, host_sched_info_data_t, host_load_info_data_t, processor_basic_info_data_t, processor_set_basic_info_data_t, processor_set_sched_info_data_t, hread_basic_info_data_t, thread_sched_info_data_t, task_basic_info_data_t, task_events_info, task_thread_times_info_data_t, machine_info_data_t, machine_slot_data_t * include/mach_debug/mach_debug_types.defs: ipc_info_name_t, ipc_info_name_array_t Tested by bootstrapping a Hurd system from scratch. Message-Id: <Y2dD7Z60Bwybg4jF@viriathus>
2022-10-26i386/pit: Tune delaysDamien Zammit
- Add half a clock tick for more accuracy - Start the pit countdown during pit_sleep - Add pit_mdelay and pit_udelay functions Message-Id: <20221025105502.222708-8-damien@zamaudio.com>
2022-10-26linux drivers: Don't depend on curr_pic_mask for APICDamien Zammit
Message-Id: <20221025105502.222708-7-damien@zamaudio.com>
2022-10-25acpi: Add lapic_addrDamien Zammit
Message-Id: <20221025105502.222708-5-damien@zamaudio.com> Co-authored-by: Almudena Garcia <liberamenso10000@gmail.com>
2022-10-25bios32: Use phystokv() on low bios addressesDamien Zammit
Message-Id: <20221025105502.222708-4-damien@zamaudio.com>