aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Fix inttypes.h format constants for uintptr_t and intptr_t.Flavio Cruz2022-12-272-11/+14
| | | | | | | | The format constants are not correct for 32 bits and there was duplication for PRIx* constants (replaced with octal constants). Fixed a few format warnings too. Message-Id: <Y6o5KsvtPavCYe8f@mars>
* Delete kern_timestamp system call since it is not usedFlavio Cruz2022-12-277-143/+0
| | | | Message-Id: <Y6r72z4cKVCMDSKy@mars>
* Use uintptr_t to define vm_size_t/vm_offset_t/vm_addressFlavio Cruz2022-12-271-5/+1
| | | | Message-Id: <Y6j9bnHphZp0ZPYC@mars>
* Fix some warnings with -Wmissing-prototypes.Flavio Cruz2022-12-2759-304/+154
| | | | | | | | | | | Marked some functions as static (private) as needed and added missing includes. This also revealed some dead code which was removed. Note that -Wmissing-prototypes is not enabled here since there is a bunch more warnings. Message-Id: <Y6j72lWRL9rsYy4j@mars>
* Fix hardclock prototypeSamuel Thibault2022-12-271-1/+0
|
* intr: Drop irq parameterSamuel Thibault2022-12-244-21/+13
| | | | This is not actually used.
* Xen: Fix ivect prototypeSamuel Thibault2022-12-241-2/+2
| | | | | 448889a4f0c3 ("Use -Wstrict-prototypes and fix warnings") simplified the prototype of ivect, so we have to update the Xen version.
* Add missing htonsSamuel Thibault2022-12-243-0/+10
|
* Xen: Fix warningSamuel Thibault2022-12-241-1/+1
|
* ld_magic_routines: Restore yet more symbolSamuel Thibault2022-12-241-1/+1
| | | | | | 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.
* ld_magic_routines: Restore more more symbolsSamuel Thibault2022-12-241-1/+1
| | | | | | 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.
* Drop spurious changesSamuel Thibault2022-12-223-9/+3
|
* Warn only once about not being able to recycle pagesSamuel Thibault2022-12-224-4/+18
|
* Use -Wstrict-prototypes and fix warningsFlavio Cruz2022-12-2136-195/+144
| | | | | | | 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>
* x86_64: stdint.h no longer exists so don't install itFlavio Cruz2022-12-191-1/+0
| | | | Message-Id: <Y6Bw/vU85SK5GrMZ@mars>
* time_value: Fix usage in e.g. c89 programsSamuel Thibault2022-12-191-2/+2
| | | | | | The inline keyword was not defined there, so we need to use __inline__. This fixes make check in glibc.
* Remove custom stdint.h and rely on freestanding headersFlavio Cruz2022-12-198-148/+22
| | | | | GCC already provides this so we don't need to have our own. Message-Id: <Y5+02FVA6jf4GPgA@mars>
* Use long_natural_t for recnum_tFlavio Cruz2022-12-185-24/+65
| | | | | | | | | | | | 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>
* libgcc_routines: Restore some symbolsSamuel Thibault2022-12-181-1/+1
| | | | | | 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.
* vm_page_evict: avoid crashingSamuel Thibault2022-12-181-1/+1
| | | | | | 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.
* Use struct for time_value_t and define seconds as long_integer_t.Flavio Cruz2022-12-174-4/+60
| | | | | | | 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>
* Fix compiler warnings due to use of inline for mask_irq/unmask_irqFlavio Cruz2022-12-174-18/+16
| | | | Message-Id: <Y5z01C/L+pnSVNIP@mars>
* Implement our own functions to convert between host and network valuesFlavio Cruz2022-12-174-13/+87
| | | | | | | | 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>
* Use __builtin_ffs instead of libc provided ffs in vm_map.cFlavio Cruz2022-12-152-4/+4
| | | | | | 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>
* copy_to/from_phys: fix non-page-aligned caseSamuel Thibault2022-12-121-2/+2
| | | | | | | | 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.
* db: Add support for CSI-based arrowsSamuel Thibault2022-12-111-0/+40
|
* i386 db: Fix db_read_bytes over multiple pagesSamuel Thibault2022-12-111-0/+1
| | | | The target pointer was not getting advanced between page chunks.
* i386 db: Add ud2 instructionSamuel Thibault2022-12-111-1/+1
|
* Delete rpc copyout multiname codeFlavio Cruz2022-12-112-91/+0
| | | | Message-Id: <Y5V+BovjWo1CCjBc@jupiter.tail36e24.ts.net>
* Delete thread_get_state_KERNEL and thread_set_state_KERNELFlavio Cruz2022-12-111-41/+0
| | | | | | These are not used. Message-Id: <Y5V95ibk9Z+3OJxN@jupiter.tail36e24.ts.net>
* Use mach_port_name in db_lookup_portFlavio Cruz2022-12-071-1/+1
| | | | Message-Id: <Y5AdTQfSxStjbhsj@reue>
* Update kern/ directory to use mach_port_name_t.Flavio Cruz2022-12-078-17/+17
| | | | | Make it clear where exactly we use port names vs port addresses. Message-Id: <Y5AdJGuzXBMO7YRK@reue>
* Use long_natural_t in kern/task.h and kern/slab.hFlavio Cruz2022-12-072-12/+12
| | | | | | RPC interfaces already use long_natural_t so internally we can also use this type. Message-Id: <Y5AdPNqg4l5jAZ3n@reue>
* Define vm_size_t and vm_offset_t as __mach_uintptr_t.Flavio Cruz2022-12-0611-20/+20
| | | | | | | | | | 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>
* Make task_info.h structs more portableFlavio Cruz2022-12-066-60/+63
| | | | | | | | | | 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>
* task: Add task_set_essentialSamuel Thibault2022-12-035-3/+40
| | | | | | | | 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.
* Use mach_port_name_t in a few more placesFlavio Cruz2022-12-034-10/+9
| | | | | A few places that I missed in 958686efa2175abe3f7044890c2c2370e29147f2. Message-Id: <Y4g+4THLC/1NvnkM@viriathus>
* Update ipc/ directory to use mach_port_name_tFlavio Cruz2022-11-3036-324/+339
| | | | | | | | | | | | | | | 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>
* Add missing gitignore rulesSamuel Thibault2022-11-292-0/+4
|
* Use portable rpc types to define 'struct sample'.Flavio Cruz2022-11-283-7/+13
| | | | Message-Id: <Y4QQFkTUR4M60Gx0@viriathus>
* Update mach_port_status_t definition to use the new structFlavio Cruz2022-11-282-8/+18
| | | | | Also update C definition to use proper types. Message-Id: <Y4QKgh0zHdB8pWhD@viriathus>
* Delete mach_debug/pc_info.hFlavio Cruz2022-11-282-44/+0
| | | | | mach/pc_sample.h has the definitions that the kernel actually uses. Message-Id: <Y4QKGtUdbz+AVO3l@viriathus>
* x86_64: fix buildSamuel Thibault2022-11-271-1/+1
|
* Revert "x86_64: fix installing x86_64-specific headers"Samuel Thibault2022-11-271-17/+17
| | | | | | | | 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.
* vm_wire_all: Fix vm_map_protect caseSamuel Thibault2022-11-271-1/+2
| | | | | | | | | | | 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.
* Update kdb_kintr according to new interrupt stack layoutSamuel Thibault2022-11-274-6/+20
| | | | | | | | 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.
* Update mach_debug interfaces to use struct.Flavio Cruz2022-11-257-36/+109
| | | | | | | | | | | | | | | | | | | | | | 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>
* Delete ipc_info.h since it is not usedFlavio Cruz2022-11-254-80/+0
| | | | Message-Id: <Y35PHuUNCFb6sQO0@viriathus>
* x86_64: Add missing int_entry_table entries for APICSamuel Thibault2022-11-151-0/+15
| | | | | 214866d58ac2 ("Add ioapic support disabled by default") missed adding them for x86_64.
* default_pager_types.defs: define existing struct types as true structsFlavio Cruz2022-11-111-4/+13
| | | | Message-Id: <Y23fab31RM6HcCyb@viriathus>