aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Fix several warnings for -Wmissing-prototypesFlavio Cruz2023-01-2426-363/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * device/ds_routines.c: use static qualifier. * device/subrs.c: delete unused functions. * i386/i386/ast_check.c: include prototypes in kern/ast.h * i386/i386/db_disasm.c: Include prototypes in ddb/db_examine.h * i386/i386/db_interface.h: Define prototype for kdb_kentry. Expose debug methods feep and kd_debug_put. * i386/i386/db_trace.c: delete left over cthreads support, functions are not used. * i386/i386/model_dep.h: Define prototype for c_boot_entry. * i386/i386at/acpi_parse_apic.c: Static qualifiers. * i386/i386at/autoconf.c: Include header file for prototypes and remove dead code. * i386/i386at/autoconf.h: Fix prototype. * i386/i386at/com.c: Add static qualifiers, delete dead code. * i386/i386at/com.c: ditto. * i386/i386at/com.h: Define prototypes for debug functions. * i386/i386at/int_init.c: Include header. * i386/i386at/kd.c: Include header for debug interface. Remove dead kd_cmdreg_read and make xga_getpos static. * i386/i386at/kd_mouse.c: Static qualifiers. * i386/i386at/lpr.c: Dead lprpr. * i386/i386at/model_dep.c: Remove exit function. * kern/mach_clock.c: Include mig prototypes. * kern/mach_clock.h: Remove duplicates of mig prototypes. * kern/machine.c: Use static. * kern/startup.c: slave_main is unused. * kern/thread.h: Define thread_stats that is useful for debugging. * kern/timer.c: Keep db_thread_times since it can be used for debugging. * kern/timer.h: ditto. * linux/dev/glue/misc.c: Use mig header for host_get_time. Message-Id: <Y8oyiecaflCaYhaW@mercury.tail36e24.ts.net>
* Remove existing old style definitions and use -Wold-style-definition.Flavio Cruz2023-01-1918-81/+45
| | | | Message-Id: <Y8mYd/pt/og4Tj5I@mercury.tail36e24.ts.net>
* Include mig generated device headers to avoid missing prototypesFlavio Cruz2023-01-196-13/+15
| | | | | | Some of the existing definitions lacked the const qualifier, which was added. Message-Id: <Y8mYZEKqWN43n2SA@mercury.tail36e24.ts.net>
* Rename msg_is_misaligned and msg_alignSamuel Thibault2023-01-193-34/+34
| | | | message.h is installed so we need to hide these behind a mach_ prefix
* Add host_get_time64 RPC to return the time as time_value64_tFlavio Cruz2023-01-196-56/+118
| | | | | | Also updated the mapped time to support the new 64-bit time while keeping compatible with the user land programs currently using it so they can be migrated in parallel.
* Fix i386 PAE bootSamuel Thibault2023-01-191-3/+6
|
* Include mig generated headers to avoid warnings with -Wmissing-prototypes.Flavio Cruz2023-01-1928-427/+40
| | | | | | This also reverts 566c227636481b246d928772ebeaacbc7c37145b and 963b1794d7117064cee8ab5638b329db51dad854 Message-Id: <Y8d75KSqNL4FFInm@mercury.tail36e24.ts.net>
* replace mach_port_t with mach_port_name_tLuca Dariz2023-01-1812-55/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is a cleanup following the introduction of mach_port_name_t. The same set of changes is applied to all files: - rename mach_port_t to mach_port_name_t where a port name is used, - use MACH_PORT_NAME_NULL and MACH_PORT_NAME_DEAD where appropriate, - use invalid_port_to_name() and invalid_name_to_port() for conversion where appropriate, - use regular copyout() insted of copyout_port() when we deal with mach_port_name_t already before copyout, - use the new helper ipc_kmsg_copyout_object_to_port() when we really want to place a port name in the space of a mach_port_t. * include/mach/notify.h: Likewise * ipc/ipc_entry.c: Likewise * ipc/ipc_kmsg.c: Likewise * ipc/ipc_kmsg.h: Likewise, and add ipc_kmsg_copyout_object_to_port() * ipc/ipc_marequest.c: Likewise * ipc/ipc_object.c: Likewise * ipc/ipc_port.c: Likewise * ipc/ipc_space.h: Likewise * ipc/mach_msg.c: Likewise * ipc/mach_port.c: Likewise * kern/exception.c: Likewise * kern/ipc_mig.c: Likewise Message-Id: <20230116105857.240210-8-luca@orpolo.org>
* add conversion helpers for invalid mach port namesLuca Dariz2023-01-182-2/+26
| | | | | | | | * include/mach/port.h: add _NAME_ variants for port NULL and DEAD and add helpers to check for invalid port names * ipc/port.h: add helpers to properly convert to/from invalid mach port names. Message-Id: <20230116105857.240210-7-luca@orpolo.org>
* adjust rdxtree key to the correct sizeLuca Dariz2023-01-181-0/+3
| | | | | * Makefile.am: define RDXTREE_KEY_32 Message-Id: <20230116105857.240210-6-luca@orpolo.org>
* update writev syscall signature with rpc typesLuca Dariz2023-01-186-23/+31
| | | | | | | | | | * device/device_emul.h: write/writev: update trap argument types * device/ds_routines.c: update argument types and adjust copyin * device/ds_routines.h: write/writev: update trap argument type * include/device/device_types.h: add rpc_io_buf_vec_t type * kern/ipc_mig.c: write/writev: update trap argument type * kern/ipc_mig.h: Likewise Message-Id: <20230116105857.240210-5-luca@orpolo.org>
* update syscall signature with rpc_vm_* and mach_port_name_tLuca Dariz2023-01-183-48/+41
| | | | | | | | | * include/mach/mach_types.h: use mach port names * kern/ipc_mig.c: update vm types and use copyin/copyout helpers * kern/ipc_mig.h: Likewise Signed-off-by: Luca Dariz <luca@orpolo.org> Message-Id: <20230116105857.240210-4-luca@orpolo.org>
* x86_64: expand and shrink messages in copy{in, out}msg routinesLuca Dariz2023-01-188-107/+522
| | | | | | | | | | | | | | | | | | | * i386/i386/copy_user.h: new file to handle 32/64 bit differences - add msg_usize() to recontruct the user-space message size - add copyin/copyout helpers for addresses and ports * include/mach/message.h: add msg alignment macros * ipc/ipc_kmsg.c: - copyin/out ports names instead of using pointer magic * ipc/ipc_mqueue.c: use msg_usize() to check if we can actually receive the message * ipc/mach_msg.c: Likewise for continuations in receive path * x86_64/Makefrag.am: add x86_64/copy_user.c * x86_64/copy_user.c: new file to handle message expansion and shrinking during copyinmsg/copyoutmsg for 64 bit kernels. - port names -> port pointers on all 64-bit builds - 32-bit pointer -> 64 bit pointer when using 32-bit userspace * x86_64/locore.S: remove copyinmsg() and copyoutmsg() Message-Id: <20230116105857.240210-3-luca@orpolo.org>
* add msg_user_header_t for user-side msg structureLuca Dariz2023-01-186-14/+29
| | | | | | | | | | | * include/mach/message.h: use mach_msg_user_header_t only in KERNEL, and define it as mach_msh_header_t for user space * ipc/ipc_kmsg.c: use mach_msg_user_header_t where appropriate * ipc/ipc_kmsg.h: Likewise * ipc/mach_msg.c: Likewise * ipc/mach_msg.h: Likewise * kern/thread.h: Likewise Message-Id: <20230116105857.240210-2-luca@orpolo.org>
* Add static qualifiersFlavio Cruz2023-01-183-3/+3
| | | | | stack_statistics, swapin_thread_continue, and memory_object_lock_page are not used outside their module.
* Delete x86 string functionsFlavio Cruz2023-01-181-54/+0
| | | | | | The i386 functions are not used and the more portable versions in kern/strings.c are faster (1-4x faster in synthetic benchmarks compiled with -O2 on my x86_64 box). Message-Id: <Y8Yt9FvIagB78uyR@jupiter.tail36e24.ts.net>
* Delete util/putchar.{c,h} and util/puts.cFlavio Cruz2023-01-184-107/+0
| | | | | Those functions are unused. Message-Id: <Y8YtmejHMnhI9CLG@jupiter.tail36e24.ts.net>
* fix warningsLuca Dariz2023-01-163-4/+3
| | | | | | | * ipc/ipc_kmsg.c: drop useless cast. * ipc/ipc_port.c: upcast rpc_vm_offset_t to full vm_offset_t * kern/pc_sample.c: Likewise Message-Id: <20230116130426.246584-4-luca@orpolo.org>
* remove unused file ipc/mach_rpc.cLuca Dariz2023-01-162-151/+0
| | | | | | * Makefrag.am: remove ipc/mach_rpc.c * ipc/mach_rpc.c: remove file, all functions here seem unused. Message-Id: <20230116130426.246584-3-luca@orpolo.org>
* add required includeLuca Dariz2023-01-161-0/+2
| | | | | | | * kern/syscall_sw.h: add missing include Signed-off-by: Luca Dariz <luca@orpolo.org> Message-Id: <20230116130426.246584-2-luca@orpolo.org>
* add missing argument namesLuca Dariz2023-01-166-35/+35
| | | | | | | | | | | | | | | * ddb/db_break.c: add argument name, compilation fails on Debian/Linux stable with gcc 10.2 otherwise. For some reason on Debian/Hurd a simple test program without argname succeeds, unless I force -std=c11 or similar; I suppose because newer gcc have different defaults. Gnumach seem to still require c89 for some older code, otherwise we could explicitely use gnu99/c99 or gnu11/c11. * ddb/db_cond.c: Likewise * ddb/db_examine.c: Likewise * ddb/db_macro.c: Likewise * ddb/db_watch.c: Likewise * device/dev_name.c: Likewise Message-Id: <20230116130426.246584-1-luca@orpolo.org>
* Delete ffs and strrchr prototypes.Flavio Cruz2023-01-152-25/+0
| | | | | | | | We use __builtin_ffs instead of ffs. strrchr is not used. Also removed the commented out memset implementation since it is implemented in arch-specific code. Message-Id: <Y8NOXbVzhBJknR29@mercury.tail36e24.ts.net>
* Fix build for smpEtienne Brateau2023-01-131-1/+1
| | | | | | ad51c68171cb6a1cae15c61ca0218bbee2c05485 missed one replacement which was not discovered because it’s only when building with smp enabled. Message-Id: <20230113144732.49786-1-etienne.brateau@gmail.com>
* Create kern/mach4.h and kern/mach_host.h and define the RPC prototypes for ↵Flavio Cruz2023-01-1313-0/+246
| | | | | | | mach4.defs and mach_host.defs. Also move more mach_debug rpcs to kern/mach_debug.h. Message-Id: <Y7+LPMLOafUQrNHZ@jupiter.tail36e24.ts.net>
* Use rpc_uintptr_t for protected payloads.Flavio Cruz2023-01-1310-14/+18
| | | | | | | Not only is uintptr_t more accurate for what protected payloads are but we also provide compatibility for 64 + 32 bits. Also the use of natural_t in the RPC definition is wrong since it is always 32 bits. Message-Id: <Y7+LHVbmYxO/cSKs@jupiter.tail36e24.ts.net>
* Preemptively fix warnings that will be caused by -Wmissing-prototypesFlavio Cruz2023-01-105-4/+142
| | | | | | | Declared RPCs in ipc/mach_port.c and ddb/db_ext_symtab.c in their corresponding headers. Ideally these should be used by mig instead of mig declaring its own prototypes. Message-Id: <Y7z/BQhmsBbRgxhe@jupiter.tail36e24.ts.net>
* Update configure.ac so that we don't need glibc when running ./configure.Flavio Cruz2023-01-102-2/+10
| | | | | | | For x86_64-pc-gnu we still do not have a working glibc so ./configure will fail under a freestanding environment. We force ./configure to avoid running compiled C programs as a test which it is not needed when compiling a kernel. Message-Id: <Y7zYm44O0CNayuAe@jupiter.tail36e24.ts.net>
* Remove unused db_set_variableFlavio Cruz2023-01-091-16/+0
| | | | Message-Id: <Y7umiZGUjD3E+Duq@jupiter.tail36e24.ts.net>
* Remove unused db_lookup_portFlavio Cruz2023-01-091-17/+0
| | | | Message-Id: <Y7ulwrbHJZqKoBPn@jupiter.tail36e24.ts.net>
* Export input structures used by Hurd in device/input.h.Flavio Cruz2023-01-094-111/+108
| | | | | | Also delete sys/ioctl.h and merge it with device/input.h since it is only needed here. Message-Id: <Y7uirJzaJeOBzAmq@jupiter.tail36e24.ts.net>
* Set max-page-size when linking the kernel to 0x1000.Flavio Cruz2023-01-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the exception of linux, x86_64 ld default's max-page-size is 2MB (default for i386 is 4K) and compiling gnumach with x86_64-pc-gnu-ld will generate a kernel image where the boot section starts at the file offset 2MB. This makes it unbootable on grub because the file is no longer multiboot. Here's the objdump -h output before the patch: Sections: Idx Name Size VMA LMA File off Algn 0 .boot 0000c000 0000000001000000 0000000001000000 00200000 2**12 CONTENTS, ALLOC, LOAD, READONLY, CODE 1 .text 0009078f 000000004100c000 000000000100c000 0020c000 2**2 CONTENTS, ALLOC, LOAD, READONLY, CODE 2 .rodata 000110fc 000000004109c7a0 000000000109c7a0 0029c7a0 2**5 CONTENTS, ALLOC, LOAD, READONLY, DATA 3 .eh_frame 000101f0 00000000410ad8a0 00000000010ad8a0 002ad8a0 2**3 CONTENTS, ALLOC, LOAD, READONLY, DATA 4 .data 000070a0 00000000412bdaa0 00000000012bdaa0 002bdaa0 2**5 CONTENTS, ALLOC, LOAD, DATA 5 .bss 00023f10 00000000412c5000 00000000012c5000 002c4b40 2**12 ALLOC 6 .comment 00000012 0000000000000000 0000000000000000 002c4b40 2**0 CONTENTS, READONLY After, when forcing ld's max-page-size to be 4K: Sections: Idx Name Size VMA LMA File off Algn 0 .boot 0000c000 0000000001000000 0000000001000000 00001000 2**12 CONTENTS, ALLOC, LOAD, READONLY, CODE 1 .text 0009078f 000000004100c000 000000000100c000 0000d000 2**2 CONTENTS, ALLOC, LOAD, READONLY, CODE 2 .rodata 000110fc 000000004109c7a0 000000000109c7a0 0009d7a0 2**5 CONTENTS, ALLOC, LOAD, READONLY, DATA 3 .eh_frame 000101f0 00000000410ad8a0 00000000010ad8a0 000ae8a0 2**3 CONTENTS, ALLOC, LOAD, READONLY, DATA 4 .data 000070a0 00000000410beaa0 00000000010beaa0 000beaa0 2**5 CONTENTS, ALLOC, LOAD, DATA 5 .bss 00023f10 00000000410c6000 00000000010c6000 000c5b40 2**12 ALLOC 6 .comment 00000012 0000000000000000 0000000000000000 000c5b40 2**0 CONTENTS, READONLY It is also possible that something is wrong with the linker script but couldn't find anything concrete so far. After this patch the kernel is bootable with x86_64-pc-gnu-ld (and far smaller in size). Message-Id: <Y7uJYpIsovhShREj@jupiter.tail36e24.ts.net>
* Fix warning at pic_isa.cFlavio Cruz2023-01-071-2/+2
| | | | Message-Id: <Y7exFz3ZkK6hLVdi@jupiter.tail36e24.ts.net>
* Use grub-file instead of mbchk to test multiboot headerFlavio Cruz2023-01-073-6/+6
| | | | | mbchk is not part of grub2 and only available on grub-legacy. Message-Id: <Y7ewlry3pRHRAR/9@jupiter.tail36e24.ts.net>
* Move cpu_down and other functions inside SMP ifdefFlavio Cruz2023-01-072-60/+60
| | | | | | | cpu_down is shown as not required when disabling SMP so moving it inside NCPUS > 1 to eliminate the warning. Note that the diff ended up looking a bit different due the way functions are laid out. Message-Id: <Y7ZH6aI3fhWNzyrY@jupiter.tail36e24.ts.net>
* Fix ddb warnings introduced with -Wstrict-prototypesFlavio Cruz2023-01-0519-57/+124
| | | | | | | Changed some ddb command functions to have the expected signature but not all of them due to the being difficult to inter-dependency between header files (for those just used cast). Message-Id: <Y7UO9HTfpZ8U0Nfy@mars>
* Introduce time_value64_t to keep track of real time in the kernelFlavio Cruz2023-01-0314-87/+64
| | | | | | | | | | | | time_value64_t uses int64_t to track seconds and nanoseconds and hence is Y2038 proof. It does not have nano second resolution but it could be provided in the future. Removed include/sys/time.h as it remaps time_value_t into timeval which can create confusion. The timestamp from keyboard and mouse events is no longer set and replaced with rpc_time_value for better compatibility.
* fix warning from -Wstrict-prototypesGuy-Fleury Iteriteka2023-01-012-2/+2
| | | | Message-Id: <Y7GEhcafJ+4Wn3ao@falom>
* convert K&R into ansiGuy-Fleury Iteriteka2023-01-0113-226/+191
| | | | Message-Id: <Y7GBQ5bk6ZQqtfda@falom>
* convert K&R into ansi.Guy-Fleury Iteriteka2023-01-011-13/+7
| | | | Message-Id: <Y7GBIF6mBjV6kBM+@falom>
* 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.