| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
This will avoid forcing the caller to respect the definite string size.
|
|
|
|
| |
For coherency with memory_object_create_proxy.
|
|
|
|
|
|
|
|
|
| |
To get a proxy to the region a given address belongs to,
with protection and range limited to the region ones.
* include/mach/mach4.defs: vm_region_get_proxy RPC declaration
* vm/vm_map.c: vm_region_get_proxy implementation
Message-Id: <20211106081333.10366-2-jlledom@mailfence.com>
|
|
|
|
|
|
|
|
|
|
| |
mach_port_t is for userland, kernel sees the translated ipc_port_t.
* include/mach/memory_object.h [MACH_KERNEL]: Include ipc/ipc_types.h
[MACH_KERNEL] (memory_object_t): Typedef to ipc_port_t instead of
mach_port_t.
(memory_object_array_t): Typedef to memory_object_t* instead of
mach_port_t*.
|
|
|
|
|
|
|
|
|
|
|
| |
This is a no-op on i386.
* i386/include/mach/i386/vm_types.h (vm_size_array_t): New type.
* include/mach/mach4.defs (vm_size_array_t): New type.
(memory_object_create_proxy): Turn len parameter from vm_offset_array_t
to vm_size_array_t.
* vm/memory_object_proxy.c (memory_object_create_proxy): Turn len
parameter from const vm_offset_t * to const vm_size_t *.
|
|
|
|
|
|
|
|
|
| |
It would be very tricky for the server to manage deallocation for
device_read, and does not seem useful anyway. device_reply.defs already
has it.
* include/device/device.defs (device_read): Add dealloc flag for the data
array.
|
|
|
|
| |
This is required anyway, and allows the caller to pass on MAKE_SEND.
|
|
|
|
|
|
|
|
|
|
|
| |
glibc's sysdeps/mach/hurd/dl-sysdep.c has been wanting to use this for
decades.
* include/string.h (ffs): New declaration.
* vm/vm_map.c: Include <string.h>.
(vm_map_find_entry_anywhere): Separate out high bits from mask, to
compute the maximum offset instead of map->max_offset.
* doc/mach.texi (vm_map): Update documentation accordingly.
|
|
|
|
|
|
|
| |
vm_offset_t are offsets inside memory objects, not actual addresses.
* include/mach/gnumach.defs (gsync_wait, gsync_wake, gsync_requeue): Use
vm_address_t instead of vm_offset_t.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows privileged userland drivers to get notifications of hardware
interrupts.
Initial work by Zheng Da, reworked by Damien Zammit and myself.
* Makefrag.am (libkernel_a_SOURCES): Add device/intr.c and
device/intr.h.
(include_device_HEADERS): Add include/device/notify.defs and
include/device/notify.h.
* device/dev_hdr.h (name_equal): Add declaration.
* device/ds_routines.c: Include <device/intr.h>
(ds_device_intr_register, ds_device_intr_ack): New functions.
* device/intr.c, device/intr.h: New files.
* doc/mach.texi (Device Interrupt): New section.
* i386/Makefrag.am (libkernel_a_SOURCES): Add i386/i386/irq.c and
i386/i386/irq.h.
* i386/i386/irq.c, i386/i386/irq.h: New files.
* i386/i386at/conf.c: Include <device/intr.h>.
(irqname): New macro.
(dev_name_list): Add irq device.
* include/device/device.defs (device_intr_register, device_intr_ack):
New RPCs.
* include/device/notify.defs, include/device/notify.h: New files.
* kern/startup.c: Include <device/intr.h>
(start_kernel_threads): Start intr_thread thread.
* linux/dev/arch/i386/kernel/irq.c: Include <device/intr.h>
(linux_action): Add user_intr field.
(linux_intr): Call user_intr action if any.
(mask_irq, unmask_irq): Move functions to i386/i386/pic.c
(__disable_irq, __enable_irq): Move functions to i386/i386/irq.c.
(install_user_intr_handler): New function.
(request_irq): Initialize user_intr field.
* linux/src/include/asm-i386/irq.h (__disable_irq, __enable_irq): Remove
prototypes.
* i386/i386/pic.c (mask_irq, unmask_irq): New functions.
* i386/i386/pic.h (mask_irq, unmask_irq): New prototypes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This allows privileged userland drivers to allocate buffers for e.g. DMA,
and thus need them to be physically contiguous and get their physical
address.
Initial work by Zheng Da, reworked by Richard Braun, Damien Zammit, and
myself.
* doc/mach.texi (vm_allocate_contiguous): New RPC.
* i386/include/mach/i386/machine_types.defs (rpc_phys_addr_t): New type.
* i386/include/mach/i386/vm_types.h [!MACH_KERNEL] (phys_addr_t): Set
type to 64bits.
(rpc_phys_addr_t): New type, always 64bits.
* include/mach/gnumach.defs (vm_allocate_contiguous):New RPC.
* vm/vm_user.c (vm_allocate_contiguous): New function.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is free for experimenting RPCs, with no backward compatibility guarantees.
* Makefrag.am (EXTRA_DIST): Add kern/experimental.srv.
(include_mach_HEADERS): Add include/mach/experimental.defs.
(nodist_lib_dep_tr_for_defs_a_SOURCES): Add
kern/experimental.server.defs.c.
(nodist_libkernel_a_SOURCES): Add kern/experimental.server.h,
kern/experimental.server.c, kern/experimental.server.msgids.
(nodist_libkernel_a_SOURCES): Add kern/experimental.server.defs.
* include/mach/experimental.defs: New file.
* kern/experimental.srv: New file.
* kern/ipc_kobject.c: Include <kern/experimental.server.h>.
(ipc_kobject_server): Call experimental_server_routine.
|
|
|
|
|
| |
* i386/i386at/biosmem.c: Include <inttypes.h>
(biosmem_map_show, biosmem_load_segment): Use PRIx64.
|
|
|
|
| |
* include/mach/xen.h (PFN_LIST): Set to MACH2PHYS_VIRT_START.
|
|
|
|
|
|
|
| |
In order to fix year 2038 limit in RTC driver
* include/sys/types.h (time_t): Bump type to 64bit.
* Makefile.am (clib_routines): Also allow __moddi3.
|
|
|
|
|
|
|
| |
* include/mach/thread_info.h (thread info structures): Add new member
"last_processor" in thread_sched_info.
* kern/thread.c (thread management): Fill new member "last_processor" in
thread_info() function.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* include/mach/vm_sync.h: New file.
* include/mach/mach_types.h: Include <mach/vm_sync.h>
* Makefrag.am (include_mach_HEADERS): Add include/mach/vm_sync.h.
* include/mach/mach_types.defs (vm_sync_t): Add type.
* include/mach/gnumach.defs (vm_object_sync, vm_msync): Add RPCs.
* vm/vm_map.h: Include <mach/vm_sync.h>.
(vm_map_msync): New declaration.
* vm/vm_map.c (vm_map_msync): New function.
* vm/vm_user.c: Include <mach/vm_sync.h> and <kern/mach.server.h>.
(vm_object_sync, vm_msync): New functions.
|
| |
|
|
|
|
|
| |
* include/device/bpf.h: Do not include <sys/types.h>
(struct bpf_version): Use unsigned short type instead of u_short.
|
|
|
|
|
|
| |
* i386/include/mach/i386/mach_i386_types.h (const_descriptor_list_t):
New type.
* include/mach/port.h (const_mach_port_array_t): New type.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This call maps the POSIX mlockall and munlockall calls.
* Makefrag.am (include_mach_HEADERS): Add include/mach/vm_wire.h.
* include/mach/gnumach.defs (vm_wire_t): New type.
(vm_wire_all): New routine.
* include/mach/mach_types.h: Include mach/vm_wire.h.
* vm/vm_map.c: Likewise.
(vm_map_enter): Automatically wire new entries if requested.
(vm_map_copyout): Likewise.
(vm_map_pageable_all): New function.
vm/vm_map.h: Include mach/vm_wire.h.
(struct vm_map): Update description of member `wiring_required'.
(vm_map_pageable_all): New function.
* vm/vm_user.c (vm_wire_all): New function.
|
|
|
|
|
|
|
|
| |
Instead of copying the send right, move it. This fixes a send-right
leak.
* include/mach/task_notify.defs (task_move_t): New type.
(mach_notify_new_task): Use the new type.
|
|
|
|
|
| |
* include/mach/task_notify.defs (task_notify_port_t): New type.
(mach_notify_new_task): Use the specialized type.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* NEWS: Update.
* device/dev_pager.c (device_pager_data_request): Prune unused branch.
(device_pager_data_request_done): Remove function.
(device_pager_data_write): Likewise.
(device_pager_data_write_done): Likewise.
(device_pager_copy): Use 'memory_object_ready'.
* device/dev_pager.h (device_pager_data_write_done): Remove prototype.
* device/device_pager.srv (memory_object_data_write): Remove macro.
* doc/mach.texi: Update documentation.
* include/mach/mach.defs (memory_object_data_provided): Drop RPC.
(memory_object_set_attributes): Likewise.
* include/mach/memory_object.defs: Update comments.
(memory_object_data_write): Drop RPC.
* include/mach/memory_object_default.defs: Update comments.
* include/mach_debug/vm_info.h (VOI_STATE_USE_OLD_PAGEOUT): Drop
macro.
* vm/memory_object.c (memory_object_data_provided): Remove function.
(memory_object_data_error): Simplify.
(memory_object_set_attributes_common): Make static, remove unused
parameters, simplify.
(memory_object_change_attributes): Update callsite.
(memory_object_set_attributes): Remove function.
(memory_object_ready): Update callsite.
* vm/vm_debug.c (mach_vm_object_info): Adapt to the changes.
* vm/vm_object.c (vm_object_bootstrap): Likewise.
* vm/vm_object.h (struct vm_object): Drop flag 'use_old_pageout'.
* vm/vm_pageout.c: Update comments.
(vm_pageout_page): Simplify.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Makefrag.am (libkernel_a_SOURCES): Add kern/gsync.c and kern/gsync.h.
* include/mach/gnumach.defs (gsync_wait, gsync_wake, gsync_requeue): New
routines.
* include/mach/kern_return.h (KERN_TIMEDOUT, KERN_INTERRUPTED): New error
codes.
* kern/gsync.c: New file.
* kern/gsync.h: New file.
* kern/startup.c: Include <kern/gsync.h>
(setup_main): Call gsync_setup.
|
|
|
|
|
| |
* include/mach/std_types.h: Do not include stdint.h.
* kern/rdxtree.h: Replace sys/types.h with stdint.h.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implement stdint.h and use it in gnumach.
Remove old type definitions such as signed* and unsigned*.
* Makefile.am: Add -ffreestanding.
* i386/i386/xen.h: Use uint64_t.
* i386/include/mach/i386/machine_types.defs: Use uint32_t and int32_t.
* i386/include/mach/i386/vm_types.h: Remove definitions of int*, uint*,
unsigned* and signed* types.
* i386/xen/xen.c: Use uint64_t.
* include/device/device_types.defs: Use uint32_t.
* include/mach/std_types.defs: Use POSIX types.
* include/mach/std_types.h: Include stdint.h.
* include/stdint.h: New file with POSIX types.
* include/sys/types.h: Include stdint.h.
* ipc/ipc_kmsg.c: Use uint64_t.
* kern/exception.c: Use uint32_t.
* linux/dev/include/linux/types.h: Remove POSIX types.
* xen/block.c: Use uint64_t.
* xen/net.c: Do not use removed unsigned*_t types.
* xen/ring.h: Use uint32_t instead.
* xen/store.c: Use uint32_t.
* xen/store.h: Use uint32_t.
* xen/time.c: Use POSIX types only.
* xen/time.h: Use uint64_t.
|