summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
2019-03-25set ncpu as externAlmuHS
2019-03-24changed apic_id to unsignedAlmuHS
2019-03-04moved int ncpu to machine.hAlmuHS
2019-03-03added apic_id to machine_slotAlmuHS
2018-11-03Add vm_object_sync supportSamuel Thibault
* 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.
2018-11-03Fix typoSamuel Thibault
2018-03-03Avoid old typeSamuel Thibault
* include/device/bpf.h: Do not include <sys/types.h> (struct bpf_version): Use unsigned short type instead of u_short.
2018-01-28Add const MIG typesSamuel Thibault
* 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.
2016-12-24VM: add the vm_wire_all callRichard Braun
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.
2016-11-01include: Fix new task notifications.Justus Winter
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.
2016-10-13Make task notification ports mutable.Justus Winter
* include/mach/task_notify.defs (task_notify_port_t): New type. (mach_notify_new_task): Use the specialized type.
2016-10-03Remove deprecated external memory management interface.Justus Winter
* 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.
2016-04-15Lightweight synchronization mechanismAgustina Arzille
* 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.
2016-04-05Fix bootstraping issues with stdint.h.Flavio Cruz
* include/mach/std_types.h: Do not include stdint.h. * kern/rdxtree.h: Replace sys/types.h with stdint.h.
2016-04-04Use uint32_t instead of unsigned32_t.Flavio Cruz
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.
2016-02-26include: avoid generating unused client stubsJustus Winter
* include/mach/mach.defs: Avoid generating unused client stubs, some of which use an unreasonable amount of stack space and showed up in compiler warnings.
2016-02-22Remove kmem cache flags from the debugging interfaceRichard Braun
* include/mach_debug/slab_info.h (CACHE_FLAGS_NO_CPU_POOL, CACHE_FLAGS_SLAB_EXTERNAL, CACHE_FLAGS_NO_RECLAIM, CACHE_FLAGS_VERIFY, CACHE_FLAGS_DIRECT): Remove macros. * kern/slab.c (host_slab_info): Pass raw cache flags to caller.
2015-09-19Add macros to convert between time_value_t and timespecFlávio Cruz
* include/mach/time_value.h (TIME_VALUE_TO_TIMESPEC, TIMESPEC_TO_TIME_VALUE): New macros
2015-09-07kern: use proper memory fences when handling the mapped timeJustus Winter
* include/mach/time_value.h (struct mapped_time_value): Adjust comment. * kern/mach_clock.c (mtime): Likewise. Also make it volatile. (update_mapped_time): Use full hardware barriers. (read_mapped_time): New macro with proper fences. (record_time_stamp, host_get_time): Use the new macro.
2015-07-25include: provide time-value substractionJustus Winter
* include/mach/time_value.h (time_value_assert): New macro to assert that the given value is well-formed. (time_value_add_usec): Use the new macro. (time_value_sub_usec): New macro. (time_value_add): Use `time_value_add_usec'. (time_value_sub_usec): New macro.
2015-07-09Allow non-privileged tasks to wire 64KiB task memorySamuel Thibault
* doc/mach.texi (vm_wire): Document that the host port does not have to be privileged. * include/mach/mach_hosts.defs (vm_wire): Use mach_port_t instead of host_priv_t. * vm/vm_map.h (vm_map): Add user_wired field. * vm/vm_map.c (vm_map_setup): Initialize user_wired field to 0. (vm_map_pageable_common, vm_map_entry_delete, vm_map_copy_overwrite, vm_map_copyout_page_list, vm_map_copyin_page_list): When switching user_wired_count field of entry between 0 and non-0, accumulate the corresponding size into the user_wired field of map. * vm/vm_user.c (vm_wire): Turn host parameter into port parameter, and inline a version of convert_port_to_host_priv which records whether the host port is privileged or not. When it is not privileged, check whether the additional amount to user_wired will overcome 64KiB.
2015-05-20ipc: replace the IPC table with a radix treeJustus Winter
Currently, the port names are mapped to an IPC object (e.g. a port) using a table. This, however, requires large chunks of continuous memory, and leads to scalability problems as virtual kernel memory is a scarce resource. To avoid excessive overhead, non-contiguous port names are spilled into a splay tree. Replace the IPC table with a radix tree. As the radix tree is able to store non-contiguous names with reasonable overhead, we can drop the splay tree as well. * ipc/ipc_entry.c (ipc_entry_tree_collision): Remove function. (ipc_entry_cache): New variable. (ipc_entry_lookup): Replace with a radix tree lookup. (ipc_entry_get): The free list handling is changed a little. Adopt accordingly. (ipc_entry_free_name): New function. (ipc_entry_alloc): Adopt accordingly. (ipc_entry_alloc_name): Likewise. (ipc_entry_dealloc): Likewise. (ipc_entry_grow_table): Remove function. * ipc/ipc_entry.h (struct ipc_entry): Update comment, add field for name and free list, remove unused fields. (ipc_entry_cache, ie_alloc, ie_free): New declarations. (struct ipc_tree_entry): Remove. Also remove any related declarations. (ipc_entry_grow_table): Remove declaration. * ipc/ipc_init.c (ipc_bootstrap): Adopt initialization. * ipc/ipc_kmsg.c (ipc_kmsg_copyout_header): Use `ipc_entry_alloc' instead of re-coding it. Adopt free list handling. (ipc_kmsg_copyout_object): Adopt free list handling, store the name. * ipc/ipc_object.c (ipc_object_copyout): Likewise. (ipc_object_copyout_multiname): Likewise. * ipc/ipc_space.c (ipc_space_create): Initialize radix tree and free list. Drop table and splay tree initialization. (ipc_space_destroy): Free ipc entries and radix tree, remove table and splay tree cleanup. * ipc/ipc_space.h (struct ipc_space): Add radix tree, free list, and size. Remove all fields related to the table and splay tree. * ddb/db_print.c (db_port_iterate): Adopt iteration. (db_lookup_port): Adopt lookup. * include/mach_debug/ipc_info.h: Remove unused parts of the debug interface. * include/mach_debug/mach_debug.defs: Likewise. * include/mach_debug/mach_debug_types.defs: Likewise. * ipc/mach_debug.c: Likewise. * ipc/ipc_right.c (ipc_right_reverse): Adopt lookup, store name. (ipc_right_check): Adopt removal. (ipc_right_destroy): Likewise. (ipc_right_dealloc): Likewise. (ipc_right_delta): Likewise. (ipc_right_copyin): Adopt insertion, adopt removal. (ipc_right_copyin_two): Adopt removal. (ipc_right_copyout): Adopt insertion, adopt removal. (ipc_right_rename): Likewise, also update comment. * ipc/mach_port.c (mach_port_names): Adopt iteration. (mach_port_get_set_status): Likewise. * ipc/port.h: Update comment. * ipc/ipc_hash.c: Delete file. * ipc/ipc_hash.h: Likewise. * ipc/ipc_splay.c: Likewise. * ipc/ipc_splay.h: Likewise. * Makefrag.am (libkernel_a_SOURCES): Remove these files.
2015-01-02include: Fix typos in comments (found by codespell)Stefan Weil
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2014-12-09include: add X_IMPORTS to ipc definitionsJustus Winter
This makes it possible to inject imports. * include/mach/gnumach.defs: Make it possible to inject imports. * include/mach/mach.defs: Likewise. * include/mach/mach_host.defs: Likewise.
2014-12-09kern: provide notifications about new tasksJustus Winter
These notifications are sent to the port registered via `register_new_task_notification' and provide a robust parental relation between tasks to a userspace server. * Makefrag.am: Add task_notify.defs. * include/mach/gnumach.defs: Add register_new_task_notification. * include/mach/task_notify.defs: New file. * kern/task.c (new_task_notification): New variable. (task_create): Send new task notifications. (register_new_task_notification): Add server function. * kern/task_notify.cli: New file.
2014-12-09Retire procedure `old_mach_port_get_receive_status'Justus Winter
Retire the compatibility RPC `old_mach_port_get_receive_status' that works like `mach_port_get_receive_status' but returns an `old_mach_port_status' object that lacks the `mps_seqno' field. Do not remove the type yet, so we do not break anyones build. The RPC stubs currently distributed with the glibc require it. * include/mach/mach_port.defs (old_mach_port_get_receive_status): Drop RPC. * include/mach/mach_types.defs (old_mach_port_status_t): Drop type. * include/mach/port.h (old_mach_port_status_t): Add note to remove this for the 1.6 release. * ipc/mach_port.c (old_mach_port_get_receive_status): Drop function.
2014-11-28include: make `mach_port_t' payload-awareJustus Winter
Honor a new macro `MACH_PAYLOAD_TO_PORT' to inject a translation function mapping payloads to port names in the definition of `mach_port_t'. * include/mach/std_types.defs (mach_port_t): Honor `MACH_PAYLOAD_TO_PORT'. * include/device/device.defs (reply_port_t): Likewise. * include/device/device_reply.defs (reply_port_t): Likewise. * include/device/device_request.defs (reply_port_t): Likewise.
2014-11-03include: add a payload-aware intran mutator for device_tJustus Winter
* include/device/device_types.defs (device_t): Add a payload-aware intran mutator.
2014-11-03include: add a payload-aware intran mutator for notify_port_tJustus Winter
* include/mach/notify.defs (notify_port_t): Add a payload-aware intran mutator.
2014-11-03include: add a payload-aware intran mutator for memory_object_tJustus Winter
* include/mach/mach_types.defs (memory_object_t): Add a payload-aware intran mutator. * include/mach/memory_object.defs: Likewise in the inlined type declarations.
2014-10-01include: define MACH_MSG_TYPE_PROTECTED_PAYLOADJustus Winter
* include/mach/message.h: Define MACH_MSG_TYPE_PROTECTED_PAYLOAD. (MACH_MSG_TYPE_LAST): Adjust accordingly. * doc/mach.texi (Message Format): Document MACH_MSG_TYPE_PROTECTED_PAYLOAD.
2014-10-01include: add msgh_protected_payload to mach_msg_header_tJustus Winter
* include/mach/message.h (mach_msg_header_t): Add msgh_protected_payload as a union with msgh_local_port. * doc/mach.texi (Message Format): Document msgh_protected_payload.
2014-10-01ipc: implement mach_port_{set,clear}_protected_payloadJustus Winter
* include/mach/mach_port.defs: Add mach_port_{set,clear}_protected_payload. * ipc/mach_port.c: Implement mach_port_{set,clear}_protected_payload. * doc/mach.texi (Receive Rights): Document mach_port_{set,clear}_protected_payload.
2014-05-25Rewrite old-style #endif FOO directivesJustus Winter
* i386/include/mach/i386/cthreads.h: Rewrite old-style #endif FOO directives. * include/device/tape_status.h: Likewise. * include/mach/alert.h: Likewise. * include/mach/boot.h: Likewise. * include/mach/default_pager_types.defs: Likewise. * include/mach/default_pager_types.h: Likewise. * include/mach/multiboot.h: Likewise. * include/mach/notify.defs: Likewise. * include/mach_debug/pc_info.h: Likewise. * kern/act.h: Likewise. * kern/refcount.h: Likewise. * kern/shuttle.h: Likewise.
2014-05-25include: fix the embedded type definitions in memory_object.defsJustus Winter
In order to use MIG translation functions to lookup memory objects, preprocessor macros have been introduced into the definition of memory_object_t in 50cc5152. The procedure definitions contain inlined type definitions in order to change the type of the argument in question (i.e. to make it polymorphic). The inline definitions however lack the destructor function, leading to reference leaks when a reference is acquired in the intran function. * include/mach/memory_object.defs: Add the destructor functions to the inlined type definitions.
2014-04-30include: do not guard the host_slab_info RPC with MACH_VM_DEBUGJustus Winter
Previously, the definition of the host_slab_info RPC was guarded with MACH_VM_DEBUG, even though it is not at all concerned with the VM subsystem. Furthermore, there was no "skip" directive for host_slab_info. The function host_slab_info is guarded with MACH_DEBUG. The server for the RPCs in mach_debug.defs is only used if MACH_DEBUG is defined. There is no need to guard host_slab_info. * include/mach_debug/mach_debug.defs (host_slab_info): Unconditionally include the RPC.
2014-04-10include: fix the definition of device_openJustus Winter
Previously, every userspace server implementing the device protocol filtered the device definitions to replace the device_t type with mach_port_send_t to make the device argument of device_open polymorphic. Rather than doing that, which makes it impossible to use translation functions, fix the definition of device_open. * include/device/device.defs (device_open): Redefine the device argument to make it polymorphic unless a outran function is specified.
2014-04-08include: make the device_t types translation functions mutableJustus Winter
Make the intran, outtran and destructor functions mutable using preprocessor macros. Make it possible to inject imports using the DEVICE_IMPORTS macro. This way, userspace servers can provide their own translation functions. * include/device/device_types.defs: Honor DEVICE_IMPORTS. (device_t): Make the translation mutable using preprocessor macros.
2014-04-05include: make the notify_port_t types translation functions mutableJustus Winter
Make the intran, outtran and destructor functions mutable using preprocessor macros. Make it possible to inject imports using the NOTIFY_IMPORTS macro. This way, userspace servers can provide their own translation functions. * include/mach/notify.defs: Honor NOTIFY_IMPORTS. (notify_port_t): Make the translation mutable using preprocessor macros.
2014-03-25include: make the memory_object_t types translation functions mutableJustus Winter
Make the intran, outtran and destructor functions mutable using preprocessor macros. Make it possible to inject imports using the MEMORY_OBJECT_IMPORTS macro. This way, userspace servers can provide their own translation functions. * include/mach/mach_types.defs (memory_object_t): Make the translation mutable using preprocessor macros. * include/mach/memory_object.defs: Likewise for the inlined type declarations. Honor MEMORY_OBJECT_IMPORTS. * include/mach/memory_object_default.defs: Likewise.
2014-02-19include: skip routines related to migrating threadsJustus Winter
* include/mach/mach_port.defs: Skip the routines mach_port_set_rpcinfo and mach_port_create_act if MIGRATING_THREADS is not defined.
2014-02-05include: add task_set_nameJustus Winter
task_set_name sets the name of a task. This is a debugging aid. The name will be used in error messages printed by the kernel. * include/mach/gnumach.defs (task_set_name): New procedure.
2014-02-01include: add a fixed-size string type for debugging purposesJustus Winter
* include/mach/debug.defs: New file. * include/mach/debug.h: Likewise.
2014-01-09include: add new file for cache-related definitionsJustus Winter
* include/cache.h (__cacheline_aligned): This macro can be used to align statically allocated objects so that they start at a cache line.
2013-12-20Mark pure functions with attribute pureMarin Ramesa
2013-12-08Fix implicit declaration of functionSamuel Thibault
Thanks Marin Ramesa for the report. * device/ds_routines.h (device_deallocate): Move declaration to... * include/device/device_types.h (device_deallocate): ... here.
2013-12-05Remove unnecessary fileSamuel Thibault
* i386/Makefrag.am: Don't include i386/include/mach/i386/rpc.h. * i386/include/mach/i386/rpc.h: Remove file.
2013-11-24New RPC for thread destructionRichard Braun
A new call, thread_terminate_release, is added to support self destruction in threading libraries. * include/mach/gnumach.defs (thread_terminate_release): New simpleroutine declaration. * kern/thread.c: Include vm/vm_user.h and ipc/mach_port.h. (thread_terminate_release): New function. * kern/thread.h (thread_terminate_release): New prototype.
2013-11-18Add ifndefsMarin Ramesa
Finish up with the addition of ifndefs. * device/buf.h: Add ifndef. * device/dev_master.h: Likewise. * include/device/tty_status.h: Likewise. * include/mach/version.h: Likewise. * ipc/ipc_machdep.h: Likewise.
2013-01-28Add initial code for disabling PV pagetablesSamuel Thibault
* xen/configfrag.ac (--disable-pv-pagetables): Add option. * i386/xen/xen_boothdr.S (XEN_ELFNOTE_FEATURES) [!MACH_PV_PAGETABLES]: Add writable_page_tables. * i386/i386/gdt.c: Turn appropriate MACH_XEN/MACH_HYP tests into MACH_PV_PAGETABLES tests. * i386/i386/i386asm.sym: Likewise * i386/i386/ldt.c: Likewise * i386/i386/locore.S: Likewise * i386/i386/proc_reg.h: Likewise * i386/i386/user_ldt.c: Likewise * i386/i386/vm_param.h: Likewise * i386/i386/xen.h: Likewise * i386/i386at/model_dep.c: Likewise * i386/intel/pmap.h: Likewise * include/mach/xen.h: Likewise * xen/console.c: Likewise * xen/store.c: Likewise * i386/intel/pmap.c: Likewise. Define pmap_map_mfn as TODO stub.