summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-05-10proc: Fix use-after-reallocSergey Bugaev
Message-Id: <20230508213136.608575-19-bugaevc@gmail.com>
2023-05-10proc: Port to x86_64Sergey Bugaev
Message-Id: <20230508213136.608575-18-bugaevc@gmail.com>
2023-05-10auth: Port to x86_64Sergey Bugaev
Message-Id: <20230508213136.608575-17-bugaevc@gmail.com>
2023-05-10utils: Avoid warnings about prototype mismatchSergey Bugaev
Message-Id: <20230508213136.608575-16-bugaevc@gmail.com>
2023-05-10utils: Port to x86_64Sergey Bugaev
Message-Id: <20230508213136.608575-15-bugaevc@gmail.com>
2023-05-10libmachdev: Port to x86_64Sergey Bugaev
Message-Id: <20230508213136.608575-14-bugaevc@gmail.com>
2023-05-10libps: Port to x86_64Sergey Bugaev
Message-Id: <20230508213136.608575-12-bugaevc@gmail.com>
2023-05-10libpipe: Fix use-after-reallocSergey Bugaev
We cannot use old_buf after we realloc it, even just for subtracting it from another pointer. Instead, compute the offsets in advance. Message-Id: <20230508213136.608575-11-bugaevc@gmail.com>
2023-05-10libstore: Port to x86_64Sergey Bugaev
Message-Id: <20230508213136.608575-10-bugaevc@gmail.com>
2023-05-10libdiskfs: Port to x86_64Sergey Bugaev
Message-Id: <20230508213136.608575-9-bugaevc@gmail.com>
2023-05-10libnetfs: Port to x86_64Sergey Bugaev
Message-Id: <20230508213136.608575-8-bugaevc@gmail.com>
2023-05-10libtrivfs: Port to x86_64Sergey Bugaev
Message-Id: <20230508213136.608575-7-bugaevc@gmail.com>
2023-05-10libfshelp-tests: Port to x86_64Sergey Bugaev
Message-Id: <20230508213136.608575-6-bugaevc@gmail.com>
2023-05-10libfshelp: Port to x86_64Sergey Bugaev
Message-Id: <20230508213136.608575-5-bugaevc@gmail.com>
2023-05-10libiohelp: Port to x86_64Sergey Bugaev
Message-Id: <20230508213136.608575-4-bugaevc@gmail.com>
2023-05-10libports: Port to x86_64Sergey Bugaev
Message-Id: <20230508213136.608575-3-bugaevc@gmail.com>
2023-05-10libshouldbeinlibc: Port to x86_64Sergey Bugaev
Message-Id: <20230508213136.608575-2-bugaevc@gmail.com>
2023-05-08Stop checking if MiG supports retcode.Flavio Cruz
Due to MiG requiring the subsystem to be defined early in order to know the size of a port, this was causing a division by zero error during ./configure. We could have just move subsystem to the top of the snippet, however it is simpler to just remove the check given that we have no plans to use some other MiG anyway. We force RETURN_CODE_ARG to use retcode which is a no-op. Message-Id: <ZFhs3KSeGhuubS8T@jupiter.tail36e24.ts.net>
2023-05-07Implement device_open_new for all the translators implementing the device ↵Flavio Cruz
interface. Message-Id: <ZFfcloxDKSiyHJTH@jupiter.tail36e24.ts.net>
2023-05-06Update eth-multiplexer/vdev.c to be more portableFlavio Cruz
* Perform the correct alignment for x86_64. * Use designated initializers. Message-Id: <ZFSJeDp9rWoNK4lL@jupiter.tail36e24.ts.net>
2023-05-06proc: Add CPU_TYPE_X86_64 supportSamuel Thibault
2023-05-04Use designated initializers when building mach_msg_type_tFlavio Cruz
Message-Id: <ZFLcIs0iwiC9kQDf@jupiter.tail36e24.ts.net>
2023-05-02Make dev_t word typeSamuel Thibault
dev_t are 64bit on Linux ports, so better increase their size on 64bit Hurd. It happens that this helps with BZ 23084 there: st_dev has type fsid_t (quad) and is specified by POSIX to have type dev_t. Making dev_t 64bit makes these match.
2023-05-02Use uintptr_t for message payloads.Flavio Cruz
A follow up to 92fad38a043b75ed6b435b3efa574ede91dbe9ee in gnumach. Message-Id: <ZFCNasf9bJ9qj+CG@jupiter.tail36e24.ts.net>
2023-04-25Use c_string for default_pager_filename_t to define a new ↵Flavio Cruz
default_pager_paging_storage RPC. This brings us a bit closer to having all types' msgt_size representable with a single byte. We will be able to avoid mach_msg_type_long_t entirely for x86_64 since mach_msg_type_t can represent long types using a separate field. Message-Id: <ZEdO0Grm2AUw4Tfe@jupiter.tail36e24.ts.net>
2023-04-24Improve portability for rpctrace on x86_64Flavio Cruz
Defined alignment as __alignof__(uintptr_t) to match MiG. Also used char* instead of void* during the message iteration since it's more portable as pointer arithmetic on void* is a GNU extension. Message-Id: <ZEYMUWHf/2VH2KlD@jupiter.tail36e24.ts.net>
2023-04-18utils/msgport.c: Add cmd_report_waitSergey Bugaev
This exposes msg_report_wait. For example: $ msgport --report-wait --pid $$ 26997: 2 threads 26997: thread 0: proc_wait_request [init#3] 26997: thread 1: msgport Message-Id: <20230418104915.12301-1-bugaevc@gmail.com>
2023-04-18procfs: Fix process creation time in /proc/pid/statSergey Bugaev
This was always showing up as 0, because apparently we need to query creation_time for the task, not a thread. Here's a before vs after comparison: $ cat /proc/self/stat ~/procfs/self/stat 11151 (cat) S 26571 11151 26571 0 0 0 0 0 0 0 1 0 0 0 20 0 2 0 0 154783744 251 0 134443008 134477480 0 0 0 0 0 0 0 21001 0 0 0 0 0 0 0 11151 (cat) S 26571 11151 26571 0 0 0 0 0 0 0 1 0 0 0 20 0 2 0 168174516295 154783744 260 0 134443008 134477480 0 0 0 0 0 0 0 21001 0 0 0 0 0 0 0 Message-Id: <20230418104902.12263-1-bugaevc@gmail.com>
2023-04-15Remove default_pager_paging_file RPC from default pagerFlavio Cruz
The default_pager_paging_storage RPC has already it more than 20 years ago. Given that we want to change the type of default_pager_filename_t to use c_string, we can just remove the unused RPC. Tested that swapon/swapoff still work with the new binaries. Message-Id: <ZDoyNOE0XB77d5xj@mars.tail36e24.ts.net>
2023-04-09Link libshouldbeinlibc with default pager user stubsFlavio Cruz
There was an implicit dependency on -lmachuser. Adding a dependency to generated stubs from hurd so that we can stop providing the stubs in machuser from glibc. Message-Id: <ZC+nsGvhsOwt6XyB@jupiter.tail36e24.ts.net>
2023-04-08Use long_integer_t for exception_raise RPCsFlavio Cruz
Also update the crash_dump_task RPC since it gets the subcode from the signal details in Glibc. This should fix the existing build error. Message-Id: <ZDDrnHFHtiLIS53W@jupiter.tail36e24.ts.net>
2023-04-08Further modernize Hurd code by enforcing strict prototypes and no implicit ↵Flavio Cruz
function declarations. Most of the changes land in one of these buckets: * Removed unused declarations. * Used (void) to represent no parameters instead of () which means an undeterminate number of parameters. * Included missing header files whenever necessary (stdlib.h, sys/mman.h, etc) * Typedefed function pointers to be able to fully declare the parameter types. * Added declarations of library functions that are used elsewhere (example is libps/ps.h). * Made functions static whenever they are only used in that file. * Forwarded declarations of some methods that were made static. Message-Id: <ZDD1o7/tVYeZew+G@jupiter.tail36e24.ts.net>
2023-04-08Fix build error for boot/boot.cFlavio Cruz
Message-Id: <ZDDr1XFRL+6dQ3iQ@jupiter.tail36e24.ts.net>
2023-04-07Use default pager MiG stubs from Hurd instead of gnumachFlavio Cruz
Hurd code relies on gnumach default_pager.defs headers when making calls using the default pager RPC. Those stubs were checked in back in the 90s and are essentially unused because gnumach does not implement or use that interface. Instead use the Hurd interface directly. This is safe since the Hurd stubs are a super set of the gnumach stubs. Later, we won't need to install the gnumach stubs anymore through glibc. Message-Id: <ZC5WqPKfCCiE8D29@jupiter.tail36e24.ts.net>
2023-04-03Use the new host_get_kernel_version introduced recently.Flavio Cruz
https://git.savannah.gnu.org/cgit/hurd/gnumach.git/commit/?id=5447f965f1e109f7ac9aeb91c0e3906969a4adb8 provides more context. Message-Id: <ZBFkAXCYcj27UXRo@mars.tail36e24.ts.net>
2023-04-03Modernize code by removing use of old style definitions.Flavio Cruz
Also add -Werror=old-style-definition to enforce new code. Message-Id: <ZBZ+8xf7GHy2RT/h@jupiter.tail36e24.ts.net>
2023-02-27libstore: Fix zero store size computationSamuel Thibault
56d065041793 ("libstore: Fix undefined behavior") missed letting the sign bit be 0, thus leading to a negative store size, and thus /dev/zero would reject any read/write.
2023-02-23pfinet: Fix shifting left into bit 31Samuel Thibault
2023-02-19pfinet: Align packetsSamuel Thibault
The Ethernet header is 14 bytes long, and thus leads to IP header misalignment. This uses skb_reserve to introduce 2 bytes of padding to realign IP headers.
2023-02-16mach-defpager: Add defpager_server_nameSamuel Thibault
To allow e.g. libubsan to detect it should be extra cautious.
2023-02-16mach-defpager: Fix crash on pthread_cond_broadcastSamuel Thibault
We need to keep ds locked, otherwise it might disappear before we have a chance to broadcast the condition.
2023-02-15nfs: Fix shifting leftSamuel Thibault
Shifting signed 0xffffffff 32 bit left is undefined behavior. Cast to unsigned to make it defined behavior.
2023-02-15Fix accessing bit 31Samuel Thibault
Shifting (signed) 1 to left 31 positions is undefined behavior. So make this an unsigned so it becomes defined behavior.
2023-02-10libstore: Fix undefined behaviorSamuel Thibault
store_offset_t is a signed type, so 1 << (bits-1) overflows.
2023-02-03procfs: Actually add padding to align struct direntSamuel Thibault
d21b09b32895 was computing the amount and filling it, but not actually enforcing it.
2023-02-02Avoid variable length array with size zeroSamuel Thibault
2023-02-02Avoid unaligned memory accessesSamuel Thibault
2023-02-02Avoid undefined-behaviorSamuel Thibault
1 << 31 is undefined behavior, 1 needs to be made unsigned for << 31 to be defined behavior.
2023-02-02procfs: Add padding to align struct direntSamuel Thibault
2023-02-02ext2fs: use __alignof (struct dirent) instead of hardcoding 4Samuel Thibault