From cf5bf5a38df413b8a4cd8adad281f386b3bede5d Mon Sep 17 00:00:00 2001 From: Lubos Dolezel Date: Thu, 13 Apr 2017 11:18:13 +0200 Subject: [PATCH] Cleanup in src/kernel/mach --- src/kernel/CMakeLists.txt | 1 - src/kernel/emulation/linux/CMakeLists.txt | 2 +- .../emulation/linux/bsdthread/pthread_kill.c | 2 +- .../linux/mach}/CMakeLists.txt | 0 .../linux/mach}/darling_mach_syscall.S | 0 .../client => emulation/linux/mach}/lkm.c | 0 .../client => emulation/linux/mach}/lkm.h | 0 .../linux/mach}/mach-syscall.S | 0 .../linux/mach}/mach_table.c | 0 .../linux/mach}/mach_time.c | 0 .../linux/mach}/mach_time.h | 0 .../linux/mach}/mach_traps.c | 0 .../linux/mach}/mach_traps.h | 0 src/kernel/emulation/linux/process/fork.c | 3 - .../emulation/linux/psynch/psynch_cvbroad.c | 2 +- .../emulation/linux/psynch/psynch_cvsignal.c | 2 +- .../emulation/linux/psynch/psynch_cvwait.c | 2 +- .../emulation/linux/psynch/psynch_mutexdrop.c | 2 +- .../emulation/linux/psynch/psynch_mutexwait.c | 2 +- .../emulation/linux/psynch/ulock_wait.c | 1 + src/kernel/libsyscall/CMakeLists.txt | 1 + src/kernel/mach/audit_triggers.defs | 49 -- src/kernel/mach/clock.defs | 81 --- src/kernel/mach/clock_priv.defs | 69 -- src/kernel/mach/clock_reply.defs | 56 -- src/kernel/mach/clock_types.defs | 73 --- src/kernel/mach/coalition_notification.defs | 22 - src/kernel/mach/exc.defs | 119 ---- src/kernel/mach/host_notify_reply.defs | 40 -- src/kernel/mach/host_priv.defs | 369 ----------- src/kernel/mach/host_security.defs | 101 --- src/kernel/mach/ledger.defs | 48 -- src/kernel/mach/lock_set.defs | 83 --- src/kernel/mach/mach_exc.defs | 119 ---- src/kernel/mach/mach_host.defs | 303 --------- src/kernel/mach/mach_notify.defs | 38 -- src/kernel/mach/mach_port.defs | 614 ------------------ src/kernel/mach/mach_types.defs | 598 ----------------- src/kernel/mach/mach_vm.defs | 528 --------------- src/kernel/mach/mach_voucher.defs | 69 -- .../mach/mach_voucher_attr_control.defs | 48 -- src/kernel/mach/memory_object.defs | 206 ------ src/kernel/mach/memory_object_control.defs | 195 ------ src/kernel/mach/memory_object_default.defs | 94 --- src/kernel/mach/notify.defs | 134 ---- src/kernel/mach/processor.defs | 128 ---- src/kernel/mach/processor_set.defs | 161 ----- src/kernel/mach/prof.defs | 135 ---- src/kernel/mach/semaphore.defs | 83 --- src/kernel/mach/std_types.defs | 150 ----- src/kernel/mach/sync.defs | 145 ----- src/kernel/mach/task.defs | 454 ------------- src/kernel/mach/task_access.defs | 59 -- src/kernel/mach/telemetry_notification.defs | 20 - src/kernel/mach/thread_act.defs | 353 ---------- src/kernel/mach/upl.defs | 100 --- src/kernel/mach/vm32_map.defs | 284 -------- src/kernel/mach/vm_map.defs | 498 -------------- src/launchd/src/mach_exc.defs | 2 +- src/launchd/src/notify.defs | 2 +- 60 files changed, 11 insertions(+), 6639 deletions(-) rename src/kernel/{mach_server/client => emulation/linux/mach}/CMakeLists.txt (100%) rename src/kernel/{mach_server/client => emulation/linux/mach}/darling_mach_syscall.S (100%) rename src/kernel/{mach_server/client => emulation/linux/mach}/lkm.c (100%) rename src/kernel/{mach_server/client => emulation/linux/mach}/lkm.h (100%) rename src/kernel/{mach_server/client => emulation/linux/mach}/mach-syscall.S (100%) rename src/kernel/{mach_server/client => emulation/linux/mach}/mach_table.c (100%) rename src/kernel/{mach_server/client => emulation/linux/mach}/mach_time.c (100%) rename src/kernel/{mach_server/client => emulation/linux/mach}/mach_time.h (100%) rename src/kernel/{mach_server/client => emulation/linux/mach}/mach_traps.c (100%) rename src/kernel/{mach_server/client => emulation/linux/mach}/mach_traps.h (100%) delete mode 100644 src/kernel/mach/audit_triggers.defs delete mode 100644 src/kernel/mach/clock.defs delete mode 100644 src/kernel/mach/clock_priv.defs delete mode 100644 src/kernel/mach/clock_reply.defs delete mode 100644 src/kernel/mach/clock_types.defs delete mode 100644 src/kernel/mach/coalition_notification.defs delete mode 100644 src/kernel/mach/exc.defs delete mode 100644 src/kernel/mach/host_notify_reply.defs delete mode 100644 src/kernel/mach/host_priv.defs delete mode 100644 src/kernel/mach/host_security.defs delete mode 100644 src/kernel/mach/ledger.defs delete mode 100644 src/kernel/mach/lock_set.defs delete mode 100644 src/kernel/mach/mach_exc.defs delete mode 100644 src/kernel/mach/mach_host.defs delete mode 100644 src/kernel/mach/mach_notify.defs delete mode 100644 src/kernel/mach/mach_port.defs delete mode 100644 src/kernel/mach/mach_types.defs delete mode 100644 src/kernel/mach/mach_vm.defs delete mode 100644 src/kernel/mach/mach_voucher.defs delete mode 100644 src/kernel/mach/mach_voucher_attr_control.defs delete mode 100644 src/kernel/mach/memory_object.defs delete mode 100644 src/kernel/mach/memory_object_control.defs delete mode 100644 src/kernel/mach/memory_object_default.defs delete mode 100644 src/kernel/mach/notify.defs delete mode 100644 src/kernel/mach/processor.defs delete mode 100644 src/kernel/mach/processor_set.defs delete mode 100644 src/kernel/mach/prof.defs delete mode 100644 src/kernel/mach/semaphore.defs delete mode 100644 src/kernel/mach/std_types.defs delete mode 100644 src/kernel/mach/sync.defs delete mode 100644 src/kernel/mach/task.defs delete mode 100644 src/kernel/mach/task_access.defs delete mode 100644 src/kernel/mach/telemetry_notification.defs delete mode 100644 src/kernel/mach/thread_act.defs delete mode 100644 src/kernel/mach/upl.defs delete mode 100644 src/kernel/mach/vm32_map.defs delete mode 100644 src/kernel/mach/vm_map.defs diff --git a/src/kernel/CMakeLists.txt b/src/kernel/CMakeLists.txt index f7b63b425..3a8ef8dbc 100644 --- a/src/kernel/CMakeLists.txt +++ b/src/kernel/CMakeLists.txt @@ -36,7 +36,6 @@ add_definitions(-DHAVE_STDINT_H=1) add_definitions(-D__APPLE__ -D__DYNAMIC__ -DPRIVATE=1) add_subdirectory(libsyscall) -add_subdirectory(mach_server/client) set(DYLIB_INSTALL_NAME "/usr/lib/system/libsystem_kernel.dylib") add_circular(system_kernel FAT diff --git a/src/kernel/emulation/linux/CMakeLists.txt b/src/kernel/emulation/linux/CMakeLists.txt index e5a30d60a..518ef1aae 100644 --- a/src/kernel/emulation/linux/CMakeLists.txt +++ b/src/kernel/emulation/linux/CMakeLists.txt @@ -1,6 +1,6 @@ project(emulation) -cmake_minimum_required(VERSION 2.4.0) +add_subdirectory(mach) cmake_policy(SET CMP0005 NEW) enable_language(ASM) diff --git a/src/kernel/emulation/linux/bsdthread/pthread_kill.c b/src/kernel/emulation/linux/bsdthread/pthread_kill.c index a5cac5a8b..6a173c4b2 100644 --- a/src/kernel/emulation/linux/bsdthread/pthread_kill.c +++ b/src/kernel/emulation/linux/bsdthread/pthread_kill.c @@ -4,7 +4,7 @@ #include "../signal/duct_signals.h" #include "../../../../../platform-include/sys/errno.h" #include -#include "../../../mach_server/client/lkm.h" +#include "../mach/lkm.h" #include "../../../../lkm/api.h" #include "../simple.h" diff --git a/src/kernel/mach_server/client/CMakeLists.txt b/src/kernel/emulation/linux/mach/CMakeLists.txt similarity index 100% rename from src/kernel/mach_server/client/CMakeLists.txt rename to src/kernel/emulation/linux/mach/CMakeLists.txt diff --git a/src/kernel/mach_server/client/darling_mach_syscall.S b/src/kernel/emulation/linux/mach/darling_mach_syscall.S similarity index 100% rename from src/kernel/mach_server/client/darling_mach_syscall.S rename to src/kernel/emulation/linux/mach/darling_mach_syscall.S diff --git a/src/kernel/mach_server/client/lkm.c b/src/kernel/emulation/linux/mach/lkm.c similarity index 100% rename from src/kernel/mach_server/client/lkm.c rename to src/kernel/emulation/linux/mach/lkm.c diff --git a/src/kernel/mach_server/client/lkm.h b/src/kernel/emulation/linux/mach/lkm.h similarity index 100% rename from src/kernel/mach_server/client/lkm.h rename to src/kernel/emulation/linux/mach/lkm.h diff --git a/src/kernel/mach_server/client/mach-syscall.S b/src/kernel/emulation/linux/mach/mach-syscall.S similarity index 100% rename from src/kernel/mach_server/client/mach-syscall.S rename to src/kernel/emulation/linux/mach/mach-syscall.S diff --git a/src/kernel/mach_server/client/mach_table.c b/src/kernel/emulation/linux/mach/mach_table.c similarity index 100% rename from src/kernel/mach_server/client/mach_table.c rename to src/kernel/emulation/linux/mach/mach_table.c diff --git a/src/kernel/mach_server/client/mach_time.c b/src/kernel/emulation/linux/mach/mach_time.c similarity index 100% rename from src/kernel/mach_server/client/mach_time.c rename to src/kernel/emulation/linux/mach/mach_time.c diff --git a/src/kernel/mach_server/client/mach_time.h b/src/kernel/emulation/linux/mach/mach_time.h similarity index 100% rename from src/kernel/mach_server/client/mach_time.h rename to src/kernel/emulation/linux/mach/mach_time.h diff --git a/src/kernel/mach_server/client/mach_traps.c b/src/kernel/emulation/linux/mach/mach_traps.c similarity index 100% rename from src/kernel/mach_server/client/mach_traps.c rename to src/kernel/emulation/linux/mach/mach_traps.c diff --git a/src/kernel/mach_server/client/mach_traps.h b/src/kernel/emulation/linux/mach/mach_traps.h similarity index 100% rename from src/kernel/mach_server/client/mach_traps.h rename to src/kernel/emulation/linux/mach/mach_traps.h diff --git a/src/kernel/emulation/linux/process/fork.c b/src/kernel/emulation/linux/process/fork.c index 2120f7a30..5a07cbf0f 100644 --- a/src/kernel/emulation/linux/process/fork.c +++ b/src/kernel/emulation/linux/process/fork.c @@ -2,7 +2,6 @@ #include "../base.h" #include "../errno.h" #include "../signal/duct_signals.h" -#include "../../../mach_server/client/lkm.h" #include long sys_fork(void) @@ -16,8 +15,6 @@ long sys_fork(void) #endif if (ret < 0) ret = errno_linux_to_bsd(ret); - //else if (ret == 0) - // mach_driver_init(); // re-open /dev/mach return ret; } diff --git a/src/kernel/emulation/linux/psynch/psynch_cvbroad.c b/src/kernel/emulation/linux/psynch/psynch_cvbroad.c index 07de67d81..ba6bf30dc 100644 --- a/src/kernel/emulation/linux/psynch/psynch_cvbroad.c +++ b/src/kernel/emulation/linux/psynch/psynch_cvbroad.c @@ -2,7 +2,7 @@ #include "../base.h" #include "../errno.h" #include -#include "../../../mach_server/client/lkm.h" +#include "../mach/lkm.h" #include "../../../../lkm/api.h" #include "../simple.h" diff --git a/src/kernel/emulation/linux/psynch/psynch_cvsignal.c b/src/kernel/emulation/linux/psynch/psynch_cvsignal.c index 94fe19d1a..bc5e4991e 100644 --- a/src/kernel/emulation/linux/psynch/psynch_cvsignal.c +++ b/src/kernel/emulation/linux/psynch/psynch_cvsignal.c @@ -2,7 +2,7 @@ #include "../base.h" #include "../errno.h" #include -#include "../../../mach_server/client/lkm.h" +#include "../mach/lkm.h" #include "../../../../lkm/api.h" #include "../simple.h" diff --git a/src/kernel/emulation/linux/psynch/psynch_cvwait.c b/src/kernel/emulation/linux/psynch/psynch_cvwait.c index 1bbe6f230..c8e3ccdc0 100644 --- a/src/kernel/emulation/linux/psynch/psynch_cvwait.c +++ b/src/kernel/emulation/linux/psynch/psynch_cvwait.c @@ -2,7 +2,7 @@ #include "../base.h" #include "../errno.h" #include -#include "../../../mach_server/client/lkm.h" +#include "../mach/lkm.h" #include "../../../../lkm/api.h" #include "../simple.h" diff --git a/src/kernel/emulation/linux/psynch/psynch_mutexdrop.c b/src/kernel/emulation/linux/psynch/psynch_mutexdrop.c index e1dd6d162..b940fc5f6 100644 --- a/src/kernel/emulation/linux/psynch/psynch_mutexdrop.c +++ b/src/kernel/emulation/linux/psynch/psynch_mutexdrop.c @@ -2,7 +2,7 @@ #include "../base.h" #include "../errno.h" #include -#include "../../../mach_server/client/lkm.h" +#include "../mach/lkm.h" #include "../../../../lkm/api.h" #include "../simple.h" diff --git a/src/kernel/emulation/linux/psynch/psynch_mutexwait.c b/src/kernel/emulation/linux/psynch/psynch_mutexwait.c index be42ff9bd..82a560355 100644 --- a/src/kernel/emulation/linux/psynch/psynch_mutexwait.c +++ b/src/kernel/emulation/linux/psynch/psynch_mutexwait.c @@ -2,7 +2,7 @@ #include "../base.h" #include "../errno.h" #include -#include "../../../mach_server/client/lkm.h" +#include "../mach/lkm.h" #include "../../../../lkm/api.h" #include "../simple.h" diff --git a/src/kernel/emulation/linux/psynch/ulock_wait.c b/src/kernel/emulation/linux/psynch/ulock_wait.c index d7c284d24..4864b433d 100644 --- a/src/kernel/emulation/linux/psynch/ulock_wait.c +++ b/src/kernel/emulation/linux/psynch/ulock_wait.c @@ -19,6 +19,7 @@ long sys_ulock_wait(uint32_t operation, void* addr, uint64_t value, uint32_t tim int ret, op; struct timespec ts; bool no_errno = operation & ULF_NO_ERRNO; + __simple_printf("sys_ulock_wait()\n"); if (timeout > 0) { diff --git a/src/kernel/libsyscall/CMakeLists.txt b/src/kernel/libsyscall/CMakeLists.txt index 78b95d04e..bb02d1d92 100644 --- a/src/kernel/libsyscall/CMakeLists.txt +++ b/src/kernel/libsyscall/CMakeLists.txt @@ -20,6 +20,7 @@ add_definitions(-DPRIVATE=1 -D__DARWIN_C_LEVEL=20150101) add_definitions('-D__XNU_PRIVATE_EXTERN=') #add_definitions(-DKERNEL) +include_directories(${CMAKE_SOURCE_DIR}/src/lkm/osfmk) set(MIG_USER_HEADER_SUFFIX "_internal.h") mig(mach/exc.defs) mig(mach/host_priv.defs) diff --git a/src/kernel/mach/audit_triggers.defs b/src/kernel/mach/audit_triggers.defs deleted file mode 100644 index 1d6e279b6..000000000 --- a/src/kernel/mach/audit_triggers.defs +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2004-2008, Apple Inc. All rights reserved. - * - * @APPLE_BSD_LICENSE_HEADER_START@ - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @APPLE_BSD_LICENSE_HEADER_END@ -*/ - -/* - * Interface definition for the audit logging facility. - */ - -subsystem -#if KERNEL_USER - KernelUser -#endif /* KERNEL_USER */ - audit_triggers 123; - -#include -#include - -simpleroutine audit_triggers( - audit_port : mach_port_t; - in flags : int); - diff --git a/src/kernel/mach/clock.defs b/src/kernel/mach/clock.defs deleted file mode 100644 index 440042c86..000000000 --- a/src/kernel/mach/clock.defs +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. The rights granted to you under the License - * may not be used to create, or enable the creation or redistribution of, - * unlawful or unlicensed copies of an Apple operating system, or to - * circumvent, violate, or enable the circumvention or violation of, any - * terms of an Apple operating system software license agreement. - * - * Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ - */ -/* - * @OSF_COPYRIGHT@ - */ -/* - * File: mach/clock.defs - * Purpose: Kernel clock subsystem definitions. This - * file defines the clock request interface. - */ - -subsystem -#if KERNEL_SERVER - KernelServer -#endif /* KERNEL_SERVER */ - clock 1000; - -#include -#include -#include - -/* - * References to clock objects are returned by: - * host_get_clock_service(host_t,...) - * host_get_clock_control(host_priv_t,...) - Priviledged subclass - */ - -/* - * Get the clock time. - * Available to all. - */ -routine clock_get_time( - clock_serv : clock_serv_t; - out cur_time : mach_timespec_t); - -/* - * Get clock attributes. - * Available to all. - */ -routine clock_get_attributes( - clock_serv : clock_serv_t; - in flavor : clock_flavor_t; - out clock_attr : clock_attr_t, CountInOut); - -/* - * Setup a clock alarm. - * Available to all. - */ -routine clock_alarm( - clock_serv : clock_serv_t; - alarm_type : alarm_type_t; - alarm_time : mach_timespec_t; - alarm_port : clock_reply_t = - MACH_MSG_TYPE_MAKE_SEND_ONCE|polymorphic); - -/* vim: set ft=c : */ diff --git a/src/kernel/mach/clock_priv.defs b/src/kernel/mach/clock_priv.defs deleted file mode 100644 index b3854a4ec..000000000 --- a/src/kernel/mach/clock_priv.defs +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. The rights granted to you under the License - * may not be used to create, or enable the creation or redistribution of, - * unlawful or unlicensed copies of an Apple operating system, or to - * circumvent, violate, or enable the circumvention or violation of, any - * terms of an Apple operating system software license agreement. - * - * Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ - */ -/* - * @OSF_COPYRIGHT@ - */ -/* - * File: mach/clock_priv.defs - * Purpose: Kernel clock subsystem definitions. This - * file defines the clock request interface. - */ - -subsystem -#if KERNEL_SERVER - KernelServer -#endif /* KERNEL_SERVER */ - clock_priv 1200; - -#include -#include -#include - -/* - * References to clock_priv objects are returned by: - * host_get_clock_control(host_priv_t,...) - Priviledged subclass - */ - -/* - * Set the clock time. - * Privileged. - */ -routine clock_set_time( - clock_ctrl : clock_ctrl_t; - new_time : mach_timespec_t); - -/* - * Set clock attributes. - * Privileged. - */ -routine clock_set_attributes( - clock_ctrl : clock_ctrl_t; - in flavor : clock_flavor_t; - in clock_attr : clock_attr_t); - -/* vim: set ft=c : */ diff --git a/src/kernel/mach/clock_reply.defs b/src/kernel/mach/clock_reply.defs deleted file mode 100644 index 9646f90da..000000000 --- a/src/kernel/mach/clock_reply.defs +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. The rights granted to you under the License - * may not be used to create, or enable the creation or redistribution of, - * unlawful or unlicensed copies of an Apple operating system, or to - * circumvent, violate, or enable the circumvention or violation of, any - * terms of an Apple operating system software license agreement. - * - * Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ - */ -/* - * @OSF_COPYRIGHT@ - */ -/* - * File: clock_reply.defs - * Purpose: Kernel clock subsystem definitions. This - * file defines the clock reply interface. - */ - -subsystem -#if KERNEL_USER - KernelUser -#endif /* KERNEL_USER */ - clock_reply 3125107; /* Matches up with old value */ - -#include -#include - - -/* - * Reply routine for clock_alarm. - */ -simpleroutine clock_alarm_reply( - alarm_port : clock_reply_t; - alarm_code : kern_return_t; - alarm_type : alarm_type_t; - alarm_time : mach_timespec_t); - -/* vim: set ft=c : */ diff --git a/src/kernel/mach/clock_types.defs b/src/kernel/mach/clock_types.defs deleted file mode 100644 index 4dbacfcf1..000000000 --- a/src/kernel/mach/clock_types.defs +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. The rights granted to you under the License - * may not be used to create, or enable the creation or redistribution of, - * unlawful or unlicensed copies of an Apple operating system, or to - * circumvent, violate, or enable the circumvention or violation of, any - * terms of an Apple operating system software license agreement. - * - * Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ - */ -/* - * @OSF_COPYRIGHT@ - */ -/* - * File: clock_types.defs - * Purpose: - * Clock kernel interface type declarations - */ - -#ifndef _MACH_CLOCK_TYPES_DEFS_ -#define _MACH_CLOCK_TYPES_DEFS_ - -#include - -type clock_serv_t = mach_port_t - cusertype: clock_serv_t -#if KERNEL_SERVER - intran: clock_serv_t convert_port_to_clock(mach_port_t) - outtran: mach_port_t convert_clock_to_port(clock_serv_t) -#endif /* KERNEL_SERVER */ - ; - -type clock_ctrl_t = mach_port_t - cusertype: clock_ctrl_t -#if KERNEL_SERVER - intran: clock_ctrl_t convert_port_to_clock_ctrl(mach_port_t) - outtran: mach_port_t convert_clock_ctrl_to_port(clock_ctrl_t) -#endif /* KERNEL_SERVER */ - ; - -type clock_reply_t = polymorphic|MACH_MSG_TYPE_MAKE_SEND_ONCE; - -type clock_flavor_t = int; -type clock_attr_t = array[*:1] of int; -type mach_timespec_t = struct[2] of int; -type time_t = int; -type sleep_type_t = int; -type alarm_type_t = int; -type clock_res_t = int; -type clock_id_t = int; - -import ; - -#endif /* _MACH_CLOCK_TYPES_DEFS_ */ - -/* vim: set ft=c : */ diff --git a/src/kernel/mach/coalition_notification.defs b/src/kernel/mach/coalition_notification.defs deleted file mode 100644 index b3392fc69..000000000 --- a/src/kernel/mach/coalition_notification.defs +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2013, Apple Inc. All rights reserved. - */ - - /* - * Interface definition for the coalition facility. - */ - -subsystem -#if KERNEL_USER - KernelUser -#endif /* KERNEL_USER */ - coalition_notification 5300; - -#include -#include - -/* This is likely to change with 15385886. */ -simpleroutine coalition_notification( - RequestPort coalition_port : mach_port_t; - in id : uint64_t; - in flags : uint32_t); diff --git a/src/kernel/mach/exc.defs b/src/kernel/mach/exc.defs deleted file mode 100644 index de6aee7b9..000000000 --- a/src/kernel/mach/exc.defs +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. The rights granted to you under the License - * may not be used to create, or enable the creation or redistribution of, - * unlawful or unlicensed copies of an Apple operating system, or to - * circumvent, violate, or enable the circumvention or violation of, any - * terms of an Apple operating system software license agreement. - * - * Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ - */ -/* - * @OSF_COPYRIGHT@ - */ -/* - * Mach Operating System - * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University - * All Rights Reserved. - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR - * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie Mellon - * the rights to redistribute these changes. - */ -/* - */ -/* - * Abstract: - * MiG definitions file for Mach exception interface. - */ - -subsystem -#if KERNEL_USER - KernelUser -#endif - exc 2401; - -#include -#include - -ServerPrefix catch_; - -type exception_data_t = array[*:2] of integer_t; -type exception_type_t = int; - -routine exception_raise( -#if KERNEL_USER - exception_port : mach_port_move_send_t; - thread : mach_port_move_send_t; - task : mach_port_move_send_t; -#else /* KERNEL_USER */ - exception_port : mach_port_t; - thread : mach_port_t; - task : mach_port_t; -#endif /* KERNEL_USER */ - exception : exception_type_t; - code : exception_data_t - ); - -routine exception_raise_state( -#if KERNEL_USER - exception_port : mach_port_move_send_t; -#else /* KERNEL_USER */ - exception_port : mach_port_t; -#endif /* KERNEL_USER */ - exception : exception_type_t; - code : exception_data_t, const; - inout flavor : int; - old_state : thread_state_t, const; - out new_state : thread_state_t); - -routine exception_raise_state_identity( -#if KERNEL_USER - exception_port : mach_port_move_send_t; - thread : mach_port_move_send_t; - task : mach_port_move_send_t; -#else /* KERNEL_USER */ - exception_port : mach_port_t; - thread : mach_port_t; - task : mach_port_t; -#endif /* KERNEL_USER */ - exception : exception_type_t; - code : exception_data_t; - inout flavor : int; - old_state : thread_state_t; - out new_state : thread_state_t); - -/* vim: set ft=c : */ diff --git a/src/kernel/mach/host_notify_reply.defs b/src/kernel/mach/host_notify_reply.defs deleted file mode 100644 index 85437f821..000000000 --- a/src/kernel/mach/host_notify_reply.defs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2003 Apple Computer, Inc. All rights reserved. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. The rights granted to you under the License - * may not be used to create, or enable the creation or redistribution of, - * unlawful or unlicensed copies of an Apple operating system, or to - * circumvent, violate, or enable the circumvention or violation of, any - * terms of an Apple operating system software license agreement. - * - * Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ - */ - -subsystem -#if KERNEL_USER - KernelUser -#endif /* KERN_USER */ - host_notify_reply 950; - -#include - -simpleroutine host_calendar_changed( - notify_port : mach_port_move_send_once_t); - -/* vim: set ft=c : */ diff --git a/src/kernel/mach/host_priv.defs b/src/kernel/mach/host_priv.defs deleted file mode 100644 index ac4997b22..000000000 --- a/src/kernel/mach/host_priv.defs +++ /dev/null @@ -1,369 +0,0 @@ -/* - * Copyright (c) 2000-2004 Apple Inc. All rights reserved. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. The rights granted to you under the License - * may not be used to create, or enable the creation or redistribution of, - * unlawful or unlicensed copies of an Apple operating system, or to - * circumvent, violate, or enable the circumvention or violation of, any - * terms of an Apple operating system software license agreement. - * - * Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ - */ -/* - * @OSF_COPYRIGHT@ - */ -/* - * Mach Operating System - * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University - * All Rights Reserved. - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR - * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie Mellon - * the rights to redistribute these changes. - */ -/* - */ - -/* - * Matchmaker definitions file for Mach kernel interface. - */ -subsystem -#if KERNEL_USER - KernelUser -#endif /* KERNEL_USER */ -#if KERNEL_SERVER - KernelServer -#endif /* KERNEL_SERVER */ - host_priv 400; - -#ifdef KERNEL_USER -userprefix r_; -#endif /* KERNEL_USER */ - -#include -#include -#include -#include - -/* - * Get boot configuration information from kernel. - */ -routine host_get_boot_info( - host_priv : host_priv_t; - out boot_info : kernel_boot_info_t); - -/* - * Reboot this host. - * Only available to privileged users. - */ -routine host_reboot( - host_priv : host_priv_t; - options : int); - - -/* - * Return privileged statistics from this host. - */ -routine host_priv_statistics( - host_priv : host_priv_t; - flavor : host_flavor_t; - out host_info_out : host_info_t, CountInOut); - -/* - * Sets the default memory manager, the port to which - * newly-created temporary memory objects are delivered. - * [See (memory_object_default)memory_object_create.] - * Also sets the default cluster size used for pagein/pageout - * to this port. - * The old memory manager port is returned. - */ -routine host_default_memory_manager( - host_priv : host_priv_t; - inout default_manager : memory_object_default_t = - MACH_MSG_TYPE_MAKE_SEND; - cluster_size : memory_object_cluster_size_t); - - -/* - * Specify that the range of the virtual address space - * of the target task must not cause page faults for - * the indicated accesses. - * - * [ To unwire the pages, specify VM_PROT_NONE. ] - */ -routine vm_wire( - host_priv : host_priv_t; - task : vm_map_t; - address : vm_address_t; - size : vm_size_t; - desired_access : vm_prot_t); - -/* - * Specify that the target thread must always be able - * to run and to allocate memory. - */ -routine thread_wire( - host_priv : host_priv_t; - thread : thread_act_t; - wired : boolean_t); - -/* - * Allocate zero-filled, wired, contiguous physical memory - * in the address space of the target task, either at the - * specified address, or wherever space can be found (if - * anywhere is TRUE), of the specified size. The address - * at which the allocation actually took place is returned. - * All pages will be entered into the task's pmap immediately, - * with VM_PROT_ALL. - * - * In addition to all the failure modes of its cousin, - * vm_allocate, this call may also fail if insufficient - * contiguous memory exists to satisfy the request. - * - * Memory obtained from this call should be freed the - * normal way, via vm_deallocate. - * - * N.B. This is an EXPERIMENTAL interface! - */ -routine vm_allocate_cpm( - host_priv : host_priv_t; - task : vm_map_t; - inout address : vm_address_t; - size : vm_size_t; - flags : int); - -/* - * Get list of processors on this host. - */ -routine host_processors( - host_priv : host_priv_t; - out out_processor_list : processor_array_t); - - -/* - * Get control port for a system-wide clock. - * Privileged. - */ -routine host_get_clock_control( - host_priv : host_priv_t; - clock_id : clock_id_t; - out clock_ctrl : clock_ctrl_t); - - -/* - * kernel module interface (obsolete as of SnowLeopard) - * see mach/kmod.h - */ -/* kmod_ MIG calls now return KERN_NOT_SUPPORTED on PPC/i386/x86_64. */ -routine kmod_create( - host_priv : host_priv_t; - info : vm_address_t; - out module : kmod_t); - -routine kmod_destroy( - host_priv : host_priv_t; - module : kmod_t); - -routine kmod_control( - host_priv : host_priv_t; - module : kmod_t; - flavor : kmod_control_flavor_t; - inout data : kmod_args_t); - -/* - * Get a given special port for a given node. - * Special ports are defined in host_special_ports.h; - * examples include the master device port. - * There are a limited number of slots available for system servers. - */ -routine host_get_special_port( - host_priv : host_priv_t; - node : int; - which : int; - out port : mach_port_t); - -/* - * Set a given special port for the local node. - * See host_get_special_port. - */ -routine host_set_special_port( - host_priv : host_priv_t; - which : int; - port : mach_port_t); - -/* - * Set an exception handler for a host on one or more exception types. - * These handlers are invoked for all threads on the host if there are - * no task or thread-specific exception handlers or those handlers returned - * an error. - */ -routine host_set_exception_ports( - host_priv : host_priv_t; - exception_mask : exception_mask_t; - new_port : mach_port_t; - behavior : exception_behavior_t; - new_flavor : thread_state_flavor_t); - - -/* - * Lookup some of the old exception handlers for a host - */ -routine host_get_exception_ports( - host_priv : host_priv_t; - exception_mask : exception_mask_t; - out masks : exception_mask_array_t; - out old_handlers : exception_handler_array_t, SameCount; - out old_behaviors : exception_behavior_array_t, SameCount; - out old_flavors : exception_flavor_array_t, SameCount); - - -/* - * Set an exception handler for a host on one or more exception types. - * At the same time, return the previously defined exception handlers for - * those types. - */ -routine host_swap_exception_ports( - host_priv : host_priv_t; - exception_mask : exception_mask_t; - new_port : mach_port_t; - behavior : exception_behavior_t; - new_flavor : thread_state_flavor_t; - out masks : exception_mask_array_t; - out old_handlerss : exception_handler_array_t, SameCount; - out old_behaviors : exception_behavior_array_t, SameCount; - out old_flavors : exception_flavor_array_t, SameCount); - -skip; /* old host_load_symbol_table */ - -/* - * Specify that the range of the virtual address space - * of the target task must not cause page faults for - * the indicated accesses. - * - * [ To unwire the pages, specify VM_PROT_NONE. ] - */ -routine mach_vm_wire( - host_priv : host_priv_t; - task : vm_map_t; - address : mach_vm_address_t; - size : mach_vm_size_t; - desired_access : vm_prot_t); - -/* - * JMM - Keep all processor_set related items at the end for easy - * removal. - */ -/* - * List all processor sets on host. - */ -routine host_processor_sets( - host_priv : host_priv_t; - out processor_sets : processor_set_name_array_t); - -/* - * Get control port for a processor set. - */ -routine host_processor_set_priv( - host_priv : host_priv_t; - set_name : processor_set_name_t; - out set : processor_set_t); - -/************************** Warning *************************************/ -/* The following routines are going away in a future release */ -/* use the appropriate variant of host_set_special_port instead */ -/************************************************************************/ - -/* - * Set the dynamic_pager control port. Other entities - * can request a send right to this port to talk with - * the dynamic_pager utility, setting behavioral parameters - * within the dynamic pager and getting low/high backing store - * resource notifications. - */ -routine set_dp_control_port( - host : host_priv_t; - in control_port : mach_port_t); - -/* - * Get the dynamic_pager control port. This port - * allows the holder to talk directly with the dynamic - * pager utility. - */ -routine get_dp_control_port( - host : host_priv_t; - out contorl_port :mach_port_t); - -/* - * Set the UserNotification daemon access port for this host. - * If this value is already set, the kernel will discard its - * reference to the previously registered port. - */ -routine host_set_UNDServer( - host : host_priv_t; - in server : UNDServerRef); - -/* - * Get the UserNotification daemon access port for this host. - * This can then be used to communicate with that daemon, which - * in turn communicates with the User through whatever means - * available (pop-up-menus for GUI systems, text for non-GUI, etc..). - * - * Access to this port is restricted to privileged clients because - * it is a special purpose port intended for kernel clients. User - * level clients should go directly to the CFUserNotifcation services. - */ -routine host_get_UNDServer( - host : host_priv_t; - out server : UNDServerRef); - -/* - * Perform an operation with a kernel extension, on the kext loading system, - * or request information about loaded kexts or the state of the kext loading - * system. - * Active operations (load, unload, disable/enable) require host_priv/root access. - * Info retrieval does not. - * - * WARNING: THIS ROUTINE IS PRIVATE TO THE KEXT-MANAGEMENT STACK AND IS - * SUBJECT TO CHANGE AT ANY TIME. - */ -routine kext_request( - host_priv : host_priv_t; - in user_log_flags : uint32_t; - in request_data : pointer_t; - out response_data : pointer_t; - out log_data : pointer_t; - out op_result : kern_return_t); - -/* vim: set ft=c : */ diff --git a/src/kernel/mach/host_security.defs b/src/kernel/mach/host_security.defs deleted file mode 100644 index 4098df44e..000000000 --- a/src/kernel/mach/host_security.defs +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. The rights granted to you under the License - * may not be used to create, or enable the creation or redistribution of, - * unlawful or unlicensed copies of an Apple operating system, or to - * circumvent, violate, or enable the circumvention or violation of, any - * terms of an Apple operating system software license agreement. - * - * Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ - */ -/* - * @OSF_COPYRIGHT@ - */ -/* - * Mach Operating System - * Copyright (c) 1991,1990,1989 Carnegie Mellon University - * All Rights Reserved. - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR - * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie Mellon - * the rights to redistribute these changes. - */ -/* - */ - -/* - * File: mach/host_security.defs - * - * Abstract: - * Mach host security operations support. - */ -subsystem -#if KERNEL_SERVER - KernelServer -#endif /* KERNEL_SERVER */ - host_security 600; - -/* - * Basic types - */ -#include -#include - - -/* - * Create a new task with an explicit security token - */ -routine host_security_create_task_token( - host_security : host_security_t; - parent_task : task_t; - sec_token : security_token_t; - audit_token : audit_token_t; - host : host_t; - ledgers : ledger_array_t; - inherit_memory : boolean_t; - out child_task : task_t); - -/* - * Change a task's security token - */ -routine host_security_set_task_token( - host_security : host_security_t; - target_task : task_t; - sec_token : security_token_t; - audit_token : audit_token_t; - host : host_t); - -/* vim: set ft=c : */ diff --git a/src/kernel/mach/ledger.defs b/src/kernel/mach/ledger.defs deleted file mode 100644 index 97aa09dbf..000000000 --- a/src/kernel/mach/ledger.defs +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2010 Apple Computer, Inc. All rights reserved. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. The rights granted to you under the License - * may not be used to create, or enable the creation or redistribution of, - * unlawful or unlicensed copies of an Apple operating system, or to - * circumvent, violate, or enable the circumvention or violation of, any - * terms of an Apple operating system software license agreement. - * - * Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ - */ -/* - * @OSF_COPYRIGHT@ - */ - -subsystem -#if KERNEL_USER - KernelUser -#endif /* KERNEL_USER */ -#if KERNEL_SERVER - KernelServer -#endif /* KERNEL_SERVER */ - ledger 5000; - -#ifdef KERNEL_USER -userprefix r_; -#endif /* KERNEL_USER */ - -#include -#include - -/* vim: set ft=c : */ diff --git a/src/kernel/mach/lock_set.defs b/src/kernel/mach/lock_set.defs deleted file mode 100644 index d4cb9abb6..000000000 --- a/src/kernel/mach/lock_set.defs +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. The rights granted to you under the License - * may not be used to create, or enable the creation or redistribution of, - * unlawful or unlicensed copies of an Apple operating system, or to - * circumvent, violate, or enable the circumvention or violation of, any - * terms of an Apple operating system software license agreement. - * - * Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ - */ -/* - * @OSF_COPYRIGHT@ - * - */ -/* - * File: mach/lock_set.defs - * Author: Joseph CaraDonna - * - * Exported kernel calls - * - */ - -subsystem -#if KERNEL_SERVER - KernelServer -#endif /* KERNEL_SERVER */ - lock_set 617000; - -#include -#include - -/* - * OBSOLETE interfaces - * a lock_set_t is created and destroyed through the task object. - * lock_set_create(task,&lock_set_t,...); - * lock_set_destroy(task,lock_set_t); - */ - -/* - * OBSOLETE interfaces - */ -routine lock_acquire( - lock_set : lock_set_t; - lock_id : int); - -routine lock_release( - lock_set : lock_set_t; - lock_id : int); - -routine lock_try( - lock_set : lock_set_t; - lock_id : int); - -routine lock_make_stable( - lock_set : lock_set_t; - lock_id : int); - -routine lock_handoff( - lock_set : lock_set_t; - lock_id : int); - -routine lock_handoff_accept( - lock_set : lock_set_t; - lock_id : int); - -/* vim: set ft=c : */ diff --git a/src/kernel/mach/mach_exc.defs b/src/kernel/mach/mach_exc.defs deleted file mode 100644 index 00fae2853..000000000 --- a/src/kernel/mach/mach_exc.defs +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (c) 2006 Apple Computer, Inc. All rights reserved. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. The rights granted to you under the License - * may not be used to create, or enable the creation or redistribution of, - * unlawful or unlicensed copies of an Apple operating system, or to - * circumvent, violate, or enable the circumvention or violation of, any - * terms of an Apple operating system software license agreement. - * - * Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ - */ -/* - * @OSF_COPYRIGHT@ - */ -/* - * Mach Operating System - * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University - * All Rights Reserved. - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR - * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie Mellon - * the rights to redistribute these changes. - */ -/* - */ -/* - * Abstract: - * MiG definitions file for Mach exception interface. - */ - -subsystem -#if KERNEL_USER - KernelUser -#endif - mach_exc 2405; - -#include -#include - -ServerPrefix catch_; - -type mach_exception_data_t = array[*:2] of int64_t; -type exception_type_t = int; - -routine mach_exception_raise( -#if KERNEL_USER - exception_port : mach_port_move_send_t; - thread : mach_port_move_send_t; - task : mach_port_move_send_t; -#else /* KERNEL_USER */ - exception_port : mach_port_t; - thread : mach_port_t; - task : mach_port_t; -#endif /* KERNEL_USER */ - exception : exception_type_t; - code : mach_exception_data_t - ); - -routine mach_exception_raise_state( -#if KERNEL_USER - exception_port : mach_port_move_send_t; -#else /* KERNEL_USER */ - exception_port : mach_port_t; -#endif /* KERNEL_USER */ - exception : exception_type_t; - code : mach_exception_data_t, const; - inout flavor : int; - old_state : thread_state_t, const; - out new_state : thread_state_t); - -routine mach_exception_raise_state_identity( -#if KERNEL_USER - exception_port : mach_port_move_send_t; - thread : mach_port_move_send_t; - task : mach_port_move_send_t; -#else /* KERNEL_USER */ - exception_port : mach_port_t; - thread : mach_port_t; - task : mach_port_t; -#endif /* KERNEL_USER */ - exception : exception_type_t; - code : mach_exception_data_t; - inout flavor : int; - old_state : thread_state_t; - out new_state : thread_state_t); - -/* vim: set ft=c : */ diff --git a/src/kernel/mach/mach_host.defs b/src/kernel/mach/mach_host.defs deleted file mode 100644 index 63d8402cd..000000000 --- a/src/kernel/mach/mach_host.defs +++ /dev/null @@ -1,303 +0,0 @@ -/* - * Copyright (c) 2000-2009 Apple Inc. All rights reserved. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. The rights granted to you under the License - * may not be used to create, or enable the creation or redistribution of, - * unlawful or unlicensed copies of an Apple operating system, or to - * circumvent, violate, or enable the circumvention or violation of, any - * terms of an Apple operating system software license agreement. - * - * Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ - */ -/* - * @OSF_COPYRIGHT@ - */ -/* - * Mach Operating System - * Copyright (c) 1991,1990,1989 Carnegie Mellon University - * All Rights Reserved. - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR - * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie Mellon - * the rights to redistribute these changes. - */ -/* - */ - -/* - * File: mach/mach_host.defs - * - * Abstract: - * Mach host operations support. Includes processor allocation and - * control. - */ - -subsystem -#if KERNEL_SERVER - KernelServer -#endif /* KERNEL_SERVER */ - mach_host 200; - -/* - * Basic types - */ - -#include -#include -#include -#include - -/* - * References to host objects are returned by: - * mach_host_self() - trap - */ - -/* - * Return information about this host. - */ -routine host_info( - host : host_t; - flavor : host_flavor_t; - out host_info_out : host_info_t, CountInOut); - -/* - * Get string describing current kernel version. - */ -routine host_kernel_version( - host : host_t; - out kernel_version : kernel_version_t); - -/* - * Get host page size - * (compatibility for running old libraries on new kernels - - * host_page_size() is now a library routine based on constants) - */ -#if KERNEL -routine host_page_size( -#else -routine _host_page_size( -#endif - host : host_t; - out out_page_size : vm_size_t); - -/* - * Allow pagers to create named entries that point to un-mapped - * abstract memory object. The named entries are generally mappable - * and can be subsetted through the mach_make_memory_entry call - */ -routine mach_memory_object_memory_entry( - host :host_t; - internal :boolean_t; - size :vm_size_t; - permission :vm_prot_t; - pager :memory_object_t; - out entry_handle :mach_port_move_send_t); - - -/* - * Get processor info for all the processors on this host. - * The returned data is an OOL array of processor info. - */ -routine host_processor_info( - host : host_t; - flavor : processor_flavor_t; - out out_processor_count : natural_t; - out out_processor_info : processor_info_array_t); - -/* - * Return host IO master access port - */ -routine host_get_io_master( - host : host_t; - out io_master : io_master_t); - -/* - * Get service port for a processor set. - * Available to all. - */ -routine host_get_clock_service( - host : host_t; - clock_id : clock_id_t; - out clock_serv : clock_serv_t); - -/* - * kernel module interface (obsolete as of SnowLeopard) - * see mach/kmod.h - */ -/* kmod_ MIG calls now return KERN_NOT_SUPPORTED on PPC/i386/x86_64. */ -routine kmod_get_info( - host : host_t; - out modules : kmod_args_t); - -/* - * Returns information about the memory allocation zones. - * Supported in all kernels.. - * - * DEPRECATED! Use mach_zone_info() instead. - */ -routine host_zone_info( - host : host_priv_t; - out names : zone_name_array_t, - Dealloc; - out info : zone_info_array_t, - Dealloc); - -/* - * Returns information about the global VP table. - * Only supported in MACH_VM_DEBUG kernels, - * otherwise returns KERN_FAILURE. - */ -routine host_virtual_physical_table_info( - host : host_t; - out info : hash_info_bucket_array_t, - Dealloc); - - -skip; /* was host_ipc_hash_info */ -skip; /* was enable_bluebox */ -skip; /* was disable_bluebox */ - -/* - * JMM - Keep processor_set related items at the end for easy - * removal. - */ -/* - * Get default processor set for host. - */ -routine processor_set_default( - host : host_t; - out default_set : processor_set_name_t); - -/* - * Create new processor set. Returns real port for manipulations, - * and name port for obtaining information. - */ -routine processor_set_create( - host : host_t; - out new_set : processor_set_t; - out new_name : processor_set_name_t); - -/* - * Temporary interfaces for conversion to 64 bit data path - */ - -routine mach_memory_object_memory_entry_64( - host :host_t; - internal :boolean_t; - size :memory_object_size_t; - permission :vm_prot_t; - pager :memory_object_t; - out entry_handle :mach_port_move_send_t); - -/* - * Return statistics from this host. - */ -routine host_statistics( - host_priv : host_t; - flavor : host_flavor_t; - out host_info_out : host_info_t, CountInOut); - -routine host_request_notification( - host : host_t; - notify_type : host_flavor_t; - notify_port : mach_port_make_send_once_t); - -routine host_lockgroup_info( - host : host_t; - out lockgroup_info : lockgroup_info_array_t, - Dealloc); - -/* - * Return 64-bit statistics from this host. - */ -routine host_statistics64( - host_priv : host_t; - flavor : host_flavor_t; - out host_info64_out : host_info64_t, CountInOut); - -/* - * Returns information about the memory allocation zones. - * Data returned is compatible with various caller and kernel - * address space sizes (unlike host_zone_info()). - */ -routine mach_zone_info( - host : host_priv_t; - out names : mach_zone_name_array_t, - Dealloc; - out info : mach_zone_info_array_t, - Dealloc); - -#ifdef PRIVATE -/* - * Forces a zone allocator garbage collections pass. - * Pages with no in-use allocations are returned to - * the VM system for re-use. - */ -routine mach_zone_force_gc( - host : host_t); -#else -skip; -#endif - -/* - * Create a new voucher by running a series of commands against - * pairs of resource attributes. - */ -routine host_create_mach_voucher( - host : host_t; - recipes : mach_voucher_attr_raw_recipe_array_t; - out voucher : ipc_voucher_t); - -/* - * Register a resource manager with the kernel. A new key is selected. - */ -routine host_register_mach_voucher_attr_manager( - host : host_t; - attr_manager : mach_voucher_attr_manager_t; - default_value : mach_voucher_attr_value_handle_t; - out new_key : mach_voucher_attr_key_t; - out new_attr_control: ipc_voucher_attr_control_t); - -/* - * Register a resource manager (with a well-known key value) with the kernel. - */ -routine host_register_well_known_mach_voucher_attr_manager( - host : host_t; - attr_manager : mach_voucher_attr_manager_t; - default_value : mach_voucher_attr_value_handle_t; - key : mach_voucher_attr_key_t; - out new_attr_control: ipc_voucher_attr_control_t); - -/* vim: set ft=c : */ diff --git a/src/kernel/mach/mach_notify.defs b/src/kernel/mach/mach_notify.defs deleted file mode 100644 index b4d03a6c6..000000000 --- a/src/kernel/mach/mach_notify.defs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. The rights granted to you under the License - * may not be used to create, or enable the creation or redistribution of, - * unlawful or unlicensed copies of an Apple operating system, or to - * circumvent, violate, or enable the circumvention or violation of, any - * terms of an Apple operating system software license agreement. - * - * Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ - */ -/* - * The mach/notify.h file is hand-crafted. - * It contains additional data that cannot be generated by MIG at this time. - * But its existence keeps us from having MIG generate the client-side - * routines to send Mach notifications. This file exists simply to give - * those routines a new home (mach/mach_notify.h and mach_notify_user.c) - * until the real notify.h becomes "MIG-safe." - */ -#include - -/* vim: set ft=c : */ diff --git a/src/kernel/mach/mach_port.defs b/src/kernel/mach/mach_port.defs deleted file mode 100644 index 202b08bce..000000000 --- a/src/kernel/mach/mach_port.defs +++ /dev/null @@ -1,614 +0,0 @@ -/* - * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. The rights granted to you under the License - * may not be used to create, or enable the creation or redistribution of, - * unlawful or unlicensed copies of an Apple operating system, or to - * circumvent, violate, or enable the circumvention or violation of, any - * terms of an Apple operating system software license agreement. - * - * Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ - */ -/* - * @OSF_FREE_COPYRIGHT@ - */ -/* - * Mach Operating System - * Copyright (c) 1991,1990,1989 Carnegie Mellon University - * All Rights Reserved. - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR - * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie Mellon - * the rights to redistribute these changes. - */ -/* - */ -/* - * File: mach/mach_port.defs - * Author: Rich Draves - * - * Exported kernel calls. - */ - -subsystem -#if KERNEL_SERVER - KernelServer -#endif /* KERNEL_SERVER */ - mach_port 3200; - -#if !KERNEL && !LIBSYSCALL_INTERFACE - UserPrefix _kernelrpc_; -#endif - -#include -#include -#include - -/* - * Returns the set of port and port set names - * to which the target task has access, along with - * the type (set or port) for each name. - */ - -routine mach_port_names( - task : ipc_space_t; - out names : mach_port_name_array_t; - out types : mach_port_type_array_t); - -/* - * Returns the type (set or port) for the port name - * within the target task. Also indicates whether - * there is a dead-name request for the name. - */ - -routine mach_port_type( - task : ipc_space_t; - name : mach_port_name_t; - out ptype : mach_port_type_t); - -/* - * Changes the name by which a port (or port set) is known to - * the target task. The new name can't be in use. The - * old name becomes available for recycling. - * - * This interface is OBSOLETE and will always - * return KERN_NOT_SUPPORTED. - */ - -routine mach_port_rename( - task : ipc_space_t; - old_name : mach_port_name_t; - new_name : mach_port_name_t); - -/* - * Allocates the specified kind of object, with the given name. - * The right must be one of - * MACH_PORT_RIGHT_RECEIVE - * MACH_PORT_RIGHT_PORT_SET - * MACH_PORT_RIGHT_DEAD_NAME - * New port sets are empty. New ports don't have any - * send/send-once rights or queued messages. The make-send - * count is zero and their queue limit is MACH_PORT_QLIMIT_DEFAULT. - * New sets, ports, and dead names have one user reference. - */ - -routine mach_port_allocate_name( - task : ipc_space_t; - right : mach_port_right_t; - name : mach_port_name_t); - -/* - * Allocates the specified kind of object. - * The right must be one of - * MACH_PORT_RIGHT_RECEIVE - * MACH_PORT_RIGHT_PORT_SET - * MACH_PORT_RIGHT_DEAD_NAME - * Like port_allocate_name, but the kernel picks a name. - * It can use any name not associated with a right. - */ - -routine mach_port_allocate( - task : ipc_space_t; - right : mach_port_right_t; - out name : mach_port_name_t); - -/* - * Destroys all rights associated with the name and makes it - * available for recycling immediately. The name can be a - * port (possibly with multiple user refs), a port set, or - * a dead name (again, with multiple user refs). - */ - -routine mach_port_destroy( - task : ipc_space_t; - name : mach_port_name_t); - -/* - * Releases one send/send-once/dead-name user ref. - * Just like mach_port_mod_refs -1, but deduces the - * correct type of right. This allows a user task - * to release a ref for a port without worrying - * about whether the port has died or not. - */ - -routine mach_port_deallocate( - task : ipc_space_t; - name : mach_port_name_t); - -/* - * A port set always has one user ref. - * A send-once right always has one user ref. - * A dead name always has one or more user refs. - * A send right always has one or more user refs. - * A receive right always has one user ref. - * The right must be one of - * MACH_PORT_RIGHT_RECEIVE - * MACH_PORT_RIGHT_PORT_SET - * MACH_PORT_RIGHT_DEAD_NAME - * MACH_PORT_RIGHT_SEND - * MACH_PORT_RIGHT_SEND_ONCE - */ - -routine mach_port_get_refs( - task : ipc_space_t; - name : mach_port_name_t; - right : mach_port_right_t; - out refs : mach_port_urefs_t); - -/* - * The delta is a signed change to the task's - * user ref count for the right. Only dead names - * and send rights can have a positive delta. - * The resulting user ref count can't be negative. - * If it is zero, the right is deallocated. - * If the name isn't a composite right, it becomes - * available for recycling. The right must be one of - * MACH_PORT_RIGHT_RECEIVE - * MACH_PORT_RIGHT_PORT_SET - * MACH_PORT_RIGHT_DEAD_NAME - * MACH_PORT_RIGHT_SEND - * MACH_PORT_RIGHT_SEND_ONCE - */ - -routine mach_port_mod_refs( - task : ipc_space_t; - name : mach_port_name_t; - right : mach_port_right_t; - delta : mach_port_delta_t); - -/* - * Peek at the message queue for the specified receive - * right and return info about the message with the - * sequence number matching the input. If zero is - * specified as the seqno, the first message in the - * queue will be peeked. - * - * Only the following trailer types are currently supported: - * MACH_RCV_TRAILER_TYPE(MACH_MSG_TRAILER_FORMAT_0) - * - * or'ed with one of these element types: - * MACH_RCV_TRAILER_ELEMENTS(MACH_RCV_TRAILER_NULL) - * MACH_RCV_TRAILER_ELEMENTS(MACH_RCV_TRAILER_SEQNO) - * MACH_RCV_TRAILER_ELEMENTS(MACH_RCV_TRAILER_SENDER) - * MACH_RCV_TRAILER_ELEMENTS(MACH_RCV_TRAILER_AUDIT) - */ -routine mach_port_peek( - task : ipc_space_t; - name : mach_port_name_t; - trailer_type : mach_msg_trailer_type_t; - inout request_seqnop : mach_port_seqno_t; - out msg_sizep : mach_msg_size_t; - out msg_idp : mach_msg_id_t; - out trailer_infop : mach_msg_trailer_info_t, CountInOut); - -/* - * Only valid for receive rights. - * Sets the make-send count for the port. - */ -routine mach_port_set_mscount( - task : ipc_space_t; - name : mach_port_name_t; - mscount : mach_port_mscount_t); - -/* - * Only valid for port sets. Returns a list of - * the members. - */ - -routine mach_port_get_set_status( - task : ipc_space_t; - name : mach_port_name_t; - out members : mach_port_name_array_t); - -/* - * Puts the member port (the task must have receive rights) - * into the after port set. If the port is already a member - * of any set(s), it is atomically removed from those sets as - * part of this operation. (If after is MACH_PORT_NULL, the - * port is still removed from all current sets). - */ - -routine mach_port_move_member( - task : ipc_space_t; - member : mach_port_name_t; - after : mach_port_name_t); - -/* - * Requests a notification from the kernel. The request - * must supply the send-once right which is used for - * the notification. If a send-once right was previously - * registered, it is returned. The msgid must be one of: - * MACH_NOTIFY_PORT_DESTROYED (receive rights) - * MACH_NOTIFY_DEAD_NAME (send/receive/send-once rights) - * MACH_NOTIFY_SEND_POSSIBLE (send/receive/send-once rights) - * MACH_NOTIFY_NO_SENDERS (receive rights) - * - * The sync value specifies whether a notification should - * get sent immediately, if appropriate. The exact meaning - * depends on the notification: - * MACH_NOTIFY_PORT_DESTROYED: must be zero. - * MACH_NOTIFY_DEAD_NAME: if non-zero, then name can be dead, - * and the notification gets sent immediately. - * If zero, then name can't be dead. - * MACH_NOTIFY_SEND_POSSIBLE: if non-zero, will generate a send- - * possible notification as soon as it is possible to send - * to the port. If zero, will generate a send-possible - * notification only after a subsequent failed send - * (with MACH_SEND_NOTIFY option to mach_msg call). Can - * generate a dead-name notification if name is already dead - * or becomes dead before a send-possible notification fires. - * MACH_NOTIFY_NO_SENDERS: the notification gets sent - * immediately if the current mscount is greater - * than or equal to the sync value and there are no - * extant send rights. - * - * If the name is deleted before a successfully registered notification - * is delivered, it is replaced with a port-deleted notification. - */ - -routine mach_port_request_notification( - task : ipc_space_t; - name : mach_port_name_t; - msgid : mach_msg_id_t; - sync : mach_port_mscount_t; - notify : mach_port_send_once_t; - out previous : mach_port_move_send_once_t); - -/* - * Inserts the specified rights into the target task, - * using the specified name. If inserting send/receive - * rights and the task already has send/receive rights - * for the port, then the names must agree. In any case, - * the task gains a user ref for the port. - */ - -routine mach_port_insert_right( - task : ipc_space_t; - name : mach_port_name_t; - poly : mach_port_poly_t); - -/* - * Returns the specified right for the named port - * in the target task, extracting that right from - * the target task. The target task loses a user - * ref and the name may be available for recycling. - * msgt_name must be one of - * MACH_MSG_TYPE_MOVE_RECEIVE - * MACH_MSG_TYPE_COPY_SEND - * MACH_MSG_TYPE_MAKE_SEND - * MACH_MSG_TYPE_MOVE_SEND - * MACH_MSG_TYPE_MAKE_SEND_ONCE - * MACH_MSG_TYPE_MOVE_SEND_ONCE - */ - -routine mach_port_extract_right( - task : ipc_space_t; - name : mach_port_name_t; - msgt_name : mach_msg_type_name_t; - out poly : mach_port_poly_t); - -/* - * Only valid for receive rights. - * Sets the sequence number for the port. - */ - -routine mach_port_set_seqno( - task : ipc_space_t; - name : mach_port_name_t; - seqno : mach_port_seqno_t); - -/* - * Returns information about a port. - */ - -routine mach_port_get_attributes( - task : ipc_space_t; - name : mach_port_name_t; - flavor : mach_port_flavor_t; - out port_info_out : mach_port_info_t, CountInOut); - -/* - * Set attributes of a port - */ - -routine mach_port_set_attributes( - task : ipc_space_t; - name : mach_port_name_t; - flavor : mach_port_flavor_t; - port_info : mach_port_info_t); - - -/* - * Allocates the specified kind of object, qos version. - * The right must be - * MACH_PORT_RIGHT_RECEIVE - * Like port_allocate_name, but the kernel picks a name. - * It can use any name not associated with a right. - */ - -routine mach_port_allocate_qos( - task : ipc_space_t; - right : mach_port_right_t; - inout qos : mach_port_qos_t; - out name : mach_port_name_t); - - -/* - * Generic interface to allocation various kinds of ports. - * Should never be called directly by users (at least not - * unless they are exceedingly masochistic). - */ - -routine mach_port_allocate_full( - task : ipc_space_t; - right : mach_port_right_t; - proto : mach_port_t; - inout qos : mach_port_qos_t; - inout name : mach_port_name_t); - - -/* - * Pre-expand task port name space. - */ -routine task_set_port_space( - task : ipc_space_t; - table_entries : int); - - -/* - * Returns the exact number of extant send rights - * for the given receive right. - * This call is only valid on MACH_IPC_DEBUG kernels. - * Otherwise, KERN_FAILURE is returned. - */ -routine mach_port_get_srights( - task : ipc_space_t; - name : mach_port_name_t; - out srights : mach_port_rights_t); - - -/* - * Returns information about an IPC space. - * This call is only valid on MACH_IPC_DEBUG kernels. - * Otherwise, KERN_FAILURE is returned. - */ -routine mach_port_space_info( - task : ipc_space_t; - out space_info : ipc_info_space_t; - out table_info : ipc_info_name_array_t; - out tree_info : ipc_info_tree_name_array_t); - -/* - * Returns information about the dead-name requests - * registered with the named receive right. - * This call is only valid on MACH_IPC_DEBUG kernels. - * Otherwise, KERN_FAILURE is returned. - */ -routine mach_port_dnrequest_info( - task : ipc_space_t; - name : mach_port_name_t; - out dnr_total : unsigned; /* total size of table */ - out dnr_used : unsigned); /* amount used */ - -/* - * Return the type and address of the kernel object - * that the given send/receive right represents. - * This call is only valid on MACH_IPC_DEBUG kernels. - * Otherwise, KERN_FAILURE is returned. - * - * This interface is DEPRECATED in favor of the new - * mach_port_kernel_object64() call (see below). - */ -routine mach_port_kernel_object( - task : ipc_space_t; - name : mach_port_name_t; - out object_type : unsigned; - out object_addr : unsigned); - - -/* - * Inserts the specified rights into the portset identified - * by the pair. The results of passing in the - * Poly argument via the supplied disposition must yield a - * receive right. - * - * If the pair does not represent a valid portset - * KERN_INVALID_RIGHT is returned. - * - * If the passed in name argument does not represent a receive - * right, KERN_INVALID_CAPABILITY will be returned. - * - * If the port represented by the receive right is already in - * the portset, KERN_ALREADY_IN_SET is returned. - */ -routine mach_port_insert_member( - task : ipc_space_t; - name : mach_port_name_t; - pset : mach_port_name_t); - -/* - * Extracts the specified right from the named portset - * in the target task. - * the target task. The target task loses a user - * ref and the name may be available for recycling. - * msgt_name must be one of - * MACH_MSG_TYPE_MOVE_RECEIVE - * MACH_MSG_TYPE_COPY_SEND - * MACH_MSG_TYPE_MAKE_SEND - * MACH_MSG_TYPE_MOVE_SEND - * MACH_MSG_TYPE_MAKE_SEND_ONCE - * MACH_MSG_TYPE_MOVE_SEND_ONCE - */ - -routine mach_port_extract_member( - task : ipc_space_t; - name : mach_port_name_t; - pset : mach_port_name_t); - -/* - * Only valid for receive rights. - * Gets the context pointer for the port. - */ - -routine mach_port_get_context( - task : ipc_space_t; - name : mach_port_name_t; -#ifdef LIBSYSCALL_INTERFACE - out context : mach_port_context_t -#else - out context : mach_vm_address_t -#endif - ); - -/* - * Only valid for receive rights. - * Sets the context pointer for the port. - */ - -routine mach_port_set_context( - task : ipc_space_t; - name : mach_port_name_t; -#ifdef LIBSYSCALL_INTERFACE - context : mach_port_context_t -#else - context : mach_vm_address_t -#endif - ); - -/* - * Return the type and address of the kernel object - * that the given send/receive right represents. - * This call is only valid on MACH_IPC_DEBUG kernels. - * Otherwise, KERN_FAILURE is returned. - */ -routine mach_port_kobject( - task : ipc_space_t; - name : mach_port_name_t; - out object_type : natural_t; - out object_addr : mach_vm_address_t); - - -/* - * Constructs a right based on the options passed - * in. Also allows guarding the port as one of the - * options if the requested right is a receive - * right. - */ -routine mach_port_construct( - task : ipc_space_t; - options : mach_port_options_ptr_t; -#ifdef LIBSYSCALL_INTERFACE - context : mach_port_context_t; -#else - context : uint64_t; -#endif - out name : mach_port_name_t); - -/* - * Destroys a mach port using the guard provided - * for guarded ports. Also reduces the user ref - * count for send rights as specified by srdelta. - */ -routine mach_port_destruct( - task : ipc_space_t; - name : mach_port_name_t; - srdelta : mach_port_delta_t; -#ifdef LIBSYSCALL_INTERFACE - guard : mach_port_context_t -#else - guard : uint64_t -#endif - ); - -/* - * Guard an already existing port. Allows guarding - * receive rights only. Uses the context field in the - * port structure to store the guard. - */ -routine mach_port_guard( - task : ipc_space_t; - name : mach_port_name_t; -#ifdef LIBSYSCALL_INTERFACE - guard : mach_port_context_t; -#else - guard : uint64_t; -#endif - strict : boolean_t); - -/* - * Unguard a port guarded previously. For unguarded ports - * or incorrect guards passed in it raises an exception - * indicating guarding misbehavior. - */ -routine mach_port_unguard( - task : ipc_space_t; - name : mach_port_name_t; -#ifdef LIBSYSCALL_INTERFACE - guard : mach_port_context_t -#else - guard : uint64_t -#endif - ); - -/* - * Returns basic information about an IPC space. - * This call is only valid on MACH_IPC_DEBUG kernels. - * Otherwise, KERN_FAILURE is returned. - */ -routine mach_port_space_basic_info( - task : ipc_space_t; - out basic_info : ipc_info_space_basic_t); - -/* vim: set ft=c : */ diff --git a/src/kernel/mach/mach_types.defs b/src/kernel/mach/mach_types.defs deleted file mode 100644 index d3077945a..000000000 --- a/src/kernel/mach/mach_types.defs +++ /dev/null @@ -1,598 +0,0 @@ -/* - * Copyright (c) 2000-2010 Apple Inc. All rights reserved. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. The rights granted to you under the License - * may not be used to create, or enable the creation or redistribution of, - * unlawful or unlicensed copies of an Apple operating system, or to - * circumvent, violate, or enable the circumvention or violation of, any - * terms of an Apple operating system software license agreement. - * - * Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ - */ -/* - * @OSF_COPYRIGHT@ - */ -/* - * Mach Operating System - * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University - * All Rights Reserved. - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR - * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie Mellon - * the rights to redistribute these changes. - */ -/* - * NOTICE: This file was modified by McAfee Research in 2004 to introduce - * support for mandatory and extensible security protections. This notice - * is included in support of clause 2.2 (b) of the Apple Public License, - * Version 2.0. - */ -/* - */ -/* - * Mach kernel interface type declarations - */ - -#ifndef _MACH_MACH_TYPES_DEFS_ -#define _MACH_MACH_TYPES_DEFS_ - - -#include - -type memory_object_offset_t = uint64_t; -type memory_object_size_t = uint64_t; -type memory_object_cluster_size_t = uint32_t; -type memory_object_fault_info_t = array[16] of integer_t; - -#ifdef KERNEL_PRIVATE - -/* Universal Page Lists - restricted to (in-kernel) pagers for now */ -type upl_size_t = uint32_t; -type upl_offset_t = uint32_t; -type upl_page_info_t = struct[2] of integer_t; -type upl_page_info_array_t = array[*:256] of upl_page_info_t; - -type upl_t = mach_port_t - intran: upl_t convert_port_to_upl(mach_port_t) - outtran: mach_port_t convert_upl_to_port(upl_t) - destructor: upl_deallocate(upl_t) - ; - -#endif /* KERNEL_PRIVATE */ - -type mach_port_status_t = struct[10] of integer_t; /* obsolete */ -type mach_port_info_ext_t = struct[17] of integer_t; - - /* mach_port_info_t: can hold either a - * mach_port_status_t (9 ints) or a - * mach_port_limits_t (1 int) or a - * mach_port_info_ext_t (17 ints). If new flavors of - * mach_port_{get,set}_attributes are added, the size of - * this array may have to be increased. (See mach/port.h) - */ -type mach_port_flavor_t = int; -type mach_port_info_t = array[*:17] of integer_t; - - /* - * mach_msg_max_trailer_t: can hold - * mach_msg_trailer_type_t (1 int) - * mach_msg_trailer_size_t (1 int) - * mach_port_seqno_t (1 int) - * security_token_t (2 ints) - * audit_token_t (8 ints) - * mach_port_context_t (2 ints) - * msgh_ad (1 int) - * msg_labels_t (1 int) - */ -type mach_msg_trailer_type_t = int; -type mach_msg_trailer_info_t = array[*:68] of char; - -type task_t = mach_port_t -#if KERNEL_SERVER - intran: task_t convert_port_to_task(mach_port_t) - outtran: mach_port_t convert_task_to_port(task_t) - destructor: task_deallocate(task_t) -#endif /* KERNEL_SERVER */ - ; - -type task_name_t = mach_port_t -#if KERNEL_SERVER - intran: task_name_t convert_port_to_task_name(mach_port_t) - outtran: mach_port_t convert_task_name_to_port(task_name_t) - destructor: task_name_deallocate(task_name_t) -#endif /* KERNEL_SERVER */ - ; - -type thread_t = mach_port_t -#if KERNEL_SERVER - intran: thread_t convert_port_to_thread(mach_port_t) - outtran: mach_port_t convert_thread_to_port(thread_t) - destructor: thread_deallocate(thread_t) -#endif /* KERNEL_SERVER */ - ; - -type thread_act_t = mach_port_t -#if KERNEL_SERVER - intran: thread_act_t convert_port_to_thread(mach_port_t) - outtran: mach_port_t convert_thread_to_port(thread_act_t) - destructor: thread_deallocate(thread_act_t) -#endif /* KERNEL_SERVER */ - ; - -type thread_act_consume_ref_t = mach_port_move_send_t - cusertype: thread_act_t -#if KERNEL_SERVER - intran: thread_act_t convert_port_to_thread(mach_port_t) - destructor: thread_deallocate(thread_act_t) -#endif /* KERNEL_SERVER */ - ; - - /* thread_state_t: This inline array can hold - * a machine-dependent amount of data, defined in - * mach/machine/???? (currently THREAD_STATE_MAX, - * in mach/thread_state.h) - */ -#include -type thread_state_flavor_t = int; -type thread_state_t = array[*:THREAD_STATE_MAX] of natural_t; - -type task_array_t = ^array[] of task_t; -type thread_array_t = ^array[] of thread_t; -type thread_act_array_t = ^array[] of thread_act_t; -type act_params_t = array[6] of int; - -type vm_map_t = mach_port_t -#if KERNEL_SERVER - intran: vm_map_t convert_port_to_map(mach_port_t) - destructor: vm_map_deallocate(vm_map_t) -#endif /* KERNEL_SERVER */ - ; - -type vm_task_entry_t = mach_port_t - cusertype: vm_map_t -#if KERNEL_SERVER - intran: vm_map_t convert_port_entry_to_map(mach_port_t) - destructor: vm_map_deallocate(vm_map_t) -#endif /* KERNEL_SERVER */ - ; - -type ipc_space_t = mach_port_t -#if KERNEL_SERVER - intran: ipc_space_t convert_port_to_space(mach_port_t) - destructor: space_deallocate(ipc_space_t) -#endif /* KERNEL_SERVER */ - ; - -type vm_prot_t = int; -type vm_inherit_t = int; -type vm_purgable_t = int; -type xxx_vm_statistics_data_t = struct[13] of integer_t; -type vm_behavior_t = int; -type vm_statistics_data_t = struct[15] of integer_t; -type vm_machine_attribute_t = int; -type vm_machine_attribute_val_t = int; -type vm_sync_t = int; - - /* thread_info_t: this inline array can hold any of: - * thread_basic_info_t (10 ints) - * policy_timeshare_info_t (5 ints) - * policy_fifo_info_t (4 ints) - * policy_rr_info_t (5 ints) - * if other thread_info flavors are added, this - * definition may need to be changed. (See - * mach/thread_info.h and mach/policy.h) */ -type thread_flavor_t = int; -type thread_info_t = array[*:12] of integer_t; - -type thread_policy_flavor_t = natural_t; -type thread_policy_t = array[*:16] of integer_t; - - /* task_info_t: this inline array can hold any of: - * task_basic_info_32_t (8 ints) - * task_basic_info_64_t (10 ints) - * task_events_info_t (8 ints) - * task_thread_times_info_t (4 ints) - * policy_timeshare_info_t (5 ints) - * policy_fifo_info_t (4 ints) - * policy_rr_info_t (5 ints) - * task security token (2 ints) - * task audit token (8 ints) - * dyld info (2 64-bit ints and 1 int) - * task_extmod_info_t (8 64-bit ints) - * task_basic_info_64_2_t - * mach_task_basic_info_t (12 ints) - * task_power_info_t (18 ints) - * If other task_info flavors are added, this - * definition may need to be changed. (See - * mach/task_info.h and mach/policy.h) */ -type task_flavor_t = int; -type task_info_t = array[*:52] of integer_t; - -type task_purgable_info_t = struct[68] of integer_t; - -type task_policy_flavor_t = natural_t; -type task_policy_t = array[*:16] of integer_t; - -type mem_entry_name_port_t = mach_port_t -#if KERNEL_SERVER - intran: mem_entry_name_port_t null_conversion(mach_port_t) - outtran: mach_port_t null_conversion(mem_entry_name_port_t) -#endif /* KERNEL_SERVER */ - ; - -type mem_entry_name_port_move_send_t = mach_port_move_send_t - cusertype: mem_entry_name_port_t -#if KERNEL_SERVER - intran: mem_entry_name_port_t null_conversion(mach_port_t) - outtran: mach_port_t null_conversion(mem_entry_name_port_t) -#endif /* KERNEL_SERVER */ - ; - -type memory_object_default_t = mach_port_t -#if KERNEL_PRIVATE - intran: memory_object_default_t null_conversion(mach_port_t) - outtran: mach_port_t null_conversion(memory_object_default_t) -#endif /* KERNEL_PRIVATE */ - ; - -type memory_object_t = mach_port_t -#if KERNEL_PRIVATE - intran: memory_object_t convert_port_to_memory_object(mach_port_t) - outtran: mach_port_t convert_memory_object_to_port(memory_object_t) -#endif /* KERNEL_PRIVATE */ - ; - - -type memory_object_control_t = mach_port_t -#if KERNEL_PRIVATE - intran: memory_object_control_t convert_port_to_mo_control(mach_port_t) - outtran: mach_port_t convert_mo_control_to_port(memory_object_control_t) - destructor: memory_object_control_deallocate(memory_object_control_t) -#endif /* KERNEL_PRIVATE */ - ; - -type memory_object_name_t = mach_port_t - ctype: mach_port_t - ; - - -type memory_object_copy_strategy_t = int; -type memory_object_return_t = int; - -type machine_info_data_t = struct[5] of integer_t; -type machine_slot_data_t = struct[8] of integer_t; - -type host_t = mach_port_t -#if KERNEL_SERVER - intran: host_t convert_port_to_host(mach_port_t) - outtran: mach_port_t convert_host_to_port(host_t) -#endif /* KERNEL_SERVER */ - ; - -type host_priv_t = mach_port_t -#if KERNEL_SERVER - intran: host_priv_t convert_port_to_host_priv(mach_port_t) -#endif /* KERNEL_SERVER */ - ; - -type host_security_t = mach_port_t -#if KERNEL_SERVER - intran: host_security_t convert_port_to_host_security(mach_port_t) -#endif /* KERNEL_SERVER */ - ; - - /* - * host_info_t: variable-sized inline array that can contain: - * - * host_basic_info_old_t (5 ints) - * host_basic_info_t (12 ints) - * host_sched_info_t (2 ints) - * kernel_resource_sizes_t (5 ints) - * host_load_info_t (6 ints) - * vm_statistics32_t (15 ints) - * host_purgable_info_t (68 ints) - * host_expired_task_info uses a task_power_info (18 ints) - * - * If other host_info flavors are added, this definition may - * need to be changed. (See mach/{host_info,vm_statistics}.h) - */ -type host_flavor_t = int; -type host_info_t = array[*:68] of integer_t; - /* - * host_info64_t: variable-sized inline array that can contain: - * - * vm_statistics_t (6 ints and 9 longs) - * vm_extmod_statistics_t (6 64-bit ints) - */ -type host_info64_t = array[*:256] of integer_t; - -type processor_t = mach_port_t -#if KERNEL_SERVER - intran: processor_t convert_port_to_processor(mach_port_t) - outtran: mach_port_t convert_processor_to_port(processor_t) -#endif /* KERNEL_SERVER */ - ; - -type processor_array_t = ^array[] of processor_t; - - /* processor_info_t: variable-sized inline array that can - * contain: - * processor_basic_info_t: (5 ints) - * processor_cpu_load_info_t:(4 ints) - * processor_machine_info_t :(12 ints) - * If other processor_info flavors are added, this definition - * may need to be changed. (See mach/processor_info.h) */ -type processor_flavor_t = int; -type processor_info_t = array[*:12] of integer_t; -type processor_info_array_t = ^array[] of integer_t; - -type processor_set_t = mach_port_t -#if KERNEL_SERVER - intran: processor_set_t convert_port_to_pset(mach_port_t) - outtran: mach_port_t convert_pset_to_port(processor_set_t) - destructor: pset_deallocate(processor_set_t) -#endif /* KERNEL_SERVER */ - ; - -type processor_set_array_t = ^array[] of processor_set_t; - -type processor_set_name_t = mach_port_t -#if KERNEL_SERVER - intran: processor_set_name_t convert_port_to_pset_name(mach_port_t) - outtran: mach_port_t convert_pset_name_to_port(processor_set_name_t) - destructor: pset_deallocate(processor_set_name_t) -#endif /* KERNEL_SERVER */ - ; - -type processor_set_name_array_t = ^array[] of processor_set_name_t; - - /* processor_set_info_t: variable-size inline array - * that can hold: - * processor_set_basic_info (5 ints) - * processor_set_load_info (4 ints) - * policy_timeshare_base_t (1 int) - * policy_fifo_base_t (1 int) - * policy_rr_base_t (1 int) - * policy_timeshare_base_t (1 int) - * policy_fifo_base_t (1 int) - * policy_rr_base_t (1 int) - * policy_t (1 int) - * If other flavors are added, this definition may - * need to be changed. (see mach/processor.h) */ -type processor_set_flavor_t = int; -type processor_set_info_t = array[*:5] of integer_t; - -type bootstrap_t = mach_port_t; - -type kernel_version_t = c_string[*:512]; -type kernel_boot_info_t = c_string[*:4096]; - -type time_value_t = struct[2] of integer_t; - -type mach_port_qos_t = struct[2] of integer_t; - -type mach_port_options_t = struct[3] of uint64_t; -type mach_port_options_ptr_t = ^ mach_port_options_t; - -type emulation_vector_t = ^array[] of vm_offset_t; - -type inline_existence_map_t = array[*:512] of char; - -type policy_t = int; - /* policy_info_t: variable-size inline array. Can hold: - * policy_timeshare_info_t (5 ints) - * policy_fifo_info_t (4 ints) - * policy_rr_info_t (5 ints) */ -type policy_base_t = array[*:5] of integer_t; -type policy_info_t = array[*:2] of integer_t; -type policy_limit_t = array[*:1] of integer_t; - -type ledger_t = mach_port_t -#if KERNEL_SERVER - intran: ledger_t convert_port_to_ledger(mach_port_t) - outtran: mach_port_t convert_ledger_to_port(ledger_t) -#endif /* KERNEL_SERVER */ - ; - -type ledger_array_t = ^array[] of ledger_t; -type ledger_item_t = integer_t; - /* DEPRECATED */ - -type ledger_amount_t = int64_t; - -type security_token_t = struct[2] of uint32_t; -type audit_token_t = struct[8] of uint32_t; - -type msg_labels_t = mach_port_t; - - /* memory_object_info_t: variable-size inline array: - * memory_object_attr_info_t (5 ints) - * XXX actually it's 6 ints temporarily (object_ready!) - * memory_object_behave_info_t (4 ints) - * memory_object_perf_info_t (2 ints) - * old_memory_object_attr_info_t (3 ints) - * If other flavors are added, this definition may - * need to be changed. (see mach/memory_object.h) */ -type memory_object_flavor_t = int; -type memory_object_info_t = array[*:6] of int; - - /* vm_region_info_t: variable-size inline array that can hold: - * vm_region_basic_info_t (8 ints) - * If other flavors are added, this definition may - * need to be changed. (see mach/vm_region.h) */ -type vm_region_flavor_t = int; -type vm_region_info_t = array[*:10] of int; -type vm_region_recurse_info_t = array[*:19] of int; - -type vm_page_info_flavor_t = int; -type vm_page_info_t = array[*:32] of int; - -type mach_vm_read_entry_t = array[512] of mach_vm_offset_t; -type vm_read_entry_t = array[512] of vm_offset_t; -#if VM32_SUPPORT -type vm32_read_entry_t = array[512] of vm32_offset_t; -#endif - -type exception_mask_t = int; -type exception_behavior_t = int; - -type exception_handler_t = mach_port_t; - -type exception_handler_array_t = - array[*:32] of exception_handler_t; - -type exception_behavior_array_t = - array[*:32] of exception_behavior_t; - -type exception_flavor_array_t = - array[*:32] of thread_state_flavor_t; - -type exception_mask_array_t = - array[*:32] of exception_mask_t; - -type semaphore_t = mach_port_t -#if KERNEL_SERVER - intran: semaphore_t convert_port_to_semaphore(mach_port_t) - outtran: mach_port_t convert_semaphore_to_port(semaphore_t) - destructor: semaphore_dereference(semaphore_t) -#endif /* KERNEL_SERVER */ - ; - -type semaphore_consume_ref_t = mach_port_move_send_t - cusertype: semaphore_t -#if KERNEL_SERVER - intran: semaphore_t convert_port_to_semaphore(mach_port_t) - outtran: mach_port_t convert_semaphore_to_port(semaphore_t) - destructor: semaphore_dereference(semaphore_t) -#endif /* KERNEL_SERVER */ - ; - -type lock_set_t = mach_port_t -#if KERNEL_SERVER - intran: lock_set_t convert_port_to_lock_set(mach_port_t) - outtran: mach_port_t convert_lock_set_to_port(lock_set_t) - destructor: lock_set_dereference(lock_set_t) -#endif /* KERNEL_SERVER */ - ; - -type task_suspension_token_t = mach_port_move_send_once_t -#if KERNEL_SERVER - intran: task_suspension_token_t convert_port_to_task_suspension_token(mach_port_t) - outtran: mach_port_t convert_task_suspension_token_to_port(task_suspension_token_t) -#endif /* KERNEL_SERVER */ - ; - - -/* public voucher types */ - -/* Mach voucher object */ -type mach_voucher_t = mach_port_t; -type mach_voucher_name_t = mach_port_name_t; - -type mach_voucher_attr_manager_t = mach_port_t; -type mach_voucher_attr_control_t = mach_port_t; - -/* IPC voucher internal object */ -type ipc_voucher_t = mach_port_t -#if KERNEL_SERVER - intran: ipc_voucher_t convert_port_to_voucher(mach_port_t) - outtran: mach_port_t convert_voucher_to_port(ipc_voucher_t) - destructor: ipc_voucher_release(ipc_voucher_t) -#endif /* KERNEL_SERVER */ - ; - -/* IPC voucher attribute control internal object */ -type ipc_voucher_attr_control_t = mach_port_t -#if KERNEL_SERVER - intran: ipc_voucher_attr_control_t convert_port_to_voucher_attr_control(mach_port_t) - outtran: mach_port_t convert_voucher_attr_control_to_port(ipc_voucher_attr_control_t) - destructor: ipc_voucher_attr_control_release(ipc_voucher_attr_control_t) -#endif /* KERNEL_SERVER */ - ; - -type mach_voucher_attr_key_t = uint32_t; - -type mach_voucher_attr_command_t = uint32_t; -type mach_voucher_attr_recipe_command_t = uint32_t; - -type mach_voucher_attr_content_size_t = uint32_t; -type mach_voucher_attr_content_t = array[*:4096] of uint8_t; -type mach_voucher_attr_content_array_t = array[*:5120] of uint8_t; - -type mach_voucher_attr_raw_recipe_size_t = uint32_t; -type mach_voucher_attr_raw_recipe_t = array[*:4096] of uint8_t; -type mach_voucher_attr_raw_recipe_array_t = array[*:5120] of uint8_t; - -type mach_voucher_selector_t = uint32_t; - -type mach_voucher_attr_value_handle_t = uint64_t; -type mach_voucher_attr_value_handle_array_t = array[*:4] of mach_voucher_attr_value_handle_t; -type mach_voucher_attr_value_reference_t = uint32_t; - -/* kernel module loader */ -type kmod_t = int; -type kmod_control_flavor_t = int; - -type kmod_args_t = ^array[] of MACH_MSG_TYPE_BYTE - ctype: kmod_args_t; - -type io_master_t = mach_port_t; -type UNDServerRef = mach_port_t; - -#if KERNEL_SERVER -#ifdef MACH_KERNEL_PRIVATE -simport ; /* for voucher conversions */ -simport ; /* for null conversion */ -simport ; /* for task/thread conversion */ -simport ; /* for host/processor/pset conversions */ -simport ; /* for lock_set and semaphore conversions */ -simport ; /* for ledger conversions */ -simport ; /* for processor conversions */ -simport ; /* for lock-set conversions */ -simport ; /* for semaphore conversions */ -simport ; /* for memory object type conversions */ -simport ; /* for vm_map conversions */ -#endif /* MACH_KERNEL_PRIVATE */ - -simport ; /* pick up kernel-specific MIG things */ - -#endif /* KERNEL_SERVER */ - -import ; -import ; - -#endif /* _MACH_MACH_TYPES_DEFS_ */ - -/* vim: set ft=c : */ diff --git a/src/kernel/mach/mach_vm.defs b/src/kernel/mach/mach_vm.defs deleted file mode 100644 index 806215525..000000000 --- a/src/kernel/mach/mach_vm.defs +++ /dev/null @@ -1,528 +0,0 @@ -/* - * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. The rights granted to you under the License - * may not be used to create, or enable the creation or redistribution of, - * unlawful or unlicensed copies of an Apple operating system, or to - * circumvent, violate, or enable the circumvention or violation of, any - * terms of an Apple operating system software license agreement. - * - * Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ - */ -/* - * @OSF_FREE_COPYRIGHT@ - */ -/* - * Mach Operating System - * Copyright (c) 1991,1990,1989 Carnegie Mellon University - * All Rights Reserved. - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR - * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie Mellon - * the rights to redistribute these changes. - */ -/* - */ -/* - * File: mach/mach_vm.defs - * - * Exported kernel VM calls (for any task on the platform). - */ - -subsystem -#if KERNEL_SERVER - KernelServer -#endif /* KERNEL_SERVER */ -#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) - mach_vm -#else - vm_map_lp64_local -#endif - 4800; - -#include -#include -#include - -#if !KERNEL && !LIBSYSCALL_INTERFACE -#define PREFIX(NAME) _kernelrpc_ ## NAME -#else -#define PREFIX(NAME) NAME -#endif - -/* - * Allocate zero-filled memory in the address space - * of the target task, either at the specified address, - * or wherever space can be found (controlled by flags), - * of the specified size. The address at which the - * allocation actually took place is returned. - */ -#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) -routine PREFIX(mach_vm_allocate) ( - target : vm_task_entry_t; - inout address : mach_vm_address_t; - size : mach_vm_size_t; - flags : int); - -#else - -#if !KERNEL && !LIBSYSCALL_INTERFACE -skip; -#else -routine PREFIX(vm_allocate) ( - target : vm_task_entry_t; - inout address : mach_vm_address_t; - size : mach_vm_size_t; - flags : int); - -#endif - -#endif - - -/* - * Deallocate the specified range from the virtual - * address space of the target virtual memory map. - */ -#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) -routine PREFIX(mach_vm_deallocate) ( - target : vm_task_entry_t; - address : mach_vm_address_t; - size : mach_vm_size_t); - -#else - -#if !KERNEL && !LIBSYSCALL_INTERFACE -skip; -#else -routine PREFIX(vm_deallocate) ( - target : vm_task_entry_t; - address : mach_vm_address_t; - size : mach_vm_size_t); -#endif - -#endif - -/* - * Set the current or maximum protection attribute - * for the specified range of the virtual address - * space of the target virtual memory map. The current - * protection limits the memory access rights of threads - * within the map; the maximum protection limits the accesses - * that may be given in the current protection. - * Protections are specified as a set of {read, write, execute} - * *permissions*. - */ -#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) -routine PREFIX(mach_vm_protect) ( - target_task : vm_task_entry_t; - address : mach_vm_address_t; - size : mach_vm_size_t; - set_maximum : boolean_t; - new_protection : vm_prot_t); - - -#else - -#if !KERNEL && !LIBSYSCALL_INTERFACE -skip; -#else - -routine PREFIX(vm_protect) ( - target_task : vm_task_entry_t; - address : mach_vm_address_t; - size : mach_vm_size_t; - set_maximum : boolean_t; - new_protection : vm_prot_t); - -#endif - -#endif - -/* - * Set the inheritance attribute for the specified range - * of the virtual address space of the target address space. - * The inheritance value is one of {none, copy, share}, and - * specifies how the child address space should acquire - * this memory at the time of a task_create call. - */ -#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) -routine mach_vm_inherit( -#else -routine vm_inherit( -#endif - target_task : vm_task_entry_t; - address : mach_vm_address_t; - size : mach_vm_size_t; - new_inheritance : vm_inherit_t); - -/* - * Returns the contents of the specified range of the - * virtual address space of the target task. [The - * range must be aligned on a virtual page boundary, - * and must be a multiple of pages in extent. The - * protection on the specified range must permit reading.] - */ -#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) -routine PREFIX(mach_vm_read) ( -#else -routine PREFIX(vm_read) ( -#endif - target_task : vm_map_t; - address : mach_vm_address_t; - size : mach_vm_size_t; - out data : pointer_t); - -/* - * List corrollary to vm_read, returns mapped contents of specified - * ranges within target address space. - */ -#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) -routine mach_vm_read_list( -#else -routine vm_read_list( -#endif - target_task : vm_map_t; - inout data_list : mach_vm_read_entry_t; - count : natural_t); - -/* - * Writes the contents of the specified range of the - * virtual address space of the target task. [The - * range must be aligned on a virtual page boundary, - * and must be a multiple of pages in extent. The - * protection on the specified range must permit writing.] - */ -#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) -routine mach_vm_write( -#else -routine vm_write( -#endif - target_task : vm_map_t; - address : mach_vm_address_t; - data : pointer_t); - -/* - * Copy the contents of the source range of the virtual - * address space of the target task to the destination - * range in that same address space. [Both of the - * ranges must be aligned on a virtual page boundary, - * and must be multiples of pages in extent. The - * protection on the source range must permit reading, - * and the protection on the destination range must - * permit writing.] - */ -#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) -routine mach_vm_copy( -#else -routine vm_copy( -#endif - target_task : vm_map_t; - source_address : mach_vm_address_t; - size : mach_vm_size_t; - dest_address : mach_vm_address_t); - -/* - * Returns the contents of the specified range of the - * virtual address space of the target task. [There - * are no alignment restrictions, and the results will - * overwrite the area pointed to by data - which must - * already exist. The protection on the specified range - * must permit reading.] - */ -#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) -routine mach_vm_read_overwrite( -#else -routine vm_read_overwrite( -#endif - target_task : vm_map_t; - address : mach_vm_address_t; - size : mach_vm_size_t; - data : mach_vm_address_t; - out outsize : mach_vm_size_t); - - -#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) -routine mach_vm_msync( -#else -routine vm_msync( -#endif - target_task : vm_map_t; - address : mach_vm_address_t; - size : mach_vm_size_t; - sync_flags : vm_sync_t ); - -/* - * Set the paging behavior attribute for the specified range - * of the virtual address space of the target task. - * The behavior value is one of {default, random, forward - * sequential, reverse sequential} and indicates the expected - * page reference pattern for the specified range. - */ -#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) -routine mach_vm_behavior_set( -#else -routine vm_behavior_set( -#endif - target_task : vm_map_t; - address : mach_vm_address_t; - size : mach_vm_size_t; - new_behavior : vm_behavior_t); - - -/* - * Map a user-supplie memory object into the virtual address - * space of the target task. If desired (anywhere is TRUE), - * the kernel will find a suitable address range of the - * specified size; else, the specific address will be allocated. - * - * The beginning address of the range will be aligned on a virtual - * page boundary, be at or beyond the address specified, and - * meet the mask requirements (bits turned on in the mask must not - * be turned on in the result); the size of the range, in bytes, - * will be rounded up to an integral number of virtual pages. - * - * The memory in the resulting range will be associated with the - * specified memory object, with the beginning of the memory range - * referring to the specified offset into the memory object. - * - * The mapping will take the current and maximum protections and - * the inheritance attributes specified; see the vm_protect and - * vm_inherit calls for a description of these attributes. - * - * If desired (copy is TRUE), the memory range will be filled - * with a copy of the data from the memory object; this copy will - * be private to this mapping in this target task. Otherwise, - * the memory in this mapping will be shared with other mappings - * of the same memory object at the same offset (in this task or - * in other tasks). [The Mach kernel only enforces shared memory - * consistency among mappings on one host with similar page alignments. - * The user-defined memory manager for this object is responsible - * for further consistency.] - */ -#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) -routine PREFIX(mach_vm_map) ( -#else -#if defined(__arm__) && !LIBSYSCALL_INTERFACE -routine _vm_map_arm( -#else -routine PREFIX(vm_map) ( -#endif -#endif - target_task : vm_task_entry_t; - inout address : mach_vm_address_t; - size : mach_vm_size_t; - mask : mach_vm_offset_t; - flags : int; - object : mem_entry_name_port_t; - offset : memory_object_offset_t; - copy : boolean_t; - cur_protection : vm_prot_t; - max_protection : vm_prot_t; - inheritance : vm_inherit_t); - -/* - * Set/Get special properties of memory associated - * to some virtual address range, such as cachability, - * migrability, replicability. Machine-dependent. - */ -#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) -routine mach_vm_machine_attribute( -#else -routine vm_machine_attribute( -#endif - target_task : vm_map_t; - address : mach_vm_address_t; - size : mach_vm_size_t; - attribute : vm_machine_attribute_t; - inout value : vm_machine_attribute_val_t); - -/* - * Map portion of a task's address space. - */ -#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) -routine PREFIX(mach_vm_remap) ( -#else -routine PREFIX(vm_remap) ( -#endif - target_task : vm_map_t; - inout target_address : mach_vm_address_t; - size : mach_vm_size_t; - mask : mach_vm_offset_t; - flags : int; - src_task : vm_map_t; - src_address : mach_vm_address_t; - copy : boolean_t; - out cur_protection : vm_prot_t; - out max_protection : vm_prot_t; - inheritance : vm_inherit_t); - -/* - * Give the caller information on the given location in a virtual - * address space. If a page is mapped return ref and dirty info. - */ -#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) -routine mach_vm_page_query( -#else -routine vm_map_page_query( -#endif - target_map :vm_map_t; - offset :mach_vm_offset_t; - out disposition :integer_t; - out ref_count :integer_t); - - -#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) -routine mach_vm_region_recurse( -#else -routine vm_region_recurse_64( -#endif - target_task : vm_map_t; - inout address : mach_vm_address_t; - out size : mach_vm_size_t; - inout nesting_depth : natural_t; - out info : vm_region_recurse_info_t,CountInOut); - -/* - * Returns information about the contents of the virtual - * address space of the target task at the specified - * address. The returned protection, inheritance, sharing - * and memory object values apply to the entire range described - * by the address range returned; the memory object offset - * corresponds to the beginning of the address range. - * [If the specified address is not allocated, the next - * highest address range is described. If no addresses beyond - * the one specified are allocated, the call returns KERN_NO_SPACE.] - */ -#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) -routine mach_vm_region( -#else -routine vm_region_64( -#endif - target_task : vm_map_t; - inout address : mach_vm_address_t; - out size : mach_vm_size_t; - flavor : vm_region_flavor_t; - out info : vm_region_info_t, CountInOut; - out object_name : memory_object_name_t = - MACH_MSG_TYPE_MOVE_SEND - ctype: mach_port_t); - -/* - * Allow application level processes to create named entries which - * correspond to mapped portions of their address space. These named - * entries can then be manipulated, shared with other processes in - * other address spaces and ultimately mapped in ohter address spaces - * - * THIS INTERFACE IS STILL EVOLVING. - */ -#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) -#if !defined(__LP64__) || KERNEL_SERVER || XNU_KERNEL_PRIVATE || LIBSYSCALL_INTERFACE -routine _mach_make_memory_entry( -#else -routine mach_make_memory_entry( -#endif -#else -routine mach_make_memory_entry_64( -#endif - target_task :vm_map_t; - inout size :memory_object_size_t; - offset :memory_object_offset_t; - permission :vm_prot_t; - out object_handle :mem_entry_name_port_move_send_t; - parent_handle :mem_entry_name_port_t); - -/* - * Control behavior and investigate state of a "purgable" object in - * the virtual address space of the target task. A purgable object is - * created via a call to mach_vm_allocate() with VM_FLAGS_PURGABLE - * specified. See the routine implementation for a complete - * definition of the routine. - */ -#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) -routine mach_vm_purgable_control( -#else -routine vm_purgable_control( -#endif - target_task : vm_map_t; - address : mach_vm_address_t; - control : vm_purgable_t; - inout state : int); - - -#if !defined(_MACH_VM_PUBLISH_AS_LOCAL_) -routine mach_vm_page_info( - target_task : vm_map_t; - address : mach_vm_address_t; - flavor : vm_page_info_flavor_t; - out info : vm_page_info_t, CountInOut); -#else -skip; -#endif - -/****************************** Legacy section ***************************/ -/* The following definitions are exist to provide compatibility with */ -/* the legacy APIs. They are no different. We just need to produce */ -/* the user-level stub interface for them. */ -/****************************** Legacy section ***************************/ - - -/* - * These interfaces just aren't supported in the new (wide) model: - * - * mach_vm_region_info() - - * vm_map_pages_info() - - * no user-level replacement for these MACH_DEBUG interfaces - * vm_map_get_upl() - - * no user-level replacement at the moment - * vm_region_info() - - * use mach_vm_region_info() or vm_region_info_64() - * vm_region_recurse() - - * use mach_vm_region_recurse() or vm_region_recurse_64() - */ - -/* - * The following legacy interfaces are provides as macro wrappers to the new - * interfaces. You should strive to use the new ones instead: - * - * vm_map() - - * use mach_vm_map() or vm_map_64() - * vm_region() - - * use mach_vm_region() or vm_region_64() - * mach_make_memory_entry() - - * use mach_vm_make_memory_entry() or mach_make_memory_entry_64() - */ - -/* vim: set ft=c : */ diff --git a/src/kernel/mach/mach_voucher.defs b/src/kernel/mach/mach_voucher.defs deleted file mode 100644 index 6d370a5b2..000000000 --- a/src/kernel/mach/mach_voucher.defs +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2013 Apple Computer, Inc. All rights reserved. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. The rights granted to you under the License - * may not be used to create, or enable the creation or redistribution of, - * unlawful or unlicensed copies of an Apple operating system, or to - * circumvent, violate, or enable the circumvention or violation of, any - * terms of an Apple operating system software license agreement. - * - * Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ - */ - -subsystem -#if KERNEL_SERVER - KernelServer -#endif /* KERNEL_SERVER */ - mach_voucher 5400; - -#include -#include - -/* extract just the content data for a pair */ -routine mach_voucher_extract_attr_content( - voucher : ipc_voucher_t; - key : mach_voucher_attr_key_t; - out content : mach_voucher_attr_content_t, CountInOut); - -/* extract a recipe to reconstitue a pair item in a future voucher */ -routine mach_voucher_extract_attr_recipe( - voucher : ipc_voucher_t; - key : mach_voucher_attr_key_t; - out recipe : mach_voucher_attr_raw_recipe_t, CountInOut); - -/* extract a recipe array to reconstitue all the key values in a future voucher */ -routine mach_voucher_extract_all_attr_recipes( - voucher : ipc_voucher_t; - out recipes : mach_voucher_attr_raw_recipe_array_t, CountInOut); - -/* execute a command against a given voucher attribute */ -routine mach_voucher_attr_command( - voucher : ipc_voucher_t; - key : mach_voucher_attr_key_t; - command : mach_voucher_attr_command_t; - in_content : mach_voucher_attr_content_t; - out out_content : mach_voucher_attr_content_t, CountInOut); - -/* extract a recipe array to reconstitue all the key values in a future voucher */ -routine mach_voucher_debug_info( - task : ipc_space_t; - voucher_name: mach_port_name_t; - out recipes : mach_voucher_attr_raw_recipe_array_t, CountInOut); - -/* vim: set ft=c : */ diff --git a/src/kernel/mach/mach_voucher_attr_control.defs b/src/kernel/mach/mach_voucher_attr_control.defs deleted file mode 100644 index 89fb66cc8..000000000 --- a/src/kernel/mach/mach_voucher_attr_control.defs +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2013 Apple Computer, Inc. All rights reserved. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. The rights granted to you under the License - * may not be used to create, or enable the creation or redistribution of, - * unlawful or unlicensed copies of an Apple operating system, or to - * circumvent, violate, or enable the circumvention or violation of, any - * terms of an Apple operating system software license agreement. - * - * Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ - */ - -subsystem -#if KERNEL_SERVER - KernelServer -#endif /* KERNEL_SERVER */ - mach_voucher_attr_control 5600; - -#include -#include - -/* Extract the given voucher-control's value-handle from the supplied voucher */ -routine mach_voucher_attr_control_get_values( - control : ipc_voucher_attr_control_t; - voucher : ipc_voucher_t; - out value_handles : mach_voucher_attr_value_handle_array_t, CountInOut); - -/* Create a new voucher with the control's privilege (to directly assign value-handles) */ -routine mach_voucher_attr_control_create_mach_voucher( - control : ipc_voucher_attr_control_t; - recipes : mach_voucher_attr_raw_recipe_array_t; - out voucher : ipc_voucher_t); diff --git a/src/kernel/mach/memory_object.defs b/src/kernel/mach/memory_object.defs deleted file mode 100644 index e6f93082b..000000000 --- a/src/kernel/mach/memory_object.defs +++ /dev/null @@ -1,206 +0,0 @@ -/* - * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. The rights granted to you under the License - * may not be used to create, or enable the creation or redistribution of, - * unlawful or unlicensed copies of an Apple operating system, or to - * circumvent, violate, or enable the circumvention or violation of, any - * terms of an Apple operating system software license agreement. - * - * Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ - */ -/* - * @OSF_COPYRIGHT@ - */ -/* - * Mach Operating System - * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University - * All Rights Reserved. - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR - * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie Mellon - * the rights to redistribute these changes. - */ -/* - */ -/* - * File: mach/memory_object.defs - * - * Abstract: - * Basic Mach external memory management interface declaration. - */ - -subsystem -#if KERNEL_USER - KernelUser -#endif /* KERNEL_USER */ -#if KERNEL_SERVER - KernelServer -#endif /* KERNEL_SERVER */ - memory_object 2200; - -#include -#include - -#if KERNEL_SERVER -serverprefix dp_; -#endif - -/* - * Initialize the specified memory object, providing - * a memory object control reference on which to make - * cache control calls. - * [To allow the mapping of this object to be used, the - * memory manager must call memory_object_set_attributes, - * specifying the "ready" parameter as TRUE. To reject - * all mappings of this object, the memory manager may - * use memory_object_destroy.] - */ -routine memory_object_init( - memory_object : memory_object_t; - memory_control : memory_object_control_t; - memory_object_page_size : memory_object_cluster_size_t); - - -/* - * Indicates that the specified memory object is no longer - * mapped (or cached -- see memory_object_set_attributes), - * and that further mappings will cause another memory_object_init - * call to be made. - * - * [The kernel will release its reference on the memory object - * after this call returns. The memory object control associated - * with the memory object is no longer usable - the pager should - * drop the control reference granted to it by memory_object_init.] - */ -routine memory_object_terminate( - memory_object : memory_object_t); - -/* - * Request data from this memory object. At least - * the specified data should be returned with at - * least the specified access permitted. - * - * [Response should be upl commit over the specified range.] - */ -routine memory_object_data_request( - memory_object : memory_object_t; - offset : memory_object_offset_t; - length : memory_object_cluster_size_t; - desired_access : vm_prot_t; - fault_info : memory_object_fault_info_t); - -/* - * Return data to manager. This call is used in place of data_write - * for objects initialized by object_ready instead of set_attributes. - * This call indicates whether the returned data is dirty and whether - * the kernel kept a copy. Precious data remains precious if the - * kernel keeps a copy. The indication that the kernel kept a copy - * is only a hint if the data is not precious; the cleaned copy may - * be discarded without further notifying the manager. - * - * [response should be a upl_commit over the range specified] - */ -routine memory_object_data_return( - memory_object : memory_object_t; - offset : memory_object_offset_t; - size : memory_object_cluster_size_t; - out resid_offset : memory_object_offset_t; - out io_error : int; - dirty : boolean_t; - kernel_copy : boolean_t; - upl_flags : int); - -/* - * Provide initial data contents for this region of - * the memory object. If data has already been written - * to the object, this value must be discarded; otherwise, - * this call acts identically to memory_object_data_return. - * - * [response should be UPL commit over the specified range.] - */ -routine memory_object_data_initialize( - memory_object : memory_object_t; - offset : memory_object_offset_t; - size : memory_object_cluster_size_t); - -/* - * Request that the specified portion of this - * memory object be unlocked to allow the specified - * forms of access; the kernel already has the data. - * - * [Response should be memory_object_lock_request when - * the operation is fully complete.] - */ -routine memory_object_data_unlock( - memory_object : memory_object_t; - offset : memory_object_offset_t; - size : memory_object_size_t; - desired_access : vm_prot_t); - - -/* - * Request that the specified portion of this - * memory object be synchronized with its backing - * store according to the supplied flags. - * - * [Response should be memory_object_synchronize_completed when - * the operation is fully complete.] - */ -routine memory_object_synchronize( - memory_object : memory_object_t; - offset : memory_object_offset_t; - size : memory_object_size_t; - sync_flags : vm_sync_t ); - -/* - * Notify the pager that the specified memory object - * has no other (mapped) references besides the named - * reference held by the pager itself. - * - * [Response should be a release of the named reference when - * the pager deems that appropriate.] - */ -routine memory_object_map( - memory_object : memory_object_t; - prot : vm_prot_t); -routine memory_object_last_unmap( - memory_object : memory_object_t); - -routine memory_object_data_reclaim( - memory_object : memory_object_t; - reclaim_backing_store : boolean_t); - -/* vim: set ft=c : */ diff --git a/src/kernel/mach/memory_object_control.defs b/src/kernel/mach/memory_object_control.defs deleted file mode 100644 index e13d85b0e..000000000 --- a/src/kernel/mach/memory_object_control.defs +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. The rights granted to you under the License - * may not be used to create, or enable the creation or redistribution of, - * unlawful or unlicensed copies of an Apple operating system, or to - * circumvent, violate, or enable the circumvention or violation of, any - * terms of an Apple operating system software license agreement. - * - * Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ - */ -/* - * @OSF_COPYRIGHT@ - */ -/* - * Mach Operating System - * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University - * All Rights Reserved. - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR - * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie Mellon - * the rights to redistribute these changes. - */ -/* - */ -/* - * File: mach/memory_object_control.defs - * - * Abstract: - * Basic Mach external memory management interface declaration. - */ - -subsystem -#if KERNEL_USER - KernelUser -#endif /* KERNEL_USER */ -#if KERNEL_SERVER - KernelServer -#endif /* KERNEL_SERVER */ - memory_object_control 2000; - -#include -#include - -/* - * Retrieves the attributes currently associated with - * a memory object. - */ -routine memory_object_get_attributes( - memory_control : memory_object_control_t; - flavor : memory_object_flavor_t; - out attributes : memory_object_info_t, CountInOut); - - -routine memory_object_change_attributes( - memory_control : memory_object_control_t; - flavor : memory_object_flavor_t; - attributes : memory_object_info_t - ); - -routine memory_object_synchronize_completed ( - memory_control : memory_object_control_t; - offset : memory_object_offset_t; - length : memory_object_size_t); - -/* - * Control use of the data associated with the given - * memory object. For each page in the given range, - * perform the following operations, in order: - * 1) restrict access to the page (disallow - * forms specified by "prot"); - * 2) write back modifications (if "should_return" - * is RETURN_DIRTY and the page is dirty, or - * "should_return" is RETURN_ALL and the page - * is either dirty or precious); and, - * 3) flush the cached copy (if "should_flush" - * is asserted). - * The set of pages is defined by a starting offset - * ("offset") and size ("size"). Only pages with the - * same page alignment as the starting offset are - * considered. - */ -routine memory_object_lock_request( - memory_control : memory_object_control_t; - offset : memory_object_offset_t; - size : memory_object_size_t; - out resid_offset : memory_object_offset_t; - out io_errno : integer_t; - should_return : memory_object_return_t; - flags : integer_t; - lock_value : vm_prot_t - ); - - -/* - */ -routine memory_object_destroy( - memory_control : memory_object_control_t; - reason : kern_return_t); - -/* - * The pager gets memory_object_data_request and memory_object_data_return - * calls to inform it that data within the memory object needs to be - * manipulated. Those requests simply identify the range in the memory - * object that needs servicing, but not the data itself. The pager - * turns around and requests one (or several) Universal Page Lists (UPLs) - * from the VM cache object associated with the memory object via one - * of the following calls. These UPLs are then committed (or aborted) - * in whole (or in ranges) as the processing completes. - */ - -routine memory_object_upl_request( - memory_control : memory_object_control_t; - in offset : memory_object_offset_t; - in size : upl_size_t; - out upl : upl_t; - out page_list : upl_page_info_array_t, CountInOut; - in cntrl_flags : integer_t); - -routine memory_object_super_upl_request( - memory_control : memory_object_control_t; - in offset : memory_object_offset_t; - in size : upl_size_t; - in super_size : upl_size_t; - out upl : upl_t; - out page_list : upl_page_info_array_t, CountInOut; - in cntrl_flags : integer_t); - - -routine memory_object_cluster_size( - control : memory_object_control_t; - out start : memory_object_offset_t; - out length : vm_size_t; - out io_streaming : uint32_t; - in fault_info : memory_object_fault_info_t); - -/* - * This functions allows a single page to be manipulated with less overhead - * than creating a UPL. - */ -routine memory_object_page_op( - memory_control : memory_object_control_t; - in offset : memory_object_offset_t; - in ops : integer_t; - out phys_entry : uint32_t; - out flags : integer_t); - -routine memory_object_recover_named( - memory_control : memory_object_control_t; - in wait_on_terminating : boolean_t); - -routine memory_object_release_name( - memory_control : memory_object_control_t; - flags : integer_t); - -routine memory_object_range_op( - memory_control : memory_object_control_t; - in offset_beg : memory_object_offset_t; - in offset_end : memory_object_offset_t; - in ops : integer_t; - out range : integer_t); - -/* vim: set ft=c : */ diff --git a/src/kernel/mach/memory_object_default.defs b/src/kernel/mach/memory_object_default.defs deleted file mode 100644 index d168ebffe..000000000 --- a/src/kernel/mach/memory_object_default.defs +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. The rights granted to you under the License - * may not be used to create, or enable the creation or redistribution of, - * unlawful or unlicensed copies of an Apple operating system, or to - * circumvent, violate, or enable the circumvention or violation of, any - * terms of an Apple operating system software license agreement. - * - * Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ - */ -/* - * @OSF_COPYRIGHT@ - */ -/* - * Mach Operating System - * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University - * All Rights Reserved. - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR - * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie Mellon - * the rights to redistribute these changes. - */ -/* - */ -/* - * File: mach/memory_object_default.defs - * - * Abstract: - * Mach external memory management interface declaration; subset - * that is applicable to managers of kernel-created memory objects. - */ - -subsystem -#if KERNEL_USER - KernelUser -#endif /* KERNEL_USER */ -#if KERNEL_SERVER - KernelServer -#endif /* KERNEL_SERVER */ - memory_object_default 2250; - -#include -#include - -#if KERNEL_SERVER -serverprefix default_pager_; -#endif - -/* - * Pass on responsibility for the new kernel-created memory - * object. The port on which this request is that port - * (possibly a memory object itself) registered as the "default - * pager". Other arguments are as described for memory_object_init. - * [No reply required.] - */ -routine memory_object_create( - default_memory_manager : memory_object_default_t; - new_memory_object_size : vm_size_t; - out new_memory_object : memory_object_t); - -/* vim: set ft=c : */ diff --git a/src/kernel/mach/notify.defs b/src/kernel/mach/notify.defs deleted file mode 100644 index 4aece97bf..000000000 --- a/src/kernel/mach/notify.defs +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. The rights granted to you under the License - * may not be used to create, or enable the creation or redistribution of, - * unlawful or unlicensed copies of an Apple operating system, or to - * circumvent, violate, or enable the circumvention or violation of, any - * terms of an Apple operating system software license agreement. - * - * Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ - */ -/* - * @OSF_COPYRIGHT@ - */ -/* - * Mach Operating System - * Copyright (c) 1991,1990,1989 Carnegie Mellon University - * All Rights Reserved. - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR - * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie Mellon - * the rights to redistribute these changes. - */ -/* - */ - -subsystem -#if KERNEL_USER - KernelUser -#endif - notify 64; - -#include - -#if SEQNOS -serverprefix do_seqnos_; -serverdemux seqnos_notify_server; -#else /* !SEQNOS */ -serverprefix do_; -serverdemux notify_server; -#endif /* SEQNOS */ - -/* MACH_NOTIFY_FIRST: 0100 */ -skip; - -/* MACH_NOTIFY_PORT_DELETED: 0101 */ -simpleroutine mach_notify_port_deleted( - notify : mach_port_move_send_once_t; -#if SEQNOS - msgseqno seqno : mach_port_seqno_t; -#endif /* SEQNOS */ - name : mach_port_name_t); - -#if (KERNEL_USER | MACH_NOTIFY_SEND_POSSIBLE_EXPECTED) -/* MACH_NOTIFY_SEND_POSSIBLE: 0102 */ -simpleroutine mach_notify_send_possible( - notify : mach_port_move_send_once_t; -#if SEQNOS - msgseqno seqno : mach_port_seqno_t; -#endif /* SEQNOS */ - name : mach_port_name_t); -#else -skip; -#endif - -skip; /* was NOTIFY_OWNERSHIP_RIGHTS: 0103 */ - -skip; /* was NOTIFY_RECEIVE_RIGHTS: 0104 */ - -/* MACH_NOTIFY_PORT_DESTROYED: 0105 */ -simpleroutine mach_notify_port_destroyed( - notify : mach_port_move_send_once_t; -#if SEQNOS - msgseqno seqno : mach_port_seqno_t; -#endif /* SEQNOS */ - rights : mach_port_move_receive_t); - -/* MACH_NOTIFY_NO_SENDERS: 0106 */ -simpleroutine mach_notify_no_senders( - notify : mach_port_move_send_once_t; -#if SEQNOS - msgseqno seqno : mach_port_seqno_t; -#endif /* SEQNOS */ - mscount : mach_port_mscount_t); - -/* MACH_NOTIFY_SEND_ONCE: 0107 */ -simpleroutine mach_notify_send_once( - notify : mach_port_move_send_once_t -#if SEQNOS -; msgseqno seqno : mach_port_seqno_t -#endif /* SEQNOS */ - ); - -/* MACH_NOTIFY_DEAD_NAME: 0110 */ -simpleroutine mach_notify_dead_name( - notify : mach_port_move_send_once_t; -#if SEQNOS - msgseqno seqno : mach_port_seqno_t; -#endif /* SEQNOS */ - name : mach_port_name_t); - -/* vim: set ft=c : */ diff --git a/src/kernel/mach/processor.defs b/src/kernel/mach/processor.defs deleted file mode 100644 index 99ea969a7..000000000 --- a/src/kernel/mach/processor.defs +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. The rights granted to you under the License - * may not be used to create, or enable the creation or redistribution of, - * unlawful or unlicensed copies of an Apple operating system, or to - * circumvent, violate, or enable the circumvention or violation of, any - * terms of an Apple operating system software license agreement. - * - * Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ - */ -/* - * @OSF_FREE_COPYRIGHT@ - */ -/* - * Mach Operating System - * Copyright (c) 1991,1990,1989 Carnegie Mellon University - * All Rights Reserved. - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR - * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie Mellon - * the rights to redistribute these changes. - */ -/* - */ -/* - * File: mach/mach_port.defs - * Author: Rich Draves - * - * Exported kernel calls. - */ - -subsystem -#if KERNEL_SERVER - KernelServer -#endif /* KERNEL_SERVER */ - processor 3000; - -#include -#include - -/* - * References to processor objects are returned by: - * host_processors(host_priv_t,...); - */ -/* - * Start processor. - */ -routine processor_start( - processor : processor_t); - -/* - * Exit processor -- may not be restartable. - */ - -routine processor_exit( - processor : processor_t); - -/* - * Return information about this processor. - */ -routine processor_info( - processor : processor_t; - flavor : processor_flavor_t; - out host : host_t; - out processor_info_out: processor_info_t, CountInOut); - - -/* - * Do something machine-dependent to processor. - */ -routine processor_control( - processor : processor_t; - processor_cmd : processor_info_t); - -/* - * JMM - Keep processor_set related stuff at the end because - * they likely will be removed. - */ - -/* - * Assign processor to processor set. - */ -routine processor_assign( - processor : processor_t; - new_set : processor_set_t; - wait : boolean_t); - -/* - * Get current assignment for processor. - */ -routine processor_get_assignment( - processor : processor_t; - out assigned_set : processor_set_name_t); - -/* vim: set ft=c : */ diff --git a/src/kernel/mach/processor_set.defs b/src/kernel/mach/processor_set.defs deleted file mode 100644 index dc0f40774..000000000 --- a/src/kernel/mach/processor_set.defs +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. The rights granted to you under the License - * may not be used to create, or enable the creation or redistribution of, - * unlawful or unlicensed copies of an Apple operating system, or to - * circumvent, violate, or enable the circumvention or violation of, any - * terms of an Apple operating system software license agreement. - * - * Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ - */ -/* - * @OSF_FREE_COPYRIGHT@ - */ -/* - * Mach Operating System - * Copyright (c) 1991,1990,1989 Carnegie Mellon University - * All Rights Reserved. - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR - * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie Mellon - * the rights to redistribute these changes. - */ -/* - */ -/* - * File: mach/mach_port.defs - * Author: Rich Draves - * - * Exported kernel calls. - */ - -subsystem -#if KERNEL_SERVER - KernelServer -#endif /* KERNEL_SERVER */ - processor_set 4000; - -#include -#include - -/* - * Return scheduling statistics for a processor set. - */ -routine processor_set_statistics( - pset : processor_set_name_t; - flavor : processor_set_flavor_t; - out info_out : processor_set_info_t, CountInOut); - - -/* - * Destroy processor set. - */ -routine processor_set_destroy( - set : processor_set_t); - - -/* - * Set max priority for processor_set. - */ -routine processor_set_max_priority( - processor_set : processor_set_t; - max_priority : int; - change_threads : boolean_t); - -/* - * Enable policy for processor set - */ -routine processor_set_policy_enable( - processor_set : processor_set_t; - policy : int); - -/* - * Disable policy for processor set - */ -routine processor_set_policy_disable( - processor_set : processor_set_t; - policy : int; - change_threads : boolean_t); - -/* - * List all tasks in processor set. - */ -routine processor_set_tasks( - processor_set : processor_set_t; - out task_list : task_array_t); - -/* - * List all threads in processor set. - */ -routine processor_set_threads( - processor_set : processor_set_t; - out thread_list : thread_act_array_t); - -/* - * Controls the scheduling attributes governing the processor set. - * Allows control of enabled policies, and per-policy base and limit - * priorities. - */ -routine processor_set_policy_control( - pset : processor_set_t; - flavor : processor_set_flavor_t; - policy_info : processor_set_info_t; - change : boolean_t); - - -/* - * Debug Info - * This call is only valid on MACH_DEBUG kernels. - * Otherwise, KERN_FAILURE is returned. - */ -routine processor_set_stack_usage( - pset : processor_set_t; - out ltotal : unsigned; - out space : vm_size_t; - out resident : vm_size_t; - out maxusage : vm_size_t; - out maxstack : vm_offset_t); - -/* - * Get information about processor set. - */ -routine processor_set_info( - set_name : processor_set_name_t; - flavor : int; - out host : host_t; - out info_out : processor_set_info_t, CountInOut); - -/* vim: set ft=c : */ diff --git a/src/kernel/mach/prof.defs b/src/kernel/mach/prof.defs deleted file mode 100644 index a334d6c79..000000000 --- a/src/kernel/mach/prof.defs +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. The rights granted to you under the License - * may not be used to create, or enable the creation or redistribution of, - * unlawful or unlicensed copies of an Apple operating system, or to - * circumvent, violate, or enable the circumvention or violation of, any - * terms of an Apple operating system software license agreement. - * - * Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ - */ -/* - * @OSF_COPYRIGHT@ - */ -/* - * HISTORY - * - * Revision 1.1.1.1 1998/09/22 21:05:30 wsanchez - * Import of Mac OS X kernel (~semeria) - * - * Revision 1.1.1.1 1998/03/07 02:25:46 wsanchez - * Import of OSF Mach kernel (~mburg) - * - * Revision 1.2.12.3 1996/01/09 19:22:20 devrcs - * Change notices: msgoption options from int to mach_msg_options_t. - * [1995/12/01 19:49:49 jfraser] - * - * Merged '64-bit safe' changes from DEC alpha port. - * [1995/11/21 18:09:30 jfraser] - * - * Revision 1.2.12.2 1995/01/06 19:51:41 devrcs - * mk6 CR668 - 1.3b26 merge - * * Revision 1.2.2.4 1994/03/24 21:23:54 hidden - * added send_notices to support DCI profile/event tracing - * * End1.3merge - * [1994/11/02 18:32:19 dwm] - * - * Revision 1.2.12.1 1994/09/23 02:41:58 ezf - * change marker to not FREE - * [1994/09/22 21:42:31 ezf] - * - * Revision 1.2.2.2 1993/06/09 02:43:11 gm - * Added to OSF/1 R1.3 from NMK15.0. - * [1993/06/02 21:18:01 jeffc] - * - * Revision 1.2 1993/04/19 16:38:55 devrcs - * [0014] Change subsystem number as current shared with exc.defs reply messages. - * [1992/12/23 13:11:20 david] - * - * Revision 1.1 1992/09/30 02:23:01 robert - * Initial revision - * - * $EndLog$ - */ -/* CMU_HIST */ -/* - * Revision 2.1.2.1 92/09/15 17:25:42 jeffreyh - * Created - * [92/07/17 bernadat] - * - */ -/* CMU_ENDHIST */ -/* - * Mach Operating System - * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University - * All Rights Reserved. - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR - * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie Mellon - * the rights to redistribute these changes. - */ -/* - */ -/* - * Abstract: - * MiG definitions file for Mach Profiling interface. - * receive_samples(); - */ - -subsystem -#if KERNEL_USER - KernelUser -#endif KERNEL_USER - prof 2450; /* exc.defs from 2400 - 2449 */ - -#include -#include - -ServerPrefix receive_; -UserPrefix send_; - -type sample_array_t = array[*:1024] of unsigned; - -simpleroutine samples( - reply_port : mach_port_t; - samples : sample_array_t); - -simpleroutine notices( - reply_port : mach_port_t; - samples : sample_array_t; - msgoption options : mach_msg_options_t); - -/* vim: set ft=c : */ diff --git a/src/kernel/mach/semaphore.defs b/src/kernel/mach/semaphore.defs deleted file mode 100644 index bbbdbedb1..000000000 --- a/src/kernel/mach/semaphore.defs +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. The rights granted to you under the License - * may not be used to create, or enable the creation or redistribution of, - * unlawful or unlicensed copies of an Apple operating system, or to - * circumvent, violate, or enable the circumvention or violation of, any - * terms of an Apple operating system software license agreement. - * - * Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ - */ -/* - * @OSF_COPYRIGHT@ - * - */ -/* - * File: mach/semaphore.defs - * Author: Joseph CaraDonna - * - * Exported kernel calls - * - */ - -subsystem -#if KERNEL_SERVER - KernelServer -#endif /* KERNEL_SERVER */ - semaphore 617200; - -#include -#include -#include - -/* - * a semaphore_t is created and destroyed through the task object. - * semaphore_create(task_t,&semaphore_t,...); - * semaphore_destroy(task_t,semaphore_t); - */ - -routine semaphore_signal( - semaphore : semaphore_t); - -routine semaphore_signal_all( - semaphore : semaphore_t); - -routine semaphore_wait( - semaphore : semaphore_t); - - -routine semaphore_signal_thread( - semaphore : semaphore_t; - thread : thread_act_t); - -routine semaphore_timedwait( - semaphore : semaphore_t; - wait_time : mach_timespec_t); - -routine semaphore_wait_signal( - wait_semaphore : semaphore_t; - signal_semaphore: semaphore_t); - -routine semaphore_timedwait_signal( - wait_semaphore : semaphore_t; - signal_semaphore: semaphore_t; - wait_time : mach_timespec_t); - -/* vim: set ft=c : */ diff --git a/src/kernel/mach/std_types.defs b/src/kernel/mach/std_types.defs deleted file mode 100644 index 0b483836f..000000000 --- a/src/kernel/mach/std_types.defs +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (c) 2002,2000 Apple Computer, Inc. All rights reserved. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. The rights granted to you under the License - * may not be used to create, or enable the creation or redistribution of, - * unlawful or unlicensed copies of an Apple operating system, or to - * circumvent, violate, or enable the circumvention or violation of, any - * terms of an Apple operating system software license agreement. - * - * Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ - */ -/* - * @OSF_COPYRIGHT@ - */ -/* - * Mach Operating System - * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University - * All Rights Reserved. - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR - * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie Mellon - * the rights to redistribute these changes. - */ -/* - */ -/* - * Mach kernel standard interface type declarations - */ - -#ifndef _MACH_STD_TYPES_DEFS_ -#define _MACH_STD_TYPES_DEFS_ - -/* from ISO/IEC 988:1999 spec */ -/* 7.18.1.1 Exact-width integer types */ - -type int8_t = MACH_MSG_TYPE_INTEGER_8; -type uint8_t = MACH_MSG_TYPE_INTEGER_8; -type int16_t = MACH_MSG_TYPE_INTEGER_16; -type uint16_t = MACH_MSG_TYPE_INTEGER_16; -type int32_t = MACH_MSG_TYPE_INTEGER_32; -type uint32_t = MACH_MSG_TYPE_INTEGER_32; -type int64_t = MACH_MSG_TYPE_INTEGER_64; -type uint64_t = MACH_MSG_TYPE_INTEGER_64; - -/* - * Legacy fixed-length Mach types which should - * be replaced with the Standard types from above. - */ -type int32 = int32_t; -type unsigned32 = uint32_t; -type int64 = int64_t; -type unsigned64 = uint64_t; - -/* - * Other fixed length Mach types. - */ -type char = MACH_MSG_TYPE_CHAR; -type boolean_t = MACH_MSG_TYPE_BOOLEAN; - -#include - -type kern_return_t = int; - -type pointer_t = ^array[] of MACH_MSG_TYPE_BYTE - ctype: vm_offset_t; - - -type mach_port_t = MACH_MSG_TYPE_COPY_SEND; -type mach_port_array_t = array[] of mach_port_t; - -type mach_port_name_t = MACH_MSG_TYPE_PORT_NAME; -type mach_port_name_array_t = array[] of mach_port_name_t; - -type mach_port_right_t = natural_t; - -type mach_port_type_t = natural_t; -type mach_port_type_array_t = array[] of mach_port_type_t; - -type mach_port_urefs_t = natural_t; -type mach_port_delta_t = integer_t; -type mach_port_seqno_t = natural_t; -type mach_port_mscount_t = unsigned; -type mach_port_msgcount_t = unsigned; -type mach_port_rights_t = unsigned; -type mach_msg_id_t = integer_t; -type mach_msg_size_t = natural_t; -type mach_msg_type_name_t = unsigned; -type mach_msg_options_t = integer_t; - -type mach_port_move_receive_t = MACH_MSG_TYPE_MOVE_RECEIVE - ctype: mach_port_t; -type mach_port_copy_send_t = MACH_MSG_TYPE_COPY_SEND - ctype: mach_port_t; -type mach_port_make_send_t = MACH_MSG_TYPE_MAKE_SEND - ctype: mach_port_t; -type mach_port_move_send_t = MACH_MSG_TYPE_MOVE_SEND - ctype: mach_port_t; -type mach_port_make_send_once_t = MACH_MSG_TYPE_MAKE_SEND_ONCE - ctype: mach_port_t; -type mach_port_move_send_once_t = MACH_MSG_TYPE_MOVE_SEND_ONCE - ctype: mach_port_t; - -type mach_port_receive_t = MACH_MSG_TYPE_PORT_RECEIVE - ctype: mach_port_t; -type mach_port_send_t = MACH_MSG_TYPE_PORT_SEND - ctype: mach_port_t; -type mach_port_send_once_t = MACH_MSG_TYPE_PORT_SEND_ONCE - ctype: mach_port_t; - -type mach_port_poly_t = polymorphic - ctype: mach_port_t; - -import ; -import ; - -#endif /* _MACH_STD_TYPES_DEFS_ */ - -/* vim: set ft=c : */ diff --git a/src/kernel/mach/sync.defs b/src/kernel/mach/sync.defs deleted file mode 100644 index 92ce0eb14..000000000 --- a/src/kernel/mach/sync.defs +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. The rights granted to you under the License - * may not be used to create, or enable the creation or redistribution of, - * unlawful or unlicensed copies of an Apple operating system, or to - * circumvent, violate, or enable the circumvention or violation of, any - * terms of an Apple operating system software license agreement. - * - * Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ - */ -/* - * @OSF_COPYRIGHT@ - * - */ -/* - * File: mach/sync.defs - * Author: Joseph CaraDonna - * - * Exported kernel calls - * - */ - -subsystem -#if KERNEL_SERVER - KernelServer -#endif /* KERNEL_SERVER */ - sync 617000; - -#include -#include -#include - -#if KERNEL_SERVER -import ; -import ; -import ; -#endif /* KERNEL_SERVER */ - - -type semaphore_t = mach_port_t - ctype: mach_port_t -#if KERNEL_SERVER - intran: semaphore_t convert_port_to_semaphore(mach_port_t) - outtran: mach_port_t convert_semaphore_to_port(semaphore_t) - destructor: semaphore_dereference(semaphore_t) -#endif /* KERNEL_SERVER */ - ; - -type semaphore_consume_ref_t = mach_port_move_send_t - ctype: mach_port_t -#if KERNEL_SERVER - intran: semaphore_t convert_port_to_semaphore(mach_port_t) - destructor: semaphore_dereference(semaphore_t) -#endif /* KERNEL_SERVER */ - ; - -type lock_set_t = mach_port_t - ctype: mach_port_t -#if KERNEL_SERVER - intran: lock_set_t convert_port_to_lock_set(mach_port_t) - outtran: mach_port_t convert_lock_set_to_port(lock_set_t) - destructor: lock_set_dereference(lock_set_t) -#endif /* KERNEL_SERVER */ - ; - - -routine semaphore_create( - task : task_t; - out semaphore : semaphore_t; - policy : int; - value : int); - -routine semaphore_destroy( - task : task_t; - semaphore : semaphore_consume_ref_t); - -routine semaphore_signal( - semaphore : semaphore_t); - -routine semaphore_signal_all( - semaphore : semaphore_t); - -routine semaphore_wait( - semaphore : semaphore_t); - -routine lock_set_create( - task : task_t; - out new_lock_set : lock_set_t; - n_ulocks : int; - policy : int); - -routine lock_set_destroy( - task : task_t; - lock_set : lock_set_t); - -routine lock_acquire( - lock_set : lock_set_t; - lock_id : int); - -routine lock_release( - lock_set : lock_set_t; - lock_id : int); - -routine lock_try( - lock_set : lock_set_t; - lock_id : int); - -routine lock_make_stable( - lock_set : lock_set_t; - lock_id : int); - -routine lock_handoff( - lock_set : lock_set_t; - lock_id : int); - -routine lock_handoff_accept( - lock_set : lock_set_t; - lock_id : int); - -routine semaphore_signal_thread( - semaphore : semaphore_t; - thread : thread_act_t); - -routine semaphore_timedwait( - semaphore : semaphore_t; - wait_time : mach_timespec_t); - -/* vim: set ft=c : */ diff --git a/src/kernel/mach/task.defs b/src/kernel/mach/task.defs deleted file mode 100644 index 4d4db4dfe..000000000 --- a/src/kernel/mach/task.defs +++ /dev/null @@ -1,454 +0,0 @@ -/* - * Copyright (c) 2000-2007 Apple Inc. All rights reserved. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. The rights granted to you under the License - * may not be used to create, or enable the creation or redistribution of, - * unlawful or unlicensed copies of an Apple operating system, or to - * circumvent, violate, or enable the circumvention or violation of, any - * terms of an Apple operating system software license agreement. - * - * Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ - */ -/* - * @OSF_FREE_COPYRIGHT@ - */ -/* - * Mach Operating System - * Copyright (c) 1991,1990,1989 Carnegie Mellon University - * All Rights Reserved. - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR - * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie Mellon - * the rights to redistribute these changes. - */ -/* - */ -/* - * File: mach/mach_port.defs - * Author: Rich Draves - * - * Exported kernel calls. - */ - -subsystem -#if KERNEL_SERVER - KernelServer -#endif /* KERNEL_SERVER */ - task 3400; - -#include -#include -#include - -/* - * Create a new task with an empty set of IPC rights, - * and having an address space constructed from the - * target task (or empty, if inherit_memory is FALSE). - */ -routine task_create( - target_task : task_t; - ledgers : ledger_array_t; - inherit_memory : boolean_t; - out child_task : task_t); - -/* - * Destroy the target task, causing all of its threads - * to be destroyed, all of its IPC rights to be deallocated, - * and all of its address space to be deallocated. - */ -routine task_terminate( - target_task : task_t); - -/* - * Returns the set of threads belonging to the target task. - */ -routine task_threads( - target_task : task_t; - out act_list : thread_act_array_t); - -/* - * Stash a handful of ports for the target task; child - * tasks inherit this stash at task_create time. - */ -routine mach_ports_register( - target_task : task_t; - init_port_set : mach_port_array_t = - ^array[] of mach_port_t); - -/* - * Retrieve the stashed ports for the target task. - */ -routine mach_ports_lookup( - target_task : task_t; - out init_port_set : mach_port_array_t = - ^array[] of mach_port_t); - -/* - * Returns information about the target task. - */ -routine task_info( - target_task : task_name_t; - flavor : task_flavor_t; - out task_info_out : task_info_t, CountInOut); - -/* - * Set task information. - */ -routine task_set_info( - target_task : task_t; - flavor : task_flavor_t; - task_info_in : task_info_t); - -/* - * Increment the suspend count for the target task. - * No threads within a task may run when the suspend - * count for that task is non-zero. - */ -routine task_suspend( - target_task : task_t); - - -/* - * Decrement the suspend count for the target task, - * if the count is currently non-zero. If the resulting - * suspend count is zero, then threads within the task - * that also have non-zero suspend counts may execute. - */ -routine task_resume( - target_task : task_t); - -/* - * Returns the current value of the selected special port - * associated with the target task. - */ -routine task_get_special_port( - task : task_t; - which_port : int; - out special_port : mach_port_t); - -/* - * Set one of the special ports associated with the - * target task. - */ -routine task_set_special_port( - task : task_t; - which_port : int; - special_port : mach_port_t); - -/* - * Create a new thread within the target task, returning - * the port representing the first thr_act in that new thread. The - * initial execution state of the thread is undefined. - */ -routine -#ifdef KERNEL_SERVER -thread_create_from_user( -#else -thread_create( -#endif - parent_task : task_t; - out child_act : thread_act_t); - -/* - * Create a new thread within the target task, returning - * the port representing that new thread. The new thread - * is not suspended; its initial execution state is given - * by flavor and new_state. Returns the port representing - * the new thread. - */ -routine -#ifdef KERNEL_SERVER -thread_create_running_from_user( -#else -thread_create_running( -#endif - parent_task : task_t; - flavor : thread_state_flavor_t; - new_state : thread_state_t; - out child_act : thread_act_t); - -/* - * Set an exception handler for a task on one or more exception types. - * These handlers are invoked for all threads in the task if there are - * no thread-specific exception handlers or those handlers returned an - * error. - */ -routine task_set_exception_ports( - task : task_t; - exception_mask : exception_mask_t; - new_port : mach_port_t; - behavior : exception_behavior_t; - new_flavor : thread_state_flavor_t); - - -/* - * Lookup some of the old exception handlers for a task - */ -routine task_get_exception_ports( - task : task_t; - exception_mask : exception_mask_t; - out masks : exception_mask_array_t; - out old_handlers : exception_handler_array_t, SameCount; - out old_behaviors : exception_behavior_array_t, SameCount; - out old_flavors : exception_flavor_array_t, SameCount); - - -/* - * Set an exception handler for a thread on one or more exception types. - * At the same time, return the previously defined exception handlers for - * those types. - */ -routine task_swap_exception_ports( - task : task_t; - exception_mask : exception_mask_t; - new_port : mach_port_t; - behavior : exception_behavior_t; - new_flavor : thread_state_flavor_t; - out masks : exception_mask_array_t; - out old_handlerss : exception_handler_array_t, SameCount; - out old_behaviors : exception_behavior_array_t, SameCount; - out old_flavors : exception_flavor_array_t, SameCount); - -/* - * OBSOLETE interface. - */ -routine lock_set_create( - task : task_t; - out new_lock_set : lock_set_t; - n_ulocks : int; - policy : int); - -/* - * OBSOLETE interface. - */ -routine lock_set_destroy( - task : task_t; - lock_set : lock_set_t); - -/* - * Create and destroy semaphore synchronizers on a - * per-task basis (i.e. the task owns them). - */ - -routine semaphore_create( - task : task_t; - out semaphore : semaphore_t; - policy : int; - value : int); - -routine semaphore_destroy( - task : task_t; - semaphore : semaphore_consume_ref_t); - -/* - * Set/get policy information for a task. - * (Approved Mac OS X microkernel interface) - */ - -routine task_policy_set( - task : task_t; - flavor : task_policy_flavor_t; - policy_info : task_policy_t); - -routine task_policy_get( - task : task_t; - flavor : task_policy_flavor_t; -out policy_info : task_policy_t, CountInOut; -inout get_default : boolean_t); - -/* - * Removed from the kernel. - */ -#if KERNEL_SERVER -skip; -#else -routine task_sample( - task : task_t; - reply : mach_port_make_send_t); -#endif - -/* - * JMM - Everything from here down is likely to go away soon - */ -/* - * OBSOLETE interface. - */ -routine task_policy( - task : task_t; - policy : policy_t; - base : policy_base_t; - set_limit : boolean_t; - change : boolean_t); - - -/* - * Establish a user-level handler for the specified - * system call. - */ -routine task_set_emulation( - target_port : task_t; - routine_entry_pt: vm_address_t; - routine_number : int); - -/* - * Get user-level handler entry points for all - * emulated system calls. - */ -routine task_get_emulation_vector( - task : task_t; - out vector_start : int; - out emulation_vector: emulation_vector_t); - -/* - * Establish user-level handlers for the specified - * system calls. Non-emulated system calls are specified - * with emulation_vector[i] == EML_ROUTINE_NULL. - */ -routine task_set_emulation_vector( - task : task_t; - vector_start : int; - emulation_vector: emulation_vector_t); - - -/* - * Establish restart pc for interrupted atomic sequences. - */ -routine task_set_ras_pc( - target_task : task_t; - basepc : vm_address_t; - boundspc : vm_address_t); - - -/* - * Return zone info as seen/used by this task. - */ -routine task_zone_info( - target_task : task_t; - out names : mach_zone_name_array_t, - Dealloc; - out info : task_zone_info_array_t, - Dealloc); - - -/* - * JMM - Want to eliminate processor_set so keep them at the end. - */ - -/* - * Assign task to processor set. - */ -routine task_assign( - task : task_t; - new_set : processor_set_t; - assign_threads : boolean_t); - -/* - * Assign task to default set. - */ -routine task_assign_default( - task : task_t; - assign_threads : boolean_t); - -/* - * Get current assignment for task. - */ -routine task_get_assignment( - task : task_t; - out assigned_set : processor_set_name_t); - -/* - * OBSOLETE interface. - */ -routine task_set_policy( - task : task_t; - pset : processor_set_t; - policy : policy_t; - base : policy_base_t; - limit : policy_limit_t; - change : boolean_t); - -/* - * Read the selected state which is to be installed on new - * threads in the task as they are created. - */ -routine task_get_state( - task : task_t; - flavor : thread_state_flavor_t; - out old_state : thread_state_t, CountInOut); - -/* - * Set the selected state information to be installed on - * all subsequently created threads in the task. - */ -routine task_set_state( - task : task_t; - flavor : thread_state_flavor_t; - new_state : thread_state_t); - -/* - * Change the task's physical footprint limit (in MB). - */ -routine task_set_phys_footprint_limit( - task : task_t; - new_limit : int; - out old_limit : int); - -routine task_suspend2( - target_task : task_t; - out suspend_token : task_suspension_token_t); - -routine task_resume2( - suspend_token : task_suspension_token_t); - -routine task_purgable_info( - task : task_t; - out stats : task_purgable_info_t); - -routine task_get_mach_voucher( - task : task_t; - which : mach_voucher_selector_t; - out voucher : ipc_voucher_t); - -routine task_set_mach_voucher( - task : task_t; - voucher : ipc_voucher_t); - -routine task_swap_mach_voucher( - task : task_t; - new_voucher : ipc_voucher_t; - inout old_voucher : ipc_voucher_t); - -/* vim: set ft=c : */ - diff --git a/src/kernel/mach/task_access.defs b/src/kernel/mach/task_access.defs deleted file mode 100644 index 1696fd3cf..000000000 --- a/src/kernel/mach/task_access.defs +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2006 Apple Computer, Inc. All rights reserved. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. The rights granted to you under the License - * may not be used to create, or enable the creation or redistribution of, - * unlawful or unlicensed copies of an Apple operating system, or to - * circumvent, violate, or enable the circumvention or violation of, any - * terms of an Apple operating system software license agreement. - * - * Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ - */ -/* - * @OSF_COPYRIGHT@ - */ - -subsystem -#if KERNEL_USER - KernelUser -#endif /* KERN_USER */ - task_access 27000; - -#include -#include - -/* - * Verify task_for_pid access for the given pid - * Access granted by return value (success/failure) - */ -routine check_task_access( - task_access_port : mach_port_t; - calling_pid : int32_t; - calling_gid : uint32_t; - target_pid : int32_t; - ServerAuditToken caller_cred : audit_token_t); - -/* - * Search for a code signature for unsigned executables - */ -routine find_code_signature( - task_access_port : mach_port_t; - new_pid : int32_t); - -/* vim: set ft=c : */ diff --git a/src/kernel/mach/telemetry_notification.defs b/src/kernel/mach/telemetry_notification.defs deleted file mode 100644 index 4b9f8a590..000000000 --- a/src/kernel/mach/telemetry_notification.defs +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2012, Apple Inc. All rights reserved. - */ - - /* - * Interface definition for the telemetry facility. - */ - -subsystem -#if KERNEL_USER - KernelUser -#endif /* KERNEL_USER */ - telemetry_notification 5100; - -#include -#include - -simpleroutine telemetry_notification( - RequestPort telemetry_port : mach_port_t; - in flags : uint32_t); diff --git a/src/kernel/mach/thread_act.defs b/src/kernel/mach/thread_act.defs deleted file mode 100644 index 872f1b1aa..000000000 --- a/src/kernel/mach/thread_act.defs +++ /dev/null @@ -1,353 +0,0 @@ -/* - * Copyright (c) 2000-2007 Apple Inc. All rights reserved. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. The rights granted to you under the License - * may not be used to create, or enable the creation or redistribution of, - * unlawful or unlicensed copies of an Apple operating system, or to - * circumvent, violate, or enable the circumvention or violation of, any - * terms of an Apple operating system software license agreement. - * - * Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ - */ -/* - * @OSF_FREE_COPYRIGHT@ - */ -/* - * Mach Operating System - * Copyright (c) 1991,1990,1989 Carnegie Mellon University - * All Rights Reserved. - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR - * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie Mellon - * the rights to redistribute these changes. - */ -/* - */ -/* - * File: mach/mach_port.defs - * Author: Rich Draves - * - * Exported kernel calls. - */ - -subsystem -#if KERNEL_SERVER - KernelServer -#endif /* KERNEL_SERVER */ - thread_act 3600; - -#include -#include - -#if !KERNEL && !LIBSYSCALL_INTERFACE -#define PREFIX(NAME) _kernelrpc_ ## NAME -#else -#define PREFIX(NAME) NAME -#endif - -/* - * Destroy the target thread. - * - * JMM - For legacy reasons this consumes a reference to the - * target thread. This will have to change in the future because - * we want the interfaces to be able to be defined in more standard - * IDLs and transports, and most of them do not support the notion - * of reference ownership transfers (just sharing). - */ -routine thread_terminate( - target_act : thread_act_consume_ref_t); - - -/* - * Return the selected state information for the target - * thr_act. If the thr_act is currently executing, the results - * may be stale. [Flavor THREAD_STATE_FLAVOR_LIST provides a - * list of valid flavors for the target thread.] - */ -routine act_get_state( - target_act : thread_act_t; - flavor : int; - out old_state : thread_state_t, CountInOut); - -/* - * Set the selected state information for the target thread. - * If the thread is currently executing, the state change - * may be ill-defined. - */ -routine -#ifdef KERNEL_SERVER -act_set_state_from_user( -#else -act_set_state( -#endif - target_act : thread_act_t; - flavor : int; - new_state : thread_state_t); - -/* - * Backward compatible old-style thread routines. - * These have different semantics than the new activation versions. - * - * Return the selected state information for the target - * thread. If the thread is currently executing, the results - * may be stale. [Flavor THREAD_STATE_FLAVOR_LIST provides a - * list of valid flavors for the target thr_act.] - */ -routine thread_get_state( - target_act : thread_act_t; - flavor : thread_state_flavor_t; - out old_state : thread_state_t, CountInOut); - -/* - * Set the selected state information for the target thread. - * If the thread is currently executing, the state change - * may be ill-defined. - */ -routine -#ifdef KERNEL_SERVER -thread_set_state_from_user( -#else -thread_set_state( -#endif - target_act : thread_act_t; - flavor : thread_state_flavor_t; - new_state : thread_state_t); - -/* - * Increment the suspend count for the target thread. - * Once this call has completed, the thread will not - * execute any further user or meta- instructions. - * Once suspended, a thread may not execute again until - * its suspend count is zero, and the suspend count - * for its task is also zero. - */ -routine thread_suspend( - target_act : thread_act_t); - -/* - * Decrement the suspend count for the target thread, - * if that count is not already zero. - */ -routine thread_resume( - target_act : thread_act_t); - -/* - * Cause any user or meta- instructions currently being - * executed by the target thread to be aborted. [Meta- - * instructions consist of the basic traps for IPC - * (e.g., msg_send, msg_receive) and self-identification - * (e.g., task_self, thread_self, thread_reply). Calls - * described by MiG interfaces are not meta-instructions - * themselves.] - */ -routine thread_abort( - target_act : thread_act_t); - -/* - * Cause any user or meta- instructions currently being - * executed by the target thread to be aborted so that - * they are transparently restartable. This call fails - * if the abort would result in a non-restartable condition. - * Retry is the caller's responsibility. [Meta- - * instructions consist of the basic traps for IPC - * (e.g., msg_send, msg_receive) and self-identification - * (e.g., task_self, thread_self, thread_reply). Calls - * described by MiG interfaces are not meta-instructions - * themselves.] - */ -routine thread_abort_safely( - target_act : thread_act_t); - - -routine thread_depress_abort( - thread : thread_act_t); - - -/* - * Returns the current value of the selected special port - * associated with the target thread. - */ -routine thread_get_special_port( - thr_act : thread_act_t; - which_port : int; - out special_port : mach_port_t); - -/* - * Set one of the special ports associated with the - * target thread. - */ -routine thread_set_special_port( - thr_act : thread_act_t; - which_port : int; - special_port : mach_port_t); - -/* - * Returns information about the target thread. - */ -routine thread_info( - target_act : thread_act_t; - flavor : thread_flavor_t; - out thread_info_out : thread_info_t, CountInOut); - -/* - * Set an exception handler for a thread on one or more exception types - */ -routine thread_set_exception_ports( - thread : thread_act_t; - exception_mask : exception_mask_t; - new_port : mach_port_t; - behavior : exception_behavior_t; - new_flavor : thread_state_flavor_t); - -/* - * Lookup some of the old exception handlers for a thread - */ -routine thread_get_exception_ports( - thread : thread_act_t; - exception_mask : exception_mask_t; - out masks : exception_mask_array_t; - out old_handlers : exception_handler_array_t, SameCount; - out old_behaviors : exception_behavior_array_t, SameCount; - out old_flavors : exception_flavor_array_t, SameCount); - -/* - * Set an exception handler for a thread on one or more exception types. - * At the same time, return the previously defined exception handlers for - * those types. - */ -routine thread_swap_exception_ports( - thread : thread_act_t; - exception_mask : exception_mask_t; - new_port : mach_port_t; - behavior : exception_behavior_t; - new_flavor : thread_state_flavor_t; - out masks : exception_mask_array_t; - out old_handlers : exception_handler_array_t, SameCount; - out old_behaviors : exception_behavior_array_t, SameCount; - out old_flavors : exception_flavor_array_t, SameCount); - -/* - * OBSOLETE interface. - */ -routine PREFIX(thread_policy)( - thr_act : thread_act_t; - policy : policy_t; - base : policy_base_t; - set_limit : boolean_t); - -/* - * Set/get policy information for a thread. - * (Approved Mac OS X microkernel interface) - */ - -routine PREFIX(thread_policy_set)( - thread : thread_act_t; - flavor : thread_policy_flavor_t; - policy_info : thread_policy_t); - -routine thread_policy_get( - thread : thread_act_t; - flavor : thread_policy_flavor_t; -out policy_info : thread_policy_t, CountInOut; -inout get_default : boolean_t); - -/* - * Removed from the kernel. - */ -#if KERNEL_SERVER -skip; -#else -routine thread_sample( - thread : thread_act_t; - reply : mach_port_make_send_t); -#endif - -/* - * ETAP has been removed from the kernel. - */ -#if KERNEL_SERVER -skip; -#else -routine etap_trace_thread( - target_act : thread_act_t; - trace_status : boolean_t); -#endif - -/* - * Assign thread to processor set. - */ -routine thread_assign( - thread : thread_act_t; - new_set : processor_set_t); - -/* - * Assign thread to default set. - */ -routine thread_assign_default( - thread : thread_act_t); - -/* - * Get current assignment for thread. - */ -routine thread_get_assignment( - thread : thread_act_t; - out assigned_set : processor_set_name_t); - - -/* - * OBSOLETE interface. - */ -routine PREFIX(thread_set_policy)( - thr_act : thread_act_t; - pset : processor_set_t; - policy : policy_t; - base : policy_base_t; - limit : policy_limit_t); - -routine thread_get_mach_voucher( - thr_act : thread_act_t; - which : mach_voucher_selector_t; - out voucher : ipc_voucher_t); - -routine thread_set_mach_voucher( - thr_act : thread_act_t; - voucher : ipc_voucher_t); - -routine thread_swap_mach_voucher( - thr_act : thread_act_t; - new_voucher : ipc_voucher_t; - inout old_voucher : ipc_voucher_t); - -/* vim: set ft=c : */ diff --git a/src/kernel/mach/upl.defs b/src/kernel/mach/upl.defs deleted file mode 100644 index 5aceb99a4..000000000 --- a/src/kernel/mach/upl.defs +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. The rights granted to you under the License - * may not be used to create, or enable the creation or redistribution of, - * unlawful or unlicensed copies of an Apple operating system, or to - * circumvent, violate, or enable the circumvention or violation of, any - * terms of an Apple operating system software license agreement. - * - * Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ - */ -/* - * @OSF_COPYRIGHT@ - */ -/* - * Mach Operating System - * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University - * All Rights Reserved. - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR - * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie Mellon - * the rights to redistribute these changes. - */ -/* - */ -/* - * File: mach/upl.defs - * - * Abstract: - * Basic Mach external memory management interface declaration. - */ - -subsystem -#if KERNEL_USER - KernelUser -#endif /* KERNEL_USER */ -#if KERNEL_SERVER - KernelServer -#endif /* KERNEL_SERVER */ - upl 2050; - -#include -#include - -routine upl_abort( - upl_object : upl_t; - in abort_cond : integer_t); - -routine upl_abort_range( - upl_object : upl_t; - offset : upl_offset_t; - size : upl_size_t; - in abort_cond : integer_t; - out empty : boolean_t); - -routine upl_commit( - upl_object : upl_t; - in page_list : upl_page_info_array_t); - -routine upl_commit_range( - upl_object : upl_t; - offset : upl_offset_t; - size : upl_size_t; - in cntrl_flags : integer_t; - in page_list : upl_page_info_array_t; - out empty : boolean_t); - -/* vim: set ft=c : */ diff --git a/src/kernel/mach/vm32_map.defs b/src/kernel/mach/vm32_map.defs deleted file mode 100644 index d28be8de8..000000000 --- a/src/kernel/mach/vm32_map.defs +++ /dev/null @@ -1,284 +0,0 @@ -/* - * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. The rights granted to you under the License - * may not be used to create, or enable the creation or redistribution of, - * unlawful or unlicensed copies of an Apple operating system, or to - * circumvent, violate, or enable the circumvention or violation of, any - * terms of an Apple operating system software license agreement. - * - * Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ - */ -/* - * @OSF_FREE_COPYRIGHT@ - */ -/* - * Mach Operating System - * Copyright (c) 1991,1990,1989 Carnegie Mellon University - * All Rights Reserved. - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR - * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie Mellon - * the rights to redistribute these changes. - */ -/* - */ -/* - * File: mach/vm_map.defs - * - * Exported kernel VM calls for 32-bit client tasks. - */ - -subsystem -#if KERNEL_SERVER - KernelServer -#endif /* KERNEL_SERVER */ - map 3800; - -serverprefix vm32_; - -#include -#include -#include - -#if VM32_SUPPORT - -/* See vm_map.defs for more information */ - -routine region( - target_task : vm_map_t; - inout address : vm32_address_t; - out size : vm32_size_t; - flavor : vm_region_flavor_t; - out info : vm_region_info_t, CountInOut; - out object_name : memory_object_name_t = - MACH_MSG_TYPE_MOVE_SEND - ctype: mach_port_t); - -routine allocate( - target_task : vm_task_entry_t; - inout address : vm32_address_t; - size : vm32_size_t; - flags : int); - -routine deallocate( - target_task : vm_task_entry_t; - address : vm32_address_t; - size : vm32_size_t); - -routine protect( - target_task : vm_task_entry_t; - address : vm32_address_t; - size : vm32_size_t; - set_maximum : boolean_t; - new_protection : vm_prot_t); - -routine inherit( - target_task : vm_task_entry_t; - address : vm32_address_t; - size : vm32_size_t; - new_inheritance : vm_inherit_t); - -routine read( - target_task : vm_map_t; - address : vm32_address_t; - size : vm32_size_t; - out data : pointer_t); - -routine read_list( - target_task : vm_map_t; - inout data_list : vm32_read_entry_t; - count : natural_t); - -routine write( - target_task : vm_map_t; - address : vm32_address_t; - data : pointer_t); - -routine copy( - target_task : vm_map_t; - source_address : vm32_address_t; - size : vm32_size_t; - dest_address : vm32_address_t); - -routine read_overwrite( - target_task : vm_map_t; - address : vm32_address_t; - size : vm32_size_t; - data : vm32_address_t; - out outsize : vm32_size_t); - - -routine msync( - target_task : vm_map_t; - address : vm32_address_t; - size : vm32_size_t; - sync_flags : vm_sync_t ); - -routine behavior_set( - target_task : vm_map_t; - address : vm32_address_t; - size : vm32_size_t; - new_behavior : vm_behavior_t); - -routine map( - target_task : vm_task_entry_t; - inout address : vm32_address_t; - size : vm32_size_t; - mask : vm32_address_t; - flags : int; - object : mem_entry_name_port_t; - offset : vm32_offset_t; - copy : boolean_t; - cur_protection : vm_prot_t; - max_protection : vm_prot_t; - inheritance : vm_inherit_t); - -routine machine_attribute( - target_task : vm_map_t; - address : vm32_address_t; - size : vm32_size_t; - attribute : vm_machine_attribute_t; - inout value : vm_machine_attribute_val_t); - -routine remap( - target_task : vm_map_t; - inout target_address : vm32_address_t; - size : vm32_size_t; - mask : vm32_address_t; - anywhere : boolean_t; - src_task : vm_map_t; - src_address : vm32_address_t; - copy : boolean_t; - out cur_protection : vm_prot_t; - out max_protection : vm_prot_t; - inheritance : vm_inherit_t); - -routine _task_wire( - target_task : vm_map_t; - must_wire : boolean_t); - -routine make_memory_entry( - target_task :vm_map_t; - inout size :vm32_size_t; - offset :vm32_offset_t; - permission :vm_prot_t; - out object_handle :mem_entry_name_port_move_send_t; - parent_entry :mem_entry_name_port_t); - -routine map_page_query( - target_map :vm_map_t; - offset :vm32_offset_t; - out disposition :integer_t; - out ref_count :integer_t); - -routine region_info( - task : vm_map_t; - address : vm32_address_t; - out region : vm_info_region_t; - out objects : vm_info_object_array_t); - -routine mapped_pages_info( - task : vm_map_t; - out pages : page_address_array_t); - -skip; /* was vm_region_object_create */ - -routine region_recurse( - target_task : vm_map_t; - inout address : vm32_address_t; - out size : vm32_size_t; - inout nesting_depth : natural_t; - out info : vm_region_recurse_info_t,CountInOut); - -routine region_recurse_64( - target_task : vm_map_t; - inout address : vm32_address_t; - out size : vm32_size_t; - inout nesting_depth : natural_t; - out info : vm_region_recurse_info_t,CountInOut); - -routine region_info_64( - task : vm_map_t; - address : vm32_address_t; - out region : vm_info_region_64_t; - out objects : vm_info_object_array_t); - -routine region_64( - target_task : vm_map_t; - inout address : vm32_address_t; - out size : vm32_size_t; - flavor : vm_region_flavor_t; - out info : vm_region_info_t, CountInOut; - out object_name : memory_object_name_t = - MACH_MSG_TYPE_MOVE_SEND - ctype: mach_port_t); - -routine make_memory_entry_64( - target_task :vm_map_t; - inout size :memory_object_size_t; - offset :memory_object_offset_t; - permission :vm_prot_t; - out object_handle :mach_port_move_send_t; - parent_entry :mem_entry_name_port_t); - - - -routine map_64( - target_task : vm_task_entry_t; - inout address : vm32_address_t; - size : vm32_size_t; - mask : vm32_address_t; - flags : int; - object : mem_entry_name_port_t; - offset : memory_object_offset_t; - copy : boolean_t; - cur_protection : vm_prot_t; - max_protection : vm_prot_t; - inheritance : vm_inherit_t); - -skip; /* was vm_map_get_upl */ -skip; /* was vm_upl_map */ -skip; /* was vm_upl_unmap */ - -routine purgable_control( - target_task : vm_map_t; - address : vm32_address_t; - control : vm_purgable_t; - inout state : int); - -#endif /* VM32_SUPPORT */ - -/* vim: set ft=c : */ diff --git a/src/kernel/mach/vm_map.defs b/src/kernel/mach/vm_map.defs deleted file mode 100644 index 8ab1fcc4e..000000000 --- a/src/kernel/mach/vm_map.defs +++ /dev/null @@ -1,498 +0,0 @@ -/* - * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. The rights granted to you under the License - * may not be used to create, or enable the creation or redistribution of, - * unlawful or unlicensed copies of an Apple operating system, or to - * circumvent, violate, or enable the circumvention or violation of, any - * terms of an Apple operating system software license agreement. - * - * Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ - */ -/* - * @OSF_FREE_COPYRIGHT@ - */ -/* - * Mach Operating System - * Copyright (c) 1991,1990,1989 Carnegie Mellon University - * All Rights Reserved. - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR - * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie Mellon - * the rights to redistribute these changes. - */ -/* - */ -/* - * File: mach/vm_map.defs - * - * Exported (native-sized) kernel VM calls. - */ - -subsystem -#if KERNEL_SERVER - KernelServer -#endif /* KERNEL_SERVER */ - vm_map 3800; - -#include -#include -#include - -#if !KERNEL && !LIBSYSCALL_INTERFACE -#define PREFIX(NAME) _kernelrpc_ ## NAME -#else -#define PREFIX(NAME) NAME -#endif - -/* - * Returns information about the contents of the virtual - * address space of the target task at the specified - * address. The returned protection, inheritance, sharing - * and memory object values apply to the entire range described - * by the address range returned; the memory object offset - * corresponds to the beginning of the address range. - * [If the specified address is not allocated, the next - * highest address range is described. If no addresses beyond - * the one specified are allocated, the call returns KERN_NO_SPACE.] - */ -routine vm_region( - target_task : vm_map_t; - inout address : vm_address_t; - out size : vm_size_t; - flavor : vm_region_flavor_t; - out info : vm_region_info_t, CountInOut; - out object_name : memory_object_name_t = - MACH_MSG_TYPE_MOVE_SEND - ctype: mach_port_t); - -/* - * Allocate zero-filled memory in the address space - * of the target task, either at the specified address, - * or wherever space can be found (if anywhere is TRUE), - * of the specified size. The address at which the - * allocation actually took place is returned. - */ - -#if !KERNEL && !LIBSYSCALL_INTERFACE -skip; -#else -routine PREFIX(vm_allocate)( - target_task : vm_task_entry_t; - inout address : vm_address_t; - size : vm_size_t; - flags : int); - -#endif - -/* - * Deallocate the specified range from the virtual - * address space of the target task. - */ - -#if !KERNEL && !LIBSYSCALL_INTERFACE -skip; -#else -routine PREFIX(vm_deallocate)( - target_task : vm_task_entry_t; - address : vm_address_t; - size : vm_size_t); - -#endif - -/* - * Set the current or maximum protection attribute - * for the specified range of the virtual address - * space of the target task. The current protection - * limits the memory access rights of threads within - * the task; the maximum protection limits the accesses - * that may be given in the current protection. - * Protections are specified as a set of {read, write, execute} - * *permissions*. - */ - -#if !KERNEL && !LIBSYSCALL_INTERFACE -skip; -#else -routine PREFIX(vm_protect)( - target_task : vm_task_entry_t; - address : vm_address_t; - size : vm_size_t; - set_maximum : boolean_t; - new_protection : vm_prot_t); -#endif - -/* - * Set the inheritance attribute for the specified range - * of the virtual address space of the target task. - * The inheritance value is one of {none, copy, share}, and - * specifies how the child address space should acquire - * this memory at the time of a task_create call. - */ -routine vm_inherit( - target_task : vm_task_entry_t; - address : vm_address_t; - size : vm_size_t; - new_inheritance : vm_inherit_t); - -/* - * Returns the contents of the specified range of the - * virtual address space of the target task. [The - * range must be aligned on a virtual page boundary, - * and must be a multiple of pages in extent. The - * protection on the specified range must permit reading.] - */ -routine PREFIX(vm_read) ( - target_task : vm_map_t; - address : vm_address_t; - size : vm_size_t; - out data : pointer_t); - -/* - * List corrollary to vm_read, returns mapped contents of specified - * ranges within target address space. - */ -routine vm_read_list( - target_task : vm_map_t; - inout data_list : vm_read_entry_t; - count : natural_t); - -/* - * Writes the contents of the specified range of the - * virtual address space of the target task. [The - * range must be aligned on a virtual page boundary, - * and must be a multiple of pages in extent. The - * protection on the specified range must permit writing.] - */ -routine vm_write( - target_task : vm_map_t; - address : vm_address_t; - data : pointer_t); - -/* - * Copy the contents of the source range of the virtual - * address space of the target task to the destination - * range in that same address space. [Both of the - * ranges must be aligned on a virtual page boundary, - * and must be multiples of pages in extent. The - * protection on the source range must permit reading, - * and the protection on the destination range must - * permit writing.] - */ -routine vm_copy( - target_task : vm_map_t; - source_address : vm_address_t; - size : vm_size_t; - dest_address : vm_address_t); - -/* - * Returns the contents of the specified range of the - * virtual address space of the target task. [There - * are no alignment restrictions, and the results will - * overwrite the area pointed to by data - which must - * already exist. The protection on the specified range - * must permit reading.] - */ -routine vm_read_overwrite( - target_task : vm_map_t; - address : vm_address_t; - size : vm_size_t; - data : vm_address_t; - out outsize : vm_size_t); - - -routine vm_msync( - target_task : vm_map_t; - address : vm_address_t; - size : vm_size_t; - sync_flags : vm_sync_t ); - -/* - * Set the paging behavior attribute for the specified range - * of the virtual address space of the target task. - * The behavior value is one of {default, random, forward - * sequential, reverse sequential} and indicates the expected - * page reference pattern for the specified range. - */ -routine vm_behavior_set( - target_task : vm_map_t; - address : vm_address_t; - size : vm_size_t; - new_behavior : vm_behavior_t); - - -/* - * Map a user-defined memory object into the virtual address - * space of the target task. If desired (anywhere is TRUE), - * the kernel will find a suitable address range of the - * specified size; else, the specific address will be allocated. - * - * The beginning address of the range will be aligned on a virtual - * page boundary, be at or beyond the address specified, and - * meet the mask requirements (bits turned on in the mask must not - * be turned on in the result); the size of the range, in bytes, - * will be rounded up to an integral number of virtual pages. - * - * The memory in the resulting range will be associated with the - * specified memory object, with the beginning of the memory range - * referring to the specified offset into the memory object. - * - * The mapping will take the current and maximum protections and - * the inheritance attributes specified; see the vm_protect and - * vm_inherit calls for a description of these attributes. - * - * If desired (copy is TRUE), the memory range will be filled - * with a copy of the data from the memory object; this copy will - * be private to this mapping in this target task. Otherwise, - * the memory in this mapping will be shared with other mappings - * of the same memory object at the same offset (in this task or - * in other tasks). [The Mach kernel only enforces shared memory - * consistency among mappings on one host with similar page alignments. - * The user-defined memory manager for this object is responsible - * for further consistency.] - */ -routine PREFIX(vm_map) ( - target_task : vm_task_entry_t; - inout address : vm_address_t; - size : vm_size_t; - mask : vm_address_t; - flags : int; - object : mem_entry_name_port_t; - offset : vm_offset_t; - copy : boolean_t; - cur_protection : vm_prot_t; - max_protection : vm_prot_t; - inheritance : vm_inherit_t); - -/* - * Set/Get special properties of memory associated - * to some virtual address range, such as cachability, - * migrability, replicability. Machine-dependent. - */ -routine vm_machine_attribute( - target_task : vm_map_t; - address : vm_address_t; - size : vm_size_t; - attribute : vm_machine_attribute_t; - inout value : vm_machine_attribute_val_t); - -/* - * Map portion of a task's address space. - */ -routine PREFIX(vm_remap) ( - target_task : vm_map_t; - inout target_address : vm_address_t; - size : vm_size_t; - mask : vm_address_t; - flags : int; - src_task : vm_map_t; - src_address : vm_address_t; - copy : boolean_t; - out cur_protection : vm_prot_t; - out max_protection : vm_prot_t; - inheritance : vm_inherit_t); - -/* - * Require that all future virtual memory allocation - * allocates wired memory. Setting must_wire to FALSE - * disables the wired future feature. - */ -routine task_wire( - target_task : vm_map_t; - must_wire : boolean_t); - - -/* - * Allow application level processes to create named entries which - * correspond to mapped portions of their address space. These named - * entries can then be manipulated, shared with other processes in - * other address spaces and ultimately mapped in ohter address spaces - */ - -routine mach_make_memory_entry( - target_task :vm_map_t; - inout size :vm_size_t; - offset :vm_offset_t; - permission :vm_prot_t; - out object_handle :mem_entry_name_port_move_send_t; - parent_entry :mem_entry_name_port_t); - -/* - * Give the caller information on the given location in a virtual - * address space. If a page is mapped return ref and dirty info. - */ -routine vm_map_page_query( - target_map :vm_map_t; - offset :vm_offset_t; - out disposition :integer_t; - out ref_count :integer_t); - -/* - * Returns information about a region of memory. - * Includes info about the chain of objects rooted at that region. - * Only available in MACH_VM_DEBUG compiled kernels, - * otherwise returns KERN_FAILURE. - */ -routine mach_vm_region_info( - task : vm_map_t; - address : vm_address_t; - out region : vm_info_region_t; - out objects : vm_info_object_array_t); - -routine vm_mapped_pages_info( - task : vm_map_t; - out pages : page_address_array_t); - -#if 0 -/* - * Allow application level processes to create named entries which - * are backed by sub-maps which describe regions of address space. - * These regions of space can have objects mapped into them and - * in turn, can be mapped into target address spaces - */ - -routine vm_region_object_create( - target_task :vm_map_t; - in size :vm_size_t; - out region_object :mach_port_move_send_t); -#else -skip; /* was vm_region_object_create */ -#endif - -/* - * A recursive form of vm_region which probes submaps withint the - * address space. - */ -routine vm_region_recurse( - target_task : vm_map_t; - inout address : vm_address_t; - out size : vm_size_t; - inout nesting_depth : natural_t; - out info : vm_region_recurse_info_t,CountInOut); - - -/* - * The routines below are temporary, meant for transitional use - * as their counterparts are moved from 32 to 64 bit data path - */ - - -routine vm_region_recurse_64( - target_task : vm_map_t; - inout address : vm_address_t; - out size : vm_size_t; - inout nesting_depth : natural_t; - out info : vm_region_recurse_info_t,CountInOut); - -routine mach_vm_region_info_64( - task : vm_map_t; - address : vm_address_t; - out region : vm_info_region_64_t; - out objects : vm_info_object_array_t); - -routine vm_region_64( - target_task : vm_map_t; - inout address : vm_address_t; - out size : vm_size_t; - flavor : vm_region_flavor_t; - out info : vm_region_info_t, CountInOut; - out object_name : memory_object_name_t = - MACH_MSG_TYPE_MOVE_SEND - ctype: mach_port_t); - -routine mach_make_memory_entry_64( - target_task :vm_map_t; - inout size :memory_object_size_t; - offset :memory_object_offset_t; - permission :vm_prot_t; - out object_handle :mach_port_move_send_t; - parent_entry :mem_entry_name_port_t); - - - -routine vm_map_64( - target_task : vm_task_entry_t; - inout address : vm_address_t; - size : vm_size_t; - mask : vm_address_t; - flags : int; - object : mem_entry_name_port_t; - offset : memory_object_offset_t; - copy : boolean_t; - cur_protection : vm_prot_t; - max_protection : vm_prot_t; - inheritance : vm_inherit_t); - -#if 0 -/* - * The UPL interfaces are not ready for user-level export. - */ -routine vm_map_get_upl( - target_task : vm_map_t; - address : vm_map_offset_t; - inout size : vm_size_t; - out upl : upl_t; - out page_info : upl_page_info_array_t, CountInOut; - inout flags : integer_t; - force_data_sync : integer_t); - -routine vm_upl_map( - target_task : vm_map_t; - upl : upl_t; - inout address : vm_address_t); - -routine vm_upl_unmap( - target_task : vm_map_t; - upl : upl_t); -#else -skip; /* was vm_map_get_upl */ -skip; /* was vm_upl_map */ -skip; /* was vm_upl_unmap */ -#endif - -/* - * Control behavior and investigate state of a "purgable" object in - * the virtual address space of the target task. A purgable object is - * created via a call to vm_allocate() with VM_FLAGS_PURGABLE - * specified. See the routine implementation for a complete - * definition of the routine. - */ -routine vm_purgable_control( - target_task : vm_map_t; - address : vm_address_t; - control : vm_purgable_t; - inout state : int); - -/* vim: set ft=c : */ diff --git a/src/launchd/src/mach_exc.defs b/src/launchd/src/mach_exc.defs index 9758508b7..be4ef0044 120000 --- a/src/launchd/src/mach_exc.defs +++ b/src/launchd/src/mach_exc.defs @@ -1 +1 @@ -../../kernel/mach/mach_exc.defs \ No newline at end of file +../../lkm/osfmk/mach/mach_exc.defs \ No newline at end of file diff --git a/src/launchd/src/notify.defs b/src/launchd/src/notify.defs index 6939c6873..0c16cb4f7 120000 --- a/src/launchd/src/notify.defs +++ b/src/launchd/src/notify.defs @@ -1 +1 @@ -../../kernel/mach/notify.defs \ No newline at end of file +../../lkm/osfmk/mach/notify.defs \ No newline at end of file -- 2.51.2