| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
| |
stack_statistics, swapin_thread_continue, and memory_object_lock_page are
not used outside their module.
|
|
|
|
|
|
|
| |
* 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>
|
|
|
|
|
|
|
| |
* kern/syscall_sw.h: add missing include
Signed-off-by: Luca Dariz <luca@orpolo.org>
Message-Id: <20230116130426.246584-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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Message-Id: <Y7GBIF6mBjV6kBM+@falom>
|
|
|
|
| |
Message-Id: <Y6r72z4cKVCMDSKy@mars>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
These are not used.
Message-Id: <Y5V95ibk9Z+3OJxN@jupiter.tail36e24.ts.net>
|
|
|
|
|
| |
Make it clear where exactly we use port names vs port addresses.
Message-Id: <Y5AdJGuzXBMO7YRK@reue>
|
|
|
|
|
|
| |
RPC interfaces already use long_natural_t so internally we can also use
this type.
Message-Id: <Y5AdPNqg4l5jAZ3n@reue>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
We cannot assume that the processor is little-endian.
|
|
|
|
|
|
|
|
| |
* kern/bootstrap.c: use rpc_ vm types to put the bootstrap module
arguments on the stack, make it consistent with user-space types.
Signed-off-by: Luca Dariz <luca@orpolo.org>
Message-Id: <20220628101054.446126-4-luca@orpolo.org>
|
|
|
|
|
|
|
|
|
| |
* kern/printf.c: remove unnecessary #include and reorder
This allows the file to be reused for minimal user-space tests.
Signed-off-by: Luca Dariz <luca@orpolo.org>
Message-Id: <20220628101054.446126-14-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>
|
|
|
|
|
| |
Signed-off-by: Luca Dariz <luca@orpolo.org>
Message-Id: <20220628101054.446126-13-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>
|
|
|
|
| |
Message-Id: <Yo+lzS7RtW5ZjQHN@debian>
|
|
|
|
|
| |
We do not want to destroy the port and release the stack if thread is
NULL, i.e. we will fail.
|
|
|
|
|
| |
This follows mig's cf4bcc3f1435 ("Also add const qualifiers on server
side")
|
|
|
|
|
| |
881fe9da8bd1 ("kern/thread.c: some minor style changes") introduced a
spurious comment.
|
|
|
|
|
|
|
| |
Greeting, I have changed some stuff in kern/thread.c which makes code
more readable for me. Maybe it will be usefull.
Message-Id: <20211230082643.8171-1-sys.arch.adam@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
vm_page_grab was systematically using the VM_PAGE_SEL_DIRECTMAP selector
to play safe with existing code.
This adds a flags parameter to let callers of vm_page_grab specify their
constraints.
Linux drivers need 32bit dmas, Xen drivers use kvtophys to clear some
data. Callers of kmem_pagealloc_physmem and vm_page_grab_phys_addr also use
kvtophys. Otherwise allocations can go to highmem.
This fixes the allocation jam in the directmap segment.
* vm/vm_page.h (VM_PAGE_DMA, VM_PAGE_DMA32, VM_PAGE_DIRECTMAP,
VM_PAGE_HIGHMEM): New macros.
(vm_page_grab): Add flags parameter.
* vm/vm_resident.c (vm_page_grab): Choose allocation selector according
to flags parameter.
(vm_page_convert, vm_page_alloc): Pass VM_PAGE_HIGHMEM to vm_page_grab.
(vm_page_grab_phys_addr): Pass VM_PAGE_DIRECTMAP to vm_page_grab.
* vm/vm_fault.c (vm_fault_page): Pass VM_PAGE_HIGHMEM to vm_page_grab.
* vm/vm_map.c (vm_map_copy_steal_pages): Pass VM_PAGE_HIGHMEM to vm_page_grab.
* kern/slab.c (kmem_pagealloc_physmem): Pass VM_PAGE_DIRECTMAP to vm_page_grab.
* i386/intel/pmap.c (pmap_page_table_page_alloc): Pass VM_PAGE_DIRECTMAP to
vm_page_grab.
* xen/block.c (device_read): Pass VM_PAGE_DIRECTMAP to vm_page_grab.
* linux/dev/glue/block.c (alloc_buffer): Pass VM_PAGE_DMA32 to vm_page_grab.
|
| |
|
|
|
|
|
| |
* kern/thread.c (thread_info): Set last_processor to 0 when the thread
never ran.
|
|
|
|
|
|
|
| |
thread->last_processor is a processor_t, not a slot number.
* kern/thread.c (thread_info): Set sched_info->last_processor to
thread->last_processor->slot_num rather than thread->last_processor.
|
| |
|
|
|
|
| |
Message-Id: <20210326094850.2606-4-damien@zamaudio.com>
|
|
|
|
|
|
|
| |
It seems that ld.so sometimes gets into troubles and hangs at bootstrap.
* kern/elf-load.c (exec_load): When x.e_type == ET_DYN || x.e_type ==
ET_REL, add 128MiB as loadbase.
|
|
|
|
|
| |
* kern/bootstrap.c (STACK_SIZE): Set to 128KB. glibc's
__MAX_ALLOCA_CUTOFF is 64K by default.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* configfrag.ac (--enable-ncpus): Add option to set $mach_ncpus.
* i386/i386/cpu_number.h (CPU_NUMBER, cpu_number): New macros, set to 0 for
now.
* i386/i386/db_interface.c (cpu_interrupt_to_db): New function.
* i386/i386/db_interface.h (cpu_interrupt_to_db): New declaration.
* i386/i386/mp_desc.c (int_stack_base): New array.
(intel_startCPU): New function.
* i386/i386at/model_dep.c: Include <i386/smp.h>
(int_stack_top, int_stack_base): Turn into arrays
(i386at_init): Update accesses accordingly.
* i386/i386at/model_dep.h (int_stack_top, int_stack_base, ON_INT_STACK):
Likewise.
* i386/intel/pmap.c (cpus_active, cpus_idle, cpu_update_needed): Add
variables.
* i386/intel/pmap.h (cpus_active, cpus_idle, cpu_update_needed): Mark
extern.
* kern/cpu_number.h: Include <machine/cpu_number.h>
* linux/dev/arch/i386/kernel/irq.c (local_bh_count, local_irq_count):
Hardcode to the address of intr_count. We will not use the Linux code in
SMP mode anyway.
|
|
|
|
|
|
|
|
|
|
| |
This pseudoclass generalize the initialization and access of SMP data,
allowing expands it to other architectures. In x86, the functions calls to apic functions.
*kern/smp.c: Source file. Implements a interface to load the SMP functions for the current architecture.
*kern/smp.h: Header file. Add declaration for smp_data structure.
*i386/i386/smp.c: Source file. Implements a set of functions to manage the SMP actions in i386
*i386/i386/smp.h: Header file. Add declarations for SMP functions in i386.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 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.
|
|
|
|
|
|
|
| |
The addition of the mach_trap_name field made the 64bit unused field
spurious.
* kern/syscall_sw.h (mach_trap_t): Remove `unused' field.
|
|
|
|
|
|
|
|
|
| |
When giving the port to a bootstrap task to another bootstrap task, we
need to add a reference. This shows up on error-cleanup (e.g. when
forgetting to define the root).
* kern/bootstrap.c (boot_script_insert_task_port): Call
ipc_port_make_send on `task''s itk_sself.
|