|
Packit |
6c4009 |
/* Declarations and macros for the basic Mach things set at startup.
|
|
Packit |
6c4009 |
Copyright (C) 1993-2018 Free Software Foundation, Inc.
|
|
Packit |
6c4009 |
This file is part of the GNU C Library.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
The GNU C Library is free software; you can redistribute it and/or
|
|
Packit |
6c4009 |
modify it under the terms of the GNU Lesser General Public
|
|
Packit |
6c4009 |
License as published by the Free Software Foundation; either
|
|
Packit |
6c4009 |
version 2.1 of the License, or (at your option) any later version.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
The GNU C Library is distributed in the hope that it will be useful,
|
|
Packit |
6c4009 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
6c4009 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
6c4009 |
Lesser General Public License for more details.
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
You should have received a copy of the GNU Lesser General Public
|
|
Packit |
6c4009 |
License along with the GNU C Library; if not, see
|
|
Packit |
6c4009 |
<http://www.gnu.org/licenses/>. */
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#ifndef _MACH_INIT_H
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#define _MACH_INIT_H 1
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#include <mach/mach_types.h>
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Return the current task's task port. */
|
|
Packit |
6c4009 |
extern mach_port_t __mach_task_self (void);
|
|
Packit |
6c4009 |
extern mach_port_t mach_task_self (void);
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* This cache is initialized at startup. */
|
|
Packit |
6c4009 |
extern mach_port_t __mach_task_self_;
|
|
Packit |
6c4009 |
#define __mach_task_self() (__mach_task_self_ + 0) /* Not an lvalue. */
|
|
Packit |
6c4009 |
#define mach_task_self() (__mach_task_self ())
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* This cache is initialized at startup. */
|
|
Packit |
6c4009 |
extern mach_port_t __mach_host_self_;
|
|
Packit |
6c4009 |
#define __mach_host_self() (__mach_host_self_ + 0) /* Not an lvalue. */
|
|
Packit |
6c4009 |
#define mach_host_self() (__mach_host_self ())
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Kernel page size. */
|
|
Packit |
6c4009 |
extern vm_size_t __vm_page_size;
|
|
Packit |
6c4009 |
extern vm_size_t vm_page_size;
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Round the address X up to a page boundary. */
|
|
Packit |
6c4009 |
#define round_page(x) \
|
|
Packit |
6c4009 |
((((vm_offset_t) (x) + __vm_page_size - 1) / __vm_page_size) * \
|
|
Packit |
6c4009 |
__vm_page_size)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
/* Truncate the address X down to a page boundary. */
|
|
Packit |
6c4009 |
#define trunc_page(x) \
|
|
Packit |
6c4009 |
((((vm_offset_t) (x)) / __vm_page_size) * __vm_page_size)
|
|
Packit |
6c4009 |
|
|
Packit |
6c4009 |
#endif /* mach_init.h */
|