mach-init.h (1629B)
1 /* -*-comment-start: "//";comment-end:""-*- 2 * GNU Mes --- Maxwell Equations of Software 3 * Copyright © 1993-2016 Free Software Foundation, Inc. 4 * Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org> 5 * 6 * This file is part of GNU Mes. 7 * 8 * GNU Mes is free software; you can redistribute it and/or modify it 9 * under the terms of the GNU General Public License as published by 10 * the Free Software Foundation; either version 3 of the License, or (at 11 * your option) any later version. 12 * 13 * GNU Mes is distributed in the hope that it will be useful, but 14 * WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with GNU Mes. If not, see <http://www.gnu.org/licenses/>. 20 */ 21 22 /** Commentary: 23 Taken from GNU C Library 24 Declarations and macros for the basic Mach things set at startup. 25 */ 26 27 #ifndef _MACH_INIT_H 28 29 #define _MACH_INIT_H 1 30 31 #include <mach/mach_types.h> 32 33 /* Return the current task's task port. */ 34 extern mach_port_t mach_task_self (void); 35 extern mach_port_t mach_host_self (void); 36 37 /* Kernel page size. */ 38 extern vm_size_t __vm_page_size; 39 extern vm_size_t vm_page_size; 40 41 /* Round the address X up to a page boundary. */ 42 #define round_page(x) \ 43 ((((vm_offset_t) (x) + __vm_page_size - 1) / __vm_page_size) * \ 44 __vm_page_size) 45 46 /* Truncate the address X down to a page boundary. */ 47 #define trunc_page(x) \ 48 ((((vm_offset_t) (x)) / __vm_page_size) * __vm_page_size) 49 50 #endif /* mach_init.h */