[PATCH] Remove entry to fix NO_ATIME.

2021-02-04 Thread Flavio Cruz
It seems to work well now (in particular when not using relatime). borgbackup tests are also passing: https://buildd.debian.org/status/fetch.php?pkg=borgbackup&arch=hurd-i386&ver=1.1.15-3&stamp=1611220856&raw=0 --- contributing.mdwn | 1 - 1 file changed, 1 deletion(-) diff --git a/contributing.m

[PATCH] Pass mach_task_self when deallocating INIT_PORT_CWDIR

2022-01-17 Thread Flavio Cruz
--- utils/login.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/login.c b/utils/login.c index 553629c6..506fdaf2 100644 --- a/utils/login.c +++ b/utils/login.c @@ -788,7 +788,7 @@ main(int argc, char *argv[]) } else { - mach_port_deallocat

[PATCH] Add _Static_assert when compiling server and user stubs.

2022-01-19 Thread Flavio Cruz
This is only done when data is inlined with a concrete size. It ensures the C and Mig types have the same size in the target arch. Tested by building the hurd package. No assertions were triggered. --- server.c | 4 ++-- tests/good/case.defs | 6 -- tests/includes/types.h |

[PATCH] Add struct ip_mreqn in the glue headers

2022-09-07 Thread Flavio Cruz
ude/linux/igmp.h:88:19: error: field 'multi' has incomplete type 88 | struct ip_mreqn multi; | ^ : recipe for target 'devinet.o' failed This adds the definition to the glue header file. Signed-off-by: Flavio Cruz --- pfinet/glue-include/linux/in.

[PATCH] Add support to define structures in mig.

2022-11-02 Thread Flavio Cruz
Basic syntax is presented below and allows users to define nested structured types by using simpler or structure types as members. Mig will use the C padding and alignment rules to produce the same size as the corresponding C structures. type timespec_t = struct { uint32_t tv_sec; uint32_t tv_

Re: [PATCH] Add support to define structures in mig.

2022-11-03 Thread Flavio Cruz
Basic syntax is presented below and allows users to define nested structured types by using simpler or structure types as members. Mig will use the C padding and alignment rules to produce the same size as the corresponding C structures. type timespec_t = struct { uint32_t tv_sec; uint32_t tv_

[PATCH] Remove unused mig type definitions in gnumach

2022-11-05 Thread Flavio 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_eve

[PATCH] Replace vsprintf with vsnprintf in ext2fs/msg.c

2022-11-05 Thread Flavio Cruz
--- ext2fs/msg.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ext2fs/msg.c b/ext2fs/msg.c index 83939b06..af636b7c 100644 --- a/ext2fs/msg.c +++ b/ext2fs/msg.c @@ -38,7 +38,8 @@ int printf (const char *fmt, ...) return done; } -static char error_buf[1024]; +#

Re: [PATCH] Replace vsprintf with vsnprintf in ext2fs/msg.c

2022-11-08 Thread Flavio Cruz
--- Hi On Sun, Nov 06, 2022 at 11:45:19AM +0100, Samuel Thibault wrote: > Hello, > > Flavio Cruz, le dim. 06 nov. 2022 01:23:00 -0400, a ecrit: > > --- > > ext2fs/msg.c | 9 + > > 1 file changed, 5 insertions(+), 4 deletions(-) > > > > d

[PATCH] Define mig type flock_t as a struct instead of array of ints

2022-11-10 Thread Flavio Cruz
--- hurd/hurd_types.defs | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hurd/hurd_types.defs b/hurd/hurd_types.defs index 5b9dd85a..95399289 100644 --- a/hurd/hurd_types.defs +++ b/hurd/hurd_types.defs @@ -425,7 +425,13 @@ type idarray_t = array[] of uid_t; type rusa

[PATCH] default_pager_types.defs: define existing struct types as true structs

2022-11-10 Thread Flavio Cruz
--- include/mach/default_pager_types.defs | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/include/mach/default_pager_types.defs b/include/mach/default_pager_types.defs index bee7c259..398c62cd 100644 --- a/include/mach/default_pager_types.defs +++ b/include/

[PATCH] hurd_types.defs: redefine io_statbuf_t, timespec_t and fsys_statfsbuf_t as true structs

2022-11-11 Thread Flavio Cruz
time_t and long are defined as uint32_t or uint64_t depending on the arch. --- hurd/hurd_types.defs | 91 +--- 1 file changed, 86 insertions(+), 5 deletions(-) diff --git a/hurd/hurd_types.defs b/hurd/hurd_types.defs index 95399289..84e1c0ff 100644 --- a/hu

Re: [PATCH] hurd_types.defs: redefine io_statbuf_t, timespec_t and fsys_statfsbuf_t as true structs

2022-11-12 Thread Flavio Cruz
--- Hello Samuel Thanks for your comments. I have reworked the patch to use correct unsigned vs signed types to be as accurate as possible (was trying to make the size be correct only initially). I am now defining new types that are based on what glibc provides to make it easier to validate. >

[PATCH] hurd: ensure subsystem directive appears before anything else in *.defs

2022-11-12 Thread Flavio Cruz
mig is incorrectly initializing basic types twice (init_type) for kernel user and kernel server definitions. To fix this bug, we should initialize the types during a subsystem directive only. This commit ensures all hurd definitions have subsystem at the very start so that these definitions work

[PATCH] Add ioctl_types.defs to avoid duplication of type definitions.

2022-11-12 Thread Flavio Cruz
Also change type srtentry_t to use the new struct format. --- hurd/iioctl.defs | 10 +- hurd/ioctl_types.defs | 40 hurd/rioctl.defs | 10 +- 3 files changed, 42 insertions(+), 18 deletions(-) create mode 100644 hurd/ioctl_types.d

[PATCH] Remove include of hurd/hurd_types.defs in iioctl.defs and rioctl.defs

2022-11-14 Thread Flavio Cruz
hurd/hurd_types.defs is already included through ioctl_types.defs. --- hurd/iioctl.defs | 1 - hurd/rioctl.defs | 1 - 2 files changed, 2 deletions(-) diff --git a/hurd/iioctl.defs b/hurd/iioctl.defs index 78521795..bd2c789f 100644 --- a/hurd/iioctl.defs +++ b/hurd/iioctl.defs @@ -21,7 +21,6 @@ t

[PATCH] Initialize basic types once and print errors for duplicate definitions

2022-11-14 Thread Flavio Cruz
For kernel server or user subsystems we would initialize basic types twice, once in main() and again for the subsystem declaration. Instead, initialize basic types when the subsystem is declared and then throw errors when types are defined multiple times. --- migcom.c | 1 - parser.y | 5 ++---

[PATCH] Update mach_debug interfaces to use struct.

2022-11-22 Thread 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

[PATCH] mig: explicitly use -std=gnu11

2022-11-22 Thread Flavio Cruz
Latest GCC will pick up gnu17 by default but gnu11 will be better supported with older compilers. --- Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.am b/Makefile.am index 918efa1..a528b85 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,6 +3,7 @@ libexec_PROGRAMS = mig

Re: [PATCH] mig: explicitly use -std=gnu11

2022-11-23 Thread Flavio Cruz
On Wed, Nov 23, 2022 at 11:51:36AM +0100, Samuel Thibault wrote: Flavio Cruz, le mer. 23 nov. 2022 00:10:10 -0500, a ecrit: Latest GCC will pick up gnu17 by default but gnu11 will be better supported with older compilers. Mmm, but why explicitly requesting gnu11 then? Latest GCC will be fine

[PATCH] Delete ipc_info.h since it is not used

2022-11-23 Thread Flavio Cruz
--- We don't implement this interface and the types are not used anywhere. Makefrag.am | 1 - include/mach_debug/ipc_info.h | 77 --- include/mach_debug/mach_debug_types.h | 1 - ipc/mach_debug.c | 1 - 4 files chan

[PATCH] mig: replace boolean.h with stdbool.h

2022-11-24 Thread Flavio Cruz
--- Tested by bootstrapping the system from scratch. boolean.h| 60 --- global.c | 12 - global.h | 14 +- mig_string.h | 5 ++-- migcom.c | 14 +- parser.y | 12 - routine.c| 68 +

[PATCH] Delete mach_debug/pc_info.h

2022-11-27 Thread Flavio Cruz
mach/pc_sample.h has the definitions that the kernel actually uses. --- Makefrag.am | 1 - include/mach_debug/pc_info.h | 43 2 files changed, 44 deletions(-) delete mode 100644 include/mach_debug/pc_info.h diff --git a/Makefrag.am b/Makefra

[PATCH] Update mach_port_status_t definition to use the new struct

2022-11-27 Thread Flavio Cruz
Also update C definition to use proper types. --- include/mach/mach_types.defs | 12 +++- include/mach/port.h | 14 +++--- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/include/mach/mach_types.defs b/include/mach/mach_types.defs index f7106946..3ef9611e 1

[PATCH] Use portable rpc types to define 'struct sample'.

2022-11-27 Thread Flavio Cruz
--- include/mach/mach4.defs | 10 -- include/mach/pc_sample.h | 6 +++--- kern/pc_sample.c | 4 ++-- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/include/mach/mach4.defs b/include/mach/mach4.defs index 61423a44..53cca7d3 100644 --- a/include/mach/mach4.defs ++

[PATCH] Make task_info.h structs more portable

2022-11-29 Thread Flavio 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. Changed some counters to simply use unsigned int instead of natural_t. --- doc/mach.texi|

[PATCH] Update ipc/ directory to use mach_port_name_t

2022-11-29 Thread Flavio 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

Re: [PATCH] Make task_info.h structs more portable

2022-11-30 Thread Flavio Cruz
On Wed, Nov 30, 2022 at 10:21:28PM +0100, Samuel Thibault wrote: Flavio Cruz, le mer. 30 nov. 2022 02:10:16 -0500, a ecrit: @table @code -@item natural_t faults +@item unsigned int faults number of page faults -@item natural_t zero_fills +@item unsigned int zero_fills number of zero fill

[PATCH] Use mach_port_name_t in a few more places

2022-11-30 Thread Flavio Cruz
A few places that I missed in 958686efa2175abe3f7044890c2c2370e29147f2. --- ipc/mach_debug.c | 2 +- ipc/mach_msg.c | 2 +- ipc/mach_port.c | 6 +++--- ipc/port.h | 9 - 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/ipc/mach_debug.c b/ipc/mach_debug.c index 1f386

Re: [PATCH] Make task_info.h structs more portable

2022-12-04 Thread Flavio Cruz
rpc_unsigned_long with rpc_long_natural_t. --- On Sat, Dec 03, 2022 at 08:17:55PM +0100, Samuel Thibault wrote: Flavio Cruz, le jeu. 01 déc. 2022 00:10:19 -0500, a ecrit: On Wed, Nov 30, 2022 at 10:21:28PM +0100, Samuel Thibault wrote: > Flavio Cruz, le mer. 30 nov. 2022 02:10:16 -0500, a ecrit: > >

Re: [PATCH] Update ipc/ directory to use mach_port_name_t

2022-12-04 Thread Flavio Cruz
On Wed, Nov 30, 2022 at 10:28:31PM +0100, Samuel Thibault wrote: Hello, Thanks for this! Flavio Cruz, le mer. 30 nov. 2022 02:14:20 -0500, a ecrit: 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

[PATCH] Fix *printf specifier for user space mach ports.

2022-12-04 Thread Flavio Cruz
mach_port_t are mach_port_name_t and thus require %u instead of %lu. --- boot/boot.c | 4 ++-- exec/main.c | 2 +- ext2fs/ext2fs.c | 2 +- ext2fs/pager.c| 2 +- libdiskfs/boot-start.c| 2 +- libpager/data-request.c

Re: [PATCH 2/2] add rpc_versions for vm types

2022-12-05 Thread Flavio Cruz
On Tue, Dec 06, 2022 at 02:10:52AM +0100, Samuel Thibault wrote: Hello Flavio, What do you think of that? I think we could just define vm_size_t as typedef of __mach_uintptr_t then it will be unsigned int on 32 bits and unsigned long on 64 bits. Regarding mach_msg_type_number_t, do you know

[PATCH] Define vm_size_t and vm_offset_t as __mach_uintptr_t.

2022-12-05 Thread 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.

[PATCH] Make task_info.h structs more portable

2022-12-05 Thread Flavio 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_lo

[PATCH] Update kern/ directory to use mach_port_name_t.

2022-12-06 Thread Flavio Cruz
Make it clear where exactly we use port names vs port addresses. --- kern/boot_script.c | 4 ++-- kern/boot_script.h | 4 ++-- kern/bootstrap.c| 12 ++-- kern/ipc_host.c | 2 +- kern/ipc_tt.c | 4 ++-- kern/syscall_subr.c | 4 ++-- kern/syscall_subr.h | 2 +- kern/sys

[PATCH] Use long_natural_t in kern/task.h and kern/slab.h

2022-12-06 Thread Flavio Cruz
RPC interfaces already use long_natural_t so internally we can also use this type. --- kern/slab.h | 10 +- kern/task.h | 14 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/kern/slab.h b/kern/slab.h index 9d8a1156..1e916872 100644 --- a/kern/slab.h +++ b/ke

[PATCH] Use mach_port_name in db_lookup_port

2022-12-06 Thread Flavio Cruz
--- ddb/db_print.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ddb/db_print.c b/ddb/db_print.c index 832faf57..8a76beea 100644 --- a/ddb/db_print.c +++ b/ddb/db_print.c @@ -493,7 +493,7 @@ db_lookup_port( return(0); if (id < 0) return(0); -

[PATCH] Delete thread_get_state_KERNEL and thread_set_state_KERNEL

2022-12-10 Thread Flavio Cruz
These are not used. --- kern/ipc_mig.c | 41 - 1 file changed, 41 deletions(-) diff --git a/kern/ipc_mig.c b/kern/ipc_mig.c index 611ccee9..7ed12faa 100644 --- a/kern/ipc_mig.c +++ b/kern/ipc_mig.c @@ -563,47 +563,6 @@ port_name_to_space(mach_port_name_t n

[PATCH] Delete rpc copyout multiname code

2022-12-10 Thread Flavio Cruz
--- ipc/ipc_object.c | 56 ipc/ipc_right.c | 35 -- 2 files changed, 91 deletions(-) diff --git a/ipc/ipc_object.c b/ipc/ipc_object.c index ebe11492..3fd7f92b 100644 --- a/ipc/ipc_object.c +++ b/ipc/ipc_object.c @@ -666

[PATCH] Use __builtin_ffs instead of libc provided ffs in vm_map.c

2022-12-13 Thread Flavio Cruz
We already this built in in other places and this will move us closer to being able to build the kernel without libc. --- Makefile.am | 4 ++-- vm/vm_map.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile.am b/Makefile.am index 684344e2..33f770f6 100644 --- a/Makef

[PATCH] Implement our own functions to convert between host and network values

2022-12-16 Thread Flavio 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. --- Makefile.am | 20 Makefrag.am | 4 +++- util/byteorder.c | 45 ++

[PATCH] Fix compiler warnings due to use of inline for mask_irq/unmask_irq

2022-12-16 Thread Flavio Cruz
--- i386/i386/apic.h | 14 -- i386/i386/pic.c | 4 ++-- i386/i386/pic.h | 4 ++-- i386/i386at/ioapic.c | 12 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/i386/i386/apic.h b/i386/i386/apic.h index add1b8cf..10c83c01 100644 --- a/i386/i386

[PATCH] Use struct for time_value_t and define seconds as long_integer_t.

2022-12-16 Thread 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. --- i386/include/mach/i386/machine_types.defs | 16 -- i386/include/mach/i386/vm_types.h

Re: [PATCH] Use struct for time_value_t and define seconds as long_integer_t.

2022-12-17 Thread Flavio Cruz
On Sat, Dec 17, 2022 at 03:24:52AM +0100, Samuel Thibault wrote: Applied, thanks! Flavio Cruz, le ven. 16 déc. 2022 21:06:25 -0500, a ecrit: 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 conve

[PATCH] Use long_natural_t for recnum_t

2022-12-18 Thread Flavio 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.

[PATCH] Generate cpu.h with -ffreestanding

2022-12-18 Thread Flavio Cruz
During a system bootstrap, it is preferable that we don't require a full hosted environment. For all other cases, we also do not need libc since mach headers are self contained. --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 918e

[PATCH] Force use of -ffreestanding when checking for gnumach headers

2022-12-18 Thread Flavio Cruz
Without this ./configure assumes that we are in a fully hosted environment, which might not be the case. After this patch, we can rely on the freestanding header files provided by GCC such as stdint.h. --- sysdeps/mach/configure| 8 +++- sysdeps/mach/configure.ac | 6 ++ 2 files change

[PATCH] Remove custom stdint.h and rely on freestanding headers

2022-12-18 Thread Flavio Cruz
GCC already provides this so we don't need to have our own. --- The mig and glibc patches I sent previously are required so that this works without breaking a full system boostrap like how it is done in https://github.com/flavioc/cross-hurd. Makefile.am | 3 +- i386/Makefr

[PATCH] x86_64: stdint.h no longer exists so don't install it

2022-12-19 Thread Flavio Cruz
--- x86_64/Makefrag.am | 1 - 1 file changed, 1 deletion(-) diff --git a/x86_64/Makefrag.am b/x86_64/Makefrag.am index 9548e387..edf533fd 100644 --- a/x86_64/Makefrag.am +++ b/x86_64/Makefrag.am @@ -242,7 +242,6 @@ include_mach_x86_64_HEADERS = \ i386/include/mach/i386/machine_types.defs

[PATCH] Provide intptr_t and uintptr_t as default types

2022-12-19 Thread Flavio Cruz
--- cpu.sym | 3 +++ type.c | 6 ++ 2 files changed, 9 insertions(+) diff --git a/cpu.sym b/cpu.sym index 5e34074..ea7511f 100644 --- a/cpu.sym +++ b/cpu.sym @@ -30,6 +30,7 @@ * Fetch values from the Mach header. */ #include +#include /* * Known values for the msgt_name field

[PATCH] Add support for x86_64-*-gnu-* targets (binutils)

2022-12-19 Thread Flavio Cruz
--- Sending out this patch for comments. If it looks reasonable, will try to submit it upstream. bfd/config.bfd | 5 + ld/configure.tgt | 5 + 2 files changed, 10 insertions(+) diff --git a/bfd/config.bfd b/bfd/config.bfd index 0bc27fdce9..3a1c9f716e 100644 --- a/bfd/config.bfd +++ b/b

[PATCH] Add support for x86_64-*-gnu-* targets (gcc)

2022-12-19 Thread Flavio Cruz
--- This is the GCC patch for x86_64-pc-gnu triplet support. This is the basic version without unwind support which I think is only required to implement exceptions. I'm looking for comments before sending it to the gcc mailing list. gcc/config.gcc | 4 gcc/config/i386/gnu

[PATCH] Use -Wstrict-prototypes and fix warnings

2022-12-20 Thread Flavio 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. --- Makefile.am | 2 +- chips/busses.h| 6 ++--- device/blkio.c| 44 ---

Re: [PATCH] Add support for x86_64-*-gnu-* targets (binutils)

2022-12-21 Thread Flavio Cruz
--- On Wed, Dec 21, 2022 at 12:23:03PM +0100, Samuel Thibault wrote: Hello, Flavio Cruz, le lun. 19 déc. 2022 17:00:30 -0500, a ecrit: Sending out this patch for comments. If it looks reasonable, will try to submit it upstream. Does it build? I had assumed it'd take more than that t

Re: [PATCH] Add support for x86_64-*-gnu-* targets (gcc)

2022-12-21 Thread Flavio Cruz
--- Thanks a lot for the reviews. On Wed, Dec 21, 2022 at 12:32:04PM +0100, Samuel Thibault wrote: Hello, Flavio Cruz, le lun. 19 déc. 2022 17:05:08 -0500, a ecrit: I'm looking for comments before sending it to the gcc mailing list. diff --git a/gcc/config.gcc b/gcc/config.gcc

[PATCH] Fix some warnings with -Wmissing-prototypes.

2022-12-25 Thread Flavio Cruz
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. --- ddb/db_break.c | 8 ++-- ddb/db_command.c | 8 ++--

[PATCH] Use uintptr_t to define vm_size_t/vm_offset_t/vm_address

2022-12-25 Thread Flavio Cruz
--- include/mach/mach_types.defs | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/include/mach/mach_types.defs b/include/mach/mach_types.defs index da74a3f2..5e5d0f2f 100644 --- a/include/mach/mach_types.defs +++ b/include/mach/mach_types.defs @@ -123,11 +123,7 @@ type ipc_

[PATCH] Fix inttypes.h format constants for uintptr_t and intptr_t.

2022-12-26 Thread Flavio Cruz
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. --- i386/i386at/model_dep.c | 5 +++-- include/inttypes.h | 20 +++- 2 files changed, 14 insertions(+), 11 deletio

[PATCH] Delete kern_timestamp system call since it is not used

2022-12-27 Thread Flavio Cruz
--- Makefrag.am | 2 -- kern/lock_mon.c | 1 - kern/mach_clock.c | 7 - kern/priority.c | 1 - kern/startup.c| 3 --- kern/time_stamp.c | 61 -- kern/time_stamp.h | 68 --- 7 files changed, 1

[PATCH] Introduce time_value64_t to keep track of real time in the kernel

2022-12-28 Thread Flavio Cruz
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 mous

Re: [PATCH] Introduce time_value64_t to keep track of real time in the kernel

2023-01-02 Thread Flavio Cruz
mouse events is no longer set and replaced with rpc_time_value for better compatibility. --- On Wed, Dec 28, 2022 at 08:39:49PM +0100, Samuel Thibault wrote: Hello, Flavio Cruz, le mer. 28 déc. 2022 14:11:35 -0500, a ecrit: The timestamp from keyboard and mouse events was removed. It does not seem

Re: [PATCH] Add support for x86_64-*-gnu-* targets (binutils)

2023-01-02 Thread Flavio Cruz
On Wed, Dec 21, 2022 at 10:12:30PM +0100, Samuel Thibault wrote: Flavio Cruz, le mer. 21 déc. 2022 16:06:32 -0500, a ecrit: On Wed, Dec 21, 2022 at 12:23:03PM +0100, Samuel Thibault wrote: > Also, could you perhaps Cc Helmut Grohne ? He will be > very interested in including the patc

[PATCH] Fix ddb warnings introduced with -Wstrict-prototypes

2023-01-03 Thread Flavio Cruz
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). --- ddb/db_break.c | 14 ++--- ddb/db_break.h | 12 +-- ddb/db_command.c | 52

[PATCH] Move cpu_down and other functions inside SMP ifdef

2023-01-04 Thread Flavio Cruz
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. --- kern/machine.c | 119 --- kern/processor.h | 2 -

[PATCH] Use grub-file instead of mbchk to test multiboot header

2023-01-05 Thread Flavio Cruz
mbchk is not part of grub2 and only available on grub-legacy. --- tests/Makefrag.am | 2 +- tests/configfrag.ac| 2 +- tests/{test-mbchk.in => test-multiboot.in} | 8 3 files changed, 6 insertions(+), 6 deletions(-) rename tests/{test-mbch

[PATCH] Fix warning at pic_isa.c

2023-01-05 Thread Flavio Cruz
--- i386/i386at/pic_isa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/i386/i386at/pic_isa.c b/i386/i386at/pic_isa.c index b0415c24..1e5ac103 100644 --- a/i386/i386at/pic_isa.c +++ b/i386/i386at/pic_isa.c @@ -33,8 +33,8 @@ /* These interrupts are always present */ -

[PATCH] Update configure.ac so that we don't need glibc when running ./configure.

2023-01-08 Thread Flavio Cruz
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. --- configure.ac | 8 1 file changed, 8 insertions(+) diff

[PATCH] Set max-page-size when linking the kernel to 0x1000.

2023-01-08 Thread Flavio Cruz
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. He

[PATCH] Export input structures used by Hurd in device/input.h.

2023-01-08 Thread Flavio Cruz
Also delete sys/ioctl.h and merge it with device/input.h since it is only needed here. --- Makefrag.am| 1 + i386/i386at/kd.h | 60 +-- include/device/input.h | 106 + include/sys/ioctl.h| 52

[PATCH] Remove unused db_lookup_port

2023-01-08 Thread Flavio Cruz
--- ddb/db_print.c | 17 - 1 file changed, 17 deletions(-) diff --git a/ddb/db_print.c b/ddb/db_print.c index 6d4c59d3..3fbafe74 100644 --- a/ddb/db_print.c +++ b/ddb/db_print.c @@ -480,23 +480,6 @@ db_port_iterate(const thread_t thread, void (*func)(int, const ipc_port_t, unsig

[PATCH] Remove unused db_set_variable

2023-01-08 Thread Flavio Cruz
--- ddb/db_variables.c | 16 1 file changed, 16 deletions(-) diff --git a/ddb/db_variables.c b/ddb/db_variables.c index 3e20e689..40f2d4d3 100644 --- a/ddb/db_variables.c +++ b/ddb/db_variables.c @@ -160,22 +160,6 @@ db_get_variable(db_expr_t *valuep) return (1); } -in

Re: [PATCH] Update configure.ac so that we don't need glibc when running ./configure.

2023-01-09 Thread Flavio Cruz
: Flavio Cruz, le dim. 08 janv. 2023 21:49:40 -0500, a ecrit: 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

[PATCH] Include device/input.h in console-client

2023-01-09 Thread Flavio Cruz
We avoid using repeated definitions and also update kd_event with the new 64bit compatible fields (rpc_time_value). --- console-client/mach-inputdev.h | 56 +- 1 file changed, 1 insertion(+), 55 deletions(-) diff --git a/console-client/mach-inputdev.h b/console-cli

[PATCH] Preemptively fix warnings that will be caused by -Wmissing-prototypes

2023-01-09 Thread Flavio Cruz
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. --- Makefrag.am | 1 + ddb/db_ext_symtab.c | 1 + ipc/mach_port.c | 1 - ipc/mach_port.h | 103 ++

[PATCH] Use rpc_uintptr_t for protected payloads.

2023-01-11 Thread Flavio Cruz
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. --- i386/include/mach/i386/vm_types.h | 2 ++ include/mach/mach_port.defs | 2 +- inclu

[PATCH] Create kern/mach4.h and kern/mach_host.h and define the RPC prototypes for mach4.defs and mach_host.defs.

2023-01-11 Thread Flavio Cruz
Also move more mach_debug rpcs to kern/mach_debug.h. --- Makefrag.am | 2 ++ ipc/mach_debug.c | 1 + kern/host.c | 1 + kern/ipc_host.c | 2 ++ kern/ipc_mig.h| 9 + kern/ipc_tt.c | 1 + kern/mach4.h | 66 kern/mach_debug.h

[PATCH] Add host_get_time64 RPC to return the time as time_value64_t.

2023-01-13 Thread Flavio Cruz
Also updated the mapped time to support the new 64-bit time while keeping compatibility with the user land programs currently using it so they can be migrated in parallel. --- doc/mach.texi| 42 include/mach/mach_host.defs | 8 include/mach/mach_types.de

[PATCH] Delete ffs and strrchr prototypes.

2023-01-14 Thread Flavio Cruz
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. --- include/string.h | 4 kern/strings.c | 21 - 2 files changed, 25 deletions(-) diff --git a/include/string.

[PATCH] Delete util/putchar.{c,h} and util/puts.c

2023-01-16 Thread Flavio Cruz
Those functions are unused. --- Makefrag.am| 3 --- util/putchar.c | 32 util/putchar.h | 32 util/puts.c| 40 4 files changed, 107 deletions(-) delete mode 100644 util/putchar.c d

[PATCH] Delete x86 string functions

2023-01-16 Thread Flavio Cruz
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). --- i386/i386/strings.c | 54 - 1 file changed, 54 deletions(-) diff --git a/i386/i386

[PATCH] Add kern/mach.h and kern/gnumach.h to define rpc prototypes

2023-01-16 Thread Flavio Cruz
This will remove more warnings for -Wmissing-prototypes. --- Makefrag.am | 2 + kern/gnumach.h | 62 +++ kern/ipc_tt.c| 1 + kern/mach.h | 223 +++ kern/mach_host.h | 9 ++ kern/slab.c

[PATCH] Include mig generated headers to avoid warnings with -Wmissing-prototypes.

2023-01-17 Thread Flavio Cruz
This also reverts 566c227636481b246d928772ebeaacbc7c37145b and 963b1794d7117064cee8ab5638b329db51dad854 --- Makefrag.am | 3 - ddb/db_aout.c| 2 +- ddb/db_ext_symtab.c | 4 +- ddb/db_sym.c | 4 +- ddb/db_sym.h | 6 +- ipc/mach_debug.c

Re: [PATCH] Add host_get_time64 RPC to return the time as time_value64_t.

2023-01-19 Thread Flavio Cruz
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. --- On Mon, Jan 16, 2023 at 11:37:47PM +0100, Samuel Thibault wrote: Flavio Cruz, le ven. 13 janv. 2023 03:27:05 -0500, a ecrit

[PATCH] Include mig generated device headers to avoid missing prototypes

2023-01-19 Thread Flavio Cruz
Some of the existing definitions lacked the const qualifier, which was added. --- device/dev_hdr.h | 4 ++-- device/dev_lookup.c | 2 +- device/dev_name.c| 4 ++-- device/dev_pager.c | 1 + device/device_emul.h | 4 ++-- device/ds_routines.c | 13 +++-- 6 files changed, 15

[PATCH] Remove existing old style definitions and use -Wold-style-definition.

2023-01-19 Thread Flavio Cruz
--- Makefile.am | 2 +- ddb/db_cond.c| 3 +-- ddb/db_expr.c| 5 + device/cons.c| 3 +-- device/dev_lookup.c | 3 +-- device/dev_name.c| 7 +++ device/net_io.c | 32 ++-- i386/i386/pcb.c

[PATCH] Fix several warnings for -Wmissing-prototypes

2023-01-19 Thread Flavio Cruz
* ddb/db_mp.c: remove unused function. * 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

[PATCH] Use -O2 -g by default when compiling

2023-01-21 Thread Flavio Cruz
After d5e5dd3401ea0d0475aa830c2171be5b8a72f4fa we can configure and make gnumach without glibc, however it no longer used -O2 -g in CFLAGS by default. This reverts that behavior. --- configure.ac | 4 1 file changed, 4 insertions(+) diff --git a/configure.ac b/configure.ac index 8f10b5d5..36

[PATCH] [x86_64] dev_pager.c: use mach_msg_type_number_t

2023-01-23 Thread Flavio Cruz
Otherwise it will fail to compile due to conflicting types. --- device/dev_pager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/device/dev_pager.c b/device/dev_pager.c index 728be036..d9d22489 100644 --- a/device/dev_pager.c +++ b/device/dev_pager.c @@ -494,7 +494,7 @@ devic

[PATCH] [ipc_kmsg.c] Set kr if copy cannot be copied to user space

2023-01-23 Thread Flavio Cruz
Compiler will complain otherwise that kr is not initialized. --- ipc/ipc_kmsg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ipc/ipc_kmsg.c b/ipc/ipc_kmsg.c index 2c9d4988..dac4f5dc 100644 --- a/ipc/ipc_kmsg.c +++ b/ipc/ipc_kmsg.c @@ -2466,8 +2466,10 @@ ipc_kmsg_copyout_b

[PATCH] Fix several warnings for -Wmissing-prototypes (part 2)

2023-01-23 Thread Flavio Cruz
* i386/i386/io_map.c: code is unused. * i386/i386/io_perm.c: include mig prototypes. * i386/i386/mp_desc.c: Deleted interrupt_stack_alloc since it is not used. * i386/i386/seg.h: Moved descriptor structs to i386/include/mach/i386/mach_i386_types.h as that represents the interface types for RPC

[PATCH] Do not include seg.c when building for x86_64

2023-01-24 Thread Flavio Cruz
File was removed in a previous patch for i386. To avoid future problems, include some common files between i386 and x86_64 in i386/Makefrag_x86.am. It is also easier to see what is different and what lacks support for x86_64 (e.g., SMP). --- Makefrag.am | 7 i386/Makefrag.am |

[PATCH] [tls] use real_descriptor instead of descriptor

2023-01-25 Thread Flavio Cruz
Interface was changed in https://git.savannah.gnu.org/cgit/hurd/gnumach.git/commit/?id=b379d5afdf65cce11426ab0349a3778b3fd632f5 where the signature of i386 RPCs are now using real_descriptor. --- sysdeps/mach/hurd/i386/htl/pt-machdep.c | 14 + sysdeps/mach/hurd/i386/tls.h|

[PATCH] [libmachdev] use real_descriptor instead of descriptor

2023-01-25 Thread Flavio Cruz
Interface was changed in https://git.savannah.gnu.org/cgit/hurd/gnumach.git/commit/?id=b379d5afdf65cce11426ab0349a3778b3fd632f5 where the signature of i386 RPCs are now using real_descriptor --- libmachdev/trivfs_server.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a

[PATCH] Change i386 RPC subsystem to include descriptor instead of real_descriptor

2023-01-26 Thread Flavio Cruz
This should avoid issues with glibc and hurd as introduced in https://git.savannah.gnu.org/cgit/hurd/gnumach.git/commit/?id=b379d5afdf65cce11426ab0349a3778b3fd632f5 since we are changing the types of the parameters when implementing the RPCs to match the previous declaration using `struct desc

Re: [PATCH] Add support for x86_64-*-gnu-* targets to build x86_64 gnumach/hurd

2023-01-26 Thread Flavio Cruz
with a TODO for now. Signed-off-by: Flavio Cruz --- On Thu, Jan 26, 2023 at 09:34:16AM +0100, Thomas Schwinge wrote: Hi Flavio! Hi Thomas! On 2022-12-26T12:34:28-0500, Flavio Cruz via Gcc-patches wrote: Tested by building a toolchain and compiling gnumach for x86_64 Oh, wow, so

[PATCH] [xen] Fix compiler warnings

2023-01-27 Thread Flavio Cruz
* i386/xen/xen.c: Move failsafe_callback_regs to header file and include xen/xen.h * xen/block.c: `name` must be const. Fix format string. * xen/console.c: Move hyp_console_write and inline it in the header. Use static qualifier whenever possible. Cast to interrupt_handler_fn. * xen/console.h:

[PATCH] Delete unused header cthreads.h

2023-01-27 Thread Flavio Cruz
--- i386/include/mach/i386/cthreads.h | 56 --- 1 file changed, 56 deletions(-) delete mode 100644 i386/include/mach/i386/cthreads.h diff --git a/i386/include/mach/i386/cthreads.h b/i386/include/mach/i386/cthreads.h deleted file mode 100644 index d2aa16f5.. -

[PATCH] Use standard types in include/device/input.h

2023-01-27 Thread Flavio Cruz
--enable-platform=xen won't compile because u_char is not included from sys/types.h. Also, we are forcing users of include/device/input.h to include glibc headers that export such types which should not be necessary. For i386/i386at/kd.h we include input.h to get Scancode. --- i386/i386at/kd.h

[PATCH] Add host_set_time64 and host_adjust_time64

2023-01-27 Thread Flavio Cruz
Same existing logic, just with 64 bits. Old RPCs are implemented by calling into the new RPCs. --- doc/mach.texi | 4 +-- include/mach/mach_host.defs | 18 ++ kern/mach_clock.c | 67 +++-- 3 files changed, 69 insertions(+), 20 deleti

  1   2   3   4   >