X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/8ad349bb6ed4a0be06e34c92be0d98b92e078db4..0b4c1975fb5e4eccf1012a35081f7e7799b81046:/osfmk/mach/mach_traps.h diff --git a/osfmk/mach/mach_traps.h b/osfmk/mach/mach_traps.h index 855cc1f89..38298e27e 100644 --- a/osfmk/mach/mach_traps.h +++ b/osfmk/mach/mach_traps.h @@ -1,31 +1,29 @@ /* - * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. + * Copyright (c) 2000-2007 Apple Inc. All rights reserved. * - * @APPLE_LICENSE_OSREFERENCE_HEADER_START@ + * @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 + * 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_LICENSE_OSREFERENCE_HEADER_END@ + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * @OSF_COPYRIGHT@ @@ -141,24 +139,23 @@ extern kern_return_t semaphore_timedwait_signal_trap( unsigned int sec, clock_res_t nsec); -#if !defined(__LP64__) -/* these should go away altogether - so no 64 legacy please */ - -extern kern_return_t init_process(void); - -#endif /* !defined(__LP64__) */ +extern kern_return_t clock_sleep_trap( + mach_port_name_t clock_name, + sleep_type_t sleep_type, + int sleep_sec, + int sleep_nsec, + mach_timespec_t *wakeup_time); -#if !defined(__LP64__) +#endif /* PRIVATE */ -/* more that should go away so no 64-bit legacy please */ extern kern_return_t macx_swapon( - char *filename, + uint64_t filename, int flags, int size, int priority); extern kern_return_t macx_swapoff( - char *filename, + uint64_t filename, int flags); extern kern_return_t macx_triggers( @@ -173,17 +170,6 @@ extern kern_return_t macx_backing_store_suspend( extern kern_return_t macx_backing_store_recovery( int pid); -#endif /* !defined(__LP64__) */ - -extern kern_return_t clock_sleep_trap( - mach_port_name_t clock_name, - sleep_type_t sleep_type, - int sleep_sec, - int sleep_nsec, - mach_timespec_t *wakeup_time); - -#endif /* PRIVATE */ - extern boolean_t swtch_pri(int pri); extern boolean_t swtch(void); @@ -204,6 +190,11 @@ extern kern_return_t task_for_pid( int pid, mach_port_name_t *t); +extern kern_return_t task_name_for_pid( + mach_port_name_t target_tport, + int pid, + mach_port_name_t *tn); + extern kern_return_t pid_for_task( mach_port_name_t t, int *x); @@ -225,13 +216,9 @@ extern kern_return_t map_fd( #ifdef XNU_KERNEL_PRIVATE /* Syscall data translations routines */ -#ifdef __ppc__ #define PAD_(t) (sizeof(uint64_t) <= sizeof(t) \ ? 0 : sizeof(uint64_t) - sizeof(t)) -#else -#define PAD_(t) (sizeof(register_t) <= sizeof(t) \ - ? 0 : sizeof(register_t) - sizeof(t)) -#endif +#define PAD_ARG_8 #if BYTE_ORDER == LITTLE_ENDIAN #define PADL_(t) 0 @@ -264,6 +251,8 @@ void munge_dddddd(const void *, void *); void munge_ddddddd(const void *, void *); void munge_dddddddd(const void *, void *); void munge_l(const void *, void *); +void munge_lw(const void *, void *); +void munge_lwww(const void *, void *); void munge_wl(const void *, void *); void munge_wlw(const void *, void *); void munge_wwwl(const void *, void *); @@ -287,6 +276,8 @@ void munge_wwwwwl(const void *, void *); #define munge_ddddddd NULL #define munge_dddddddd NULL #define munge_l NULL +#define munge_lw NULL +#define munge_lwww NULL #define munge_wl NULL #define munge_wlw NULL #define munge_wwwl NULL @@ -296,31 +287,31 @@ void munge_wwwwwl(const void *, void *); #endif /* !__MUNGE_ONCE */ struct kern_invalid_args { - register_t dummy; + int32_t dummy; }; extern kern_return_t kern_invalid( struct kern_invalid_args *args); struct mach_reply_port_args { - register_t dummy; + int32_t dummy; }; extern mach_port_name_t mach_reply_port( struct mach_reply_port_args *args); struct thread_self_trap_args { - register_t dummy; + int32_t dummy; }; extern mach_port_name_t thread_self_trap( struct thread_self_trap_args *args); struct task_self_trap_args { - register_t dummy; + int32_t dummy; }; extern mach_port_name_t task_self_trap( struct task_self_trap_args *args); struct host_self_trap_args { - register_t dummy; + int32_t dummy; }; extern mach_port_name_t host_self_trap( struct host_self_trap_args *args); @@ -333,6 +324,7 @@ struct mach_msg_overwrite_trap_args { PAD_ARG_(mach_port_name_t, rcv_name); PAD_ARG_(mach_msg_timeout_t, timeout); PAD_ARG_(mach_port_name_t, notify); + PAD_ARG_8 PAD_ARG_(mach_vm_address_t, rcv_msg); /* Unused on mach_msg_trap */ }; extern mach_msg_return_t mach_msg_trap( @@ -389,13 +381,6 @@ struct semaphore_timedwait_signal_trap_args { extern kern_return_t semaphore_timedwait_signal_trap( struct semaphore_timedwait_signal_trap_args *args); -/* not published to LP64 clients */ -struct init_process_args { - register_t dummy; -}; -extern kern_return_t init_process( - struct init_process_args *args); - struct map_fd_args { PAD_ARG_(int, fd); PAD_ARG_(vm_offset_t, offset); @@ -414,6 +399,14 @@ struct task_for_pid_args { extern kern_return_t task_for_pid( struct task_for_pid_args *args); +struct task_name_for_pid_args { + PAD_ARG_(mach_port_name_t, target_tport); + PAD_ARG_(int, pid); + PAD_ARG_(user_addr_t, t); +}; +extern kern_return_t task_name_for_pid( + struct task_name_for_pid_args *args); + struct pid_for_task_args { PAD_ARG_(mach_port_name_t, t); PAD_ARG_(user_addr_t, pid); @@ -421,9 +414,8 @@ struct pid_for_task_args { extern kern_return_t pid_for_task( struct pid_for_task_args *args); -/* not published to LP64 clients*/ struct macx_swapon_args { - PAD_ARG_(char *, filename); + PAD_ARG_(uint64_t, filename); PAD_ARG_(int, flags); PAD_ARG_(int, size); PAD_ARG_(int, priority); @@ -432,7 +424,7 @@ extern kern_return_t macx_swapon( struct macx_swapon_args *args); struct macx_swapoff_args { - PAD_ARG_(char *, filename); + PAD_ARG_(uint64_t, filename); PAD_ARG_(int, flags); }; extern kern_return_t macx_swapoff( @@ -465,8 +457,14 @@ struct swtch_pri_args { extern boolean_t swtch_pri( struct swtch_pri_args *args); +struct pfz_exit_args { + int32_t dummy; +}; +extern kern_return_t pfz_exit( + struct pfz_exit_args *args); + struct swtch_args { - register_t dummy; + int32_t dummy; }; extern boolean_t swtch( struct swtch_args *args); @@ -502,7 +500,7 @@ extern kern_return_t mach_wait_until_trap( struct mach_wait_until_trap_args *args); struct mk_timer_create_trap_args { - register_t dummy; + int32_t dummy; }; extern mach_port_name_t mk_timer_create_trap( struct mk_timer_create_trap_args *args); @@ -527,17 +525,6 @@ struct mk_timer_cancel_trap_args { extern kern_return_t mk_timer_cancel_trap( struct mk_timer_cancel_trap_args *args); -/* no user-level prototype for this one */ -struct mk_timebase_info_trap_args { - PAD_ARG_(uint32_t *, delta); - PAD_ARG_(uint32_t *, abs_to_ns_numer); - PAD_ARG_(uint32_t *, abs_to_ns_denom); - PAD_ARG_(uint32_t *, proc_to_abs_numer); - PAD_ARG_(uint32_t *, proc_to_abs_denom); -}; -extern void mk_timebase_info_trap( - struct mk_timebase_info_trap_args *args); - /* not published to LP64 clients yet */ struct iokit_user_client_trap_args { PAD_ARG_(void *, userClientRef); @@ -547,6 +534,7 @@ struct iokit_user_client_trap_args { PAD_ARG_(void *, p3); PAD_ARG_(void *, p4); PAD_ARG_(void *, p5); + PAD_ARG_8 PAD_ARG_(void *, p6); }; kern_return_t iokit_user_client_trap( @@ -556,6 +544,7 @@ kern_return_t iokit_user_client_trap( #undef PADL_ #undef PADR_ #undef PAD_ARG_ +#undef PAD_ARG_8 #endif /* XNU_KERNEL_PRIVATE */