| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
| |
Protected payloads will be 8-byte longs which are the same size as
kernel ports.
Also aligned all the structures to be 4-byte aligned since it makes it
easier to parse them as padding won't be added to mach_msg_user_header_t
before the protected payload.
Message-Id: <Y+krwRFIUeyRszl9@jupiter.tail36e24.ts.net>
|
|
|
|
|
|
|
|
|
|
|
|
| |
* include/mach/task_info.h: use rpc variant of time_value_t
* include/mach/thread_info.h: Likewise
* kern/mach_clock.c: use rpc variant of time_value_t in
read_time_stamp()
* kern/mach_clock.h: Likewise
* kern/thread.c: use rpc variant of thread_read_times()
* kern/timer.h_ add thread_read_times_rpc() by converting time_value_t
to the corresponding rpc structures inline.
Message-Id: <20230212170313.1501404-5-luca@orpolo.org>
|
|
|
|
|
|
|
|
|
|
| |
When generating stubs, Mig will will take the vm_size_array_t and define the
input request struct using rpc_vm_size_t since the size is variable. This will turn cause a mismatch
between types (vm_size_t* vs rpc_vm_size_t*). We could also ask Mig to produce
a prototype by using rpc_vm_size_t*, however we would need to change the implementation
of the RPC to use rpc_* types anyway since we want to avoid another allocation
of the array.
Message-Id: <Y9iwScHpmsgY3V0N@jupiter.tail36e24.ts.net>
|
|
|
|
|
|
| |
Same existing logic, just with 64 bits. Old RPCs are implemented by
calling into the new RPCs.
Message-Id: <Y9TJAmL2byOWup5x@jupiter.tail36e24.ts.net>
|
|
|
|
|
|
|
|
|
|
| |
--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.
Message-Id: <Y9S7oIyVFazVAOqb@jupiter.tail36e24.ts.net>
|
|
|
|
| |
message.h is installed so we need to hide these behind a mach_ prefix
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Message-Id: <Y6j9bnHphZp0ZPYC@mars>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
The inline keyword was not defined there, so we need to use __inline__.
This fixes make check in glibc.
|
|
|
|
|
| |
GCC already provides this so we don't need to have our own.
Message-Id: <Y5+02FVA6jf4GPgA@mars>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Message-Id: <Y4QQFkTUR4M60Gx0@viriathus>
|
|
|
|
|
| |
Also update C definition to use proper types.
Message-Id: <Y4QKgh0zHdB8pWhD@viriathus>
|
|
|
|
|
| |
mach/pc_sample.h has the definitions that the kernel actually uses.
Message-Id: <Y4QKGtUdbz+AVO3l@viriathus>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Message-Id: <Y35PHuUNCFb6sQO0@viriathus>
|
|
|
|
| |
Message-Id: <Y23fab31RM6HcCyb@viriathus>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
| |
These are provided by mig since ecf59842e472 ("Make MIG recognize the
basic C integral types."), released in snapshot v1.8+git20200618.
|
|
|
|
|
| |
In the 32/64 conversion case it is copyinmsg that will know the
eventual size.
|
|
|
|
|
|
|
|
|
| |
* include/mach/host_info.h: replace vm_size_t with rpc_ version for 64
bit compatibility. Ideally it should use phys_addr_t or another unit
like KB or MB
Signed-off-by: Luca Dariz <luca@orpolo.org>
Message-Id: <20220628101054.446126-8-luca@orpolo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* include/mach/mach_types.defs: use rpc_ vm types for KERNEL_USER stubs.
This change fixes two use cases:
* internal rpc, e.g. when a memory object is initialized as a
consequence of vm_map(); for example, the bootstrap modules use the
"time" kernel device and memory-map it during startup. This
triggers a kernel-side rpc to initialize the memory object and
install the map, which is completely transparent form user-space.
* notifications from kernel to user-space
Signed-off-by: Luca Dariz <luca@orpolo.org>
Message-Id: <20220628101054.446126-2-luca@orpolo.org>
|
| |
|
|
|
|
|
| |
Now that mach/machine/vm_types.h uses stdint types, we have to ship a
header that defines them.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* vm_types.h: add new types and conversion functions
* mach_types.defs: adapt vm types depending on kernel user/server
* vm_info.h: adapt rpc structure to have uniformly-sized members also
on 64-bit
* x86_64/configfrag.c: add new option to select the user-space variant.
Note that with this change the user-space interface is somehow fixed,
i.e. it can't support 32-bit and 64-bit tasks at the same time.
If this would be needed at some point, this change needs to be reworked.
Signed-off-by: Luca Dariz <luca@orpolo.org>
Message-Id: <20220403145955.120742-3-luca@orpolo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* include/mach/mach_port.defs
- use C type mach_port_name_array_t
* include/mach/port.h:
- add new types mach_port_name_t and mach_port_name_array_t
- refine mach_port_t type for user and kernel space
- use port names in mach_port_status to allow compilation of 64-bit
- use port name to have uniform sizes and remove the
old_mach_port_status_t as it's unused
* include/mach/std_types.defs
- use C type mach_port_name_array_t
* kern/thread.{h,c}
- fix prototype to use port names. So far it seems the only rpc to
cause a conflict between the mig-generated header and the regular
header, so compilation fails.
Signed-off-by: Luca Dariz <luca@orpolo.org>
Message-Id: <20220403145955.120742-2-luca@orpolo.org>
|
|
|
|
|
|
|
|
|
| |
* use _raw_ structs where we refer to the bootloader-provided data
* remove unused structures
* fix 64 bit boot
Signed-off-by: Luca Dariz <luca@orpolo.org>
Message-Id: <20220205175129.309469-3-luca@orpolo.org>
|
|
|
|
|
| |
* include/mach/port.h:
- remove the old_mach_port_status_t as it's unused.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
This will avoid forcing the caller to respect the definite string size.
|