summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/device/device.defs28
-rw-r--r--include/mach/gnumach.defs39
-rw-r--r--include/mach/mach.defs84
-rw-r--r--include/mach/mach_host.defs39
-rw-r--r--include/mach/mach_types.defs14
-rw-r--r--include/mach/mach_types.h1
-rw-r--r--include/mach/port.h2
-rw-r--r--include/mach/syscall_sw.h1
-rw-r--r--include/mach/vm_cache_statistics.h41
-rw-r--r--include/mach/xen.h8
-rw-r--r--include/mach_debug/mach_debug.defs20
-rw-r--r--include/mach_debug/mach_debug_types.defs7
-rw-r--r--include/mach_debug/mach_debug_types.h2
-rw-r--r--include/mach_debug/slab_info.h (renamed from include/mach_debug/zone_info.h)57
-rw-r--r--include/string.h2
-rw-r--r--include/sys/types.h2
16 files changed, 156 insertions, 191 deletions
diff --git a/include/device/device.defs b/include/device/device.defs
index 2bbd5563..d9234e39 100644
--- a/include/device/device.defs
+++ b/include/device/device.defs
@@ -32,10 +32,6 @@
* block and character device interfaces to the kernel.
*/
-#ifdef MACH_KERNEL
-simport <kern/compat_xxx_defs.h>; /* for obsolete routines */
-#endif
-
subsystem
#if KERNEL_SERVER
KernelServer
@@ -99,27 +95,9 @@ routine device_read_inband(
out data : io_buf_ptr_inband_t
);
-/* obsolete */
-routine xxx_device_set_status(
- device : device_t;
- in flavor : dev_flavor_t;
- in status : dev_status_t, IsLong
- );
-
-/* obsolete */
-routine xxx_device_get_status(
- device : device_t;
- in flavor : dev_flavor_t;
- out status : dev_status_t, IsLong
- );
-
-/* obsolete */
-routine xxx_device_set_filter(
- device : device_t;
- in receive_port : mach_port_send_t;
- in priority : int;
- in filter : filter_array_t, IsLong
- );
+skip; /* old xxx_device_set_status */
+skip; /* old xxx_device_get_status */
+skip; /* old xxx_device_set_filter*/
routine device_map(
device : device_t;
diff --git a/include/mach/gnumach.defs b/include/mach/gnumach.defs
new file mode 100644
index 00000000..73313343
--- /dev/null
+++ b/include/mach/gnumach.defs
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2012 Free Software Foundation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+subsystem
+#if KERNEL_SERVER
+ KernelServer
+#endif /* KERNEL_SERVER */
+#if KERNEL_USER
+ KernelUser
+#endif /* KERNEL_USER */
+ gnumach 4200;
+
+#include <mach/std_types.defs>
+#include <mach/mach_types.defs>
+
+type vm_cache_statistics_data_t = struct[11] of integer_t;
+
+/*
+ * Return page cache statistics for the host on which the target task
+ * resides.
+ */
+routine vm_cache_statistics(
+ target_task : vm_task_t;
+ out vm_cache_stats : vm_cache_statistics_data_t);
diff --git a/include/mach/mach.defs b/include/mach/mach.defs
index 4531a220..58510805 100644
--- a/include/mach/mach.defs
+++ b/include/mach/mach.defs
@@ -30,10 +30,6 @@
* Matchmaker definitions file for Mach kernel interface.
*/
-#ifdef MACH_KERNEL
-simport <kern/compat_xxx_defs.h>; /* for obsolete routines */
-#endif /* MACH_KERNEL */
-
subsystem
#if KERNEL_USER
KernelUser
@@ -388,16 +384,8 @@ skip; /* old pager_flush_request */
* boolean). The new routine is backwards compatible at the C
* language interface.
*/
-simpleroutine xxx_memory_object_lock_request(
- memory_control : memory_object_control_t;
- offset : vm_offset_t;
- size : vm_size_t;
- should_clean : boolean_t;
- should_flush : boolean_t;
- lock_value : vm_prot_t;
- reply_to : mach_port_t =
- MACH_MSG_TYPE_MAKE_SEND_ONCE|polymorphic);
+skip; /* old xxx_memory_object_lock_request */
simpleroutine memory_object_lock_request(
memory_control : memory_object_control_t;
@@ -409,46 +397,11 @@ simpleroutine memory_object_lock_request(
reply_to : mach_port_t =
MACH_MSG_TYPE_MAKE_SEND_ONCE|polymorphic);
-/* obsolete */
-routine xxx_task_get_emulation_vector(
- task : task_t;
- out vector_start : int;
- out emulation_vector: xxx_emulation_vector_t, IsLong);
-
-/* obsolete */
-routine xxx_task_set_emulation_vector(
- task : task_t;
- vector_start : int;
- emulation_vector: xxx_emulation_vector_t, IsLong);
-
-/*
- * Returns information about the host on which the
- * target object resides. [This object may be
- * a task, thread, or memory_object_control port.]
- */
-routine xxx_host_info(
- target_task : mach_port_t;
- out info : machine_info_data_t);
-
-/*
- * Returns information about a particular processor on
- * the host on which the target task resides.
- */
-routine xxx_slot_info(
- target_task : task_t;
- slot : int;
- out info : machine_slot_data_t);
-
-/*
- * Performs control operations (currently only
- * turning off or on) on a particular processor on
- * the host on which the target task resides.
- */
-routine xxx_cpu_control(
- target_task : task_t;
- cpu : int;
- running : boolean_t);
-
+skip; /* old xxx_task_get_emulation_vector */
+skip; /* old xxx_task_set_emulation_vector */
+skip; /* old xxx_host_info */
+skip; /* old xxx_slot_info */
+skip; /* old xxx_cpu_control */
skip; /* old thread_statistics */
skip; /* old task_statistics */
skip; /* old netport_init */
@@ -491,11 +444,7 @@ routine task_set_special_port(
which_port : int;
special_port : mach_port_t);
-/* obsolete */
-routine xxx_task_info(
- target_task : task_t;
- flavor : int;
- out task_info_out : task_info_t, IsLong);
+skip; /* old xxx_task_info */
/*
@@ -537,17 +486,8 @@ routine thread_resume(
routine thread_abort(
target_thread : thread_t);
-/* obsolete */
-routine xxx_thread_get_state(
- target_thread : thread_t;
- flavor : int;
- out old_state : thread_state_t, IsLong);
-
-/* obsolete */
-routine xxx_thread_set_state(
- target_thread : thread_t;
- flavor : int;
- new_state : thread_state_t, IsLong);
+skip; /* old xxx_thread_get_state */
+skip; /* old xxx_thread_set_state */
/*
* Returns the current value of the selected special port
@@ -567,11 +507,7 @@ routine thread_set_special_port(
which_port : int;
special_port : mach_port_t);
-/* obsolete */
-routine xxx_thread_info(
- target_thread : thread_t;
- flavor : int;
- out thread_info_out : thread_info_t, IsLong);
+skip; /* old xxx_thread_info */
/*
* Establish a user-level handler for the specified
diff --git a/include/mach/mach_host.defs b/include/mach/mach_host.defs
index 85ee4dc5..2644146f 100644
--- a/include/mach/mach_host.defs
+++ b/include/mach/mach_host.defs
@@ -34,10 +34,6 @@
* control.
*/
-#ifdef MACH_KERNEL
-simport <kern/compat_xxx_defs.h>; /* for obsolete routines */
-#endif
-
subsystem
#if KERNEL_SERVER
KernelServer
@@ -59,19 +55,8 @@ routine host_processors(
host_priv : host_priv_t;
out processor_list : processor_array_t);
-/* obsolete */
-routine yyy_host_info(
- host : host_t;
- flavor : int;
- out host_info_out : host_info_t, IsLong);
-
-
-/* obsolete */
-routine yyy_processor_info(
- processor : processor_t;
- flavor : int;
- out host : host_t;
- out processor_info_out: processor_info_t, IsLong);
+skip; /* old yyy_host_info */
+skip; /* old yyy_processor_info */
/*
* Start processor.
@@ -87,10 +72,7 @@ routine processor_start(
routine processor_exit(
processor : processor_t);
-/* obsolete */
-routine yyy_processor_control(
- processor : processor_t;
- processor_cmd : processor_info_t, IsLong);
+skip; /* old yyy_processor_control */
/*
* Get default processor set for host.
@@ -99,13 +81,7 @@ routine processor_set_default(
host : host_t;
out default_set : processor_set_name_t);
-/*
- * Get rights to default processor set for host.
- * Replaced by host_processor_set_priv.
- */
-routine xxx_processor_set_default_priv(
- host : host_priv_t;
- out default_set : processor_set_t);
+skip; /* old xxx_processor_set_default_priv */
/*
* Create new processor set. Returns real port for manipulations,
@@ -122,12 +98,7 @@ routine processor_set_create(
routine processor_set_destroy(
set : processor_set_t);
-/* obsolete */
-routine yyy_processor_set_info(
- set_name : processor_set_name_t;
- flavor : int;
- out host : host_t;
- out info_out : processor_set_info_t, IsLong);
+skip; /* old yyy_processor_set_info */
/*
* Assign processor to processor set.
diff --git a/include/mach/mach_types.defs b/include/mach/mach_types.defs
index 4e448b81..607d5d92 100644
--- a/include/mach/mach_types.defs
+++ b/include/mach/mach_types.defs
@@ -121,11 +121,11 @@ type vm_statistics_data_t = struct[13] of integer_t;
type vm_machine_attribute_t = int;
type vm_machine_attribute_val_t = int;
-type thread_info_t = array[*:1024] of natural_t;
+type thread_info_t = array[*:1024] of integer_t;
type thread_basic_info_data_t = struct[11] of integer_t;
type thread_sched_info_data_t = struct[7] of integer_t;
-type task_info_t = array[*:1024] of natural_t;
+type task_info_t = array[*:1024] of integer_t;
type task_basic_info_data_t = struct[8] of integer_t;
type task_events_info = struct[7] of natural_t;
type task_thread_times_info_data_t = struct[4] of integer_t;
@@ -174,7 +174,7 @@ type host_priv_t = mach_port_t
#endif /* KERNEL_SERVER */
;
-type host_info_t = array[*:1024] of natural_t;
+type host_info_t = array[*:1024] of integer_t;
type host_basic_info_data_t = struct[5] of integer_t;
type host_sched_info_data_t = struct[2] of integer_t;
type host_load_info_data_t = struct[6] of integer_t;
@@ -189,7 +189,7 @@ type processor_t = mach_port_t
;
type processor_array_t = ^array[] of processor_t;
-type processor_info_t = array[*:1024] of natural_t;
+type processor_info_t = array[*:1024] of integer_t;
type processor_basic_info_data_t = struct[5] of integer_t;
@@ -215,7 +215,7 @@ type processor_set_name_t = mach_port_t
type processor_set_name_array_t = ^array[] of processor_set_name_t;
-type processor_set_info_t = array[*:1024] of natural_t;
+type processor_set_info_t = array[*:1024] of integer_t;
type processor_set_basic_info_data_t = struct[5] of integer_t;
type processor_set_sched_info_data_t = struct[2] of integer_t;
@@ -228,10 +228,6 @@ type time_value_t = struct[2] of integer_t;
type emulation_vector_t = ^array[] of vm_offset_t;
-type xxx_emulation_vector_t = array[*:1024] of vm_offset_t
- ctype: emulation_vector_t;
- /* XXX compatibility */
-
type rpc_signature_info_t = array[*:1024] of int;
#if KERNEL_SERVER
diff --git a/include/mach/mach_types.h b/include/mach/mach_types.h
index f6ceac3b..87684824 100644
--- a/include/mach/mach_types.h
+++ b/include/mach/mach_types.h
@@ -52,6 +52,7 @@
#include <mach/vm_inherit.h>
#include <mach/vm_prot.h>
#include <mach/vm_statistics.h>
+#include <mach/vm_cache_statistics.h>
#ifdef MACH_KERNEL
#include <kern/task.h> /* for task_array_t */
diff --git a/include/mach/port.h b/include/mach/port.h
index 6dafb2f3..53f60716 100644
--- a/include/mach/port.h
+++ b/include/mach/port.h
@@ -39,7 +39,7 @@
#include <mach/machine/vm_types.h>
-typedef natural_t mach_port_t;
+typedef vm_offset_t mach_port_t;
typedef mach_port_t *mach_port_array_t;
typedef int *rpc_signature_info_t;
diff --git a/include/mach/syscall_sw.h b/include/mach/syscall_sw.h
index af14c8de..89597e99 100644
--- a/include/mach/syscall_sw.h
+++ b/include/mach/syscall_sw.h
@@ -52,6 +52,7 @@ kernel_trap(mach_reply_port,-26,0)
kernel_trap(mach_thread_self,-27,0)
kernel_trap(mach_task_self,-28,0)
kernel_trap(mach_host_self,-29,0)
+kernel_trap(mach_print,-30,1)
kernel_trap(swtch_pri,-59,1)
kernel_trap(swtch,-60,0)
diff --git a/include/mach/vm_cache_statistics.h b/include/mach/vm_cache_statistics.h
new file mode 100644
index 00000000..072976af
--- /dev/null
+++ b/include/mach/vm_cache_statistics.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2012 Free Software Foundation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef _MACH_VM_CACHE_STATISTICS_H_
+#define _MACH_VM_CACHE_STATISTICS_H_
+
+#include <mach/machine/vm_types.h>
+
+struct vm_cache_statistics {
+ integer_t cache_object_count; /* # of cached objects */
+ integer_t cache_count; /* # of cached pages */
+ integer_t active_tmp_count; /* # of active temporary pages */
+ integer_t inactive_tmp_count; /* # of inactive temporary pages */
+ integer_t active_perm_count; /* # of active permanent pages */
+ integer_t inactive_perm_count; /* # of inactive permanent pages */
+ integer_t dirty_count; /* # of dirty pages */
+ integer_t laundry_count; /* # of pages being laundered */
+ integer_t writeback_count; /* # of pages being written back */
+ integer_t slab_count; /* # of slab allocator pages */
+ integer_t slab_reclaim_count; /* # of reclaimable slab pages */
+};
+
+typedef struct vm_cache_statistics *vm_cache_statistics_t;
+typedef struct vm_cache_statistics vm_cache_statistics_data_t;
+
+#endif /* _MACH_VM_CACHE_STATISTICS_H_ */
diff --git a/include/mach/xen.h b/include/mach/xen.h
index f1d9e418..6fc626f2 100644
--- a/include/mach/xen.h
+++ b/include/mach/xen.h
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2006 Samuel Thibault <samuel.thibault@ens-lyon.org>
+ * Copyright (C) 2006-2009, 2011 Free Software Foundation
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -28,6 +28,7 @@ extern struct start_info boot_info;
extern volatile struct shared_info hyp_shared_info;
+#ifdef MACH_PV_PAGETABLES
/* Memory translations */
/* pa are physical addresses, from 0 to size of memory */
@@ -77,6 +78,11 @@ extern unsigned long *mfn_list;
#define kv_to_mfn(a) pa_to_mfn(_kvtophys(a))
#define kv_to_ma(a) pa_to_ma(_kvtophys(a))
+#else /* MACH_PV_PAGETABLES */
+#define mfn_to_pfn(n) (n)
+#define pfn_to_mfn(n) (n)
+#endif /* MACH_PV_PAGETABLES */
+
#define mfn_to_kv(mfn) phystokv(ptoa(mfn_to_pfn(mfn)))
#include <machine/xen.h>
diff --git a/include/mach_debug/mach_debug.defs b/include/mach_debug/mach_debug.defs
index 2a58dc4c..053c3fe6 100644
--- a/include/mach_debug/mach_debug.defs
+++ b/include/mach_debug/mach_debug.defs
@@ -42,17 +42,7 @@ skip; /* host_ipc_statistics_reset */
skip; /* host_callout_info */
skip; /* host_callout_statistics */
skip; /* host_callout_statistics_reset */
-
-/*
- * Returns information about the memory allocation zones.
- */
-routine host_zone_info(
- host : host_t;
- out names : zone_name_array_t,
- CountInOut, Dealloc;
- out info : zone_info_array_t,
- CountInOut, Dealloc);
-
+skip; /* host_zone_info */
skip; /* host_ipc_bucket_info */
#if !defined(MACH_IPC_DEBUG) || MACH_IPC_DEBUG
@@ -228,6 +218,14 @@ routine mach_vm_object_pages(
out pages : vm_page_info_array_t,
CountInOut, Dealloc);
+/*
+ * Returns information about the memory allocation caches.
+ */
+routine host_slab_info(
+ host : host_t;
+ out info : cache_info_array_t,
+ CountInOut, Dealloc);
+
#else /* !defined(MACH_VM_DEBUG) || MACH_VM_DEBUG */
skip; /* mach_vm_region_info */
skip; /* mach_vm_object_info */
diff --git a/include/mach_debug/mach_debug_types.defs b/include/mach_debug/mach_debug_types.defs
index 9f1976fe..f60125a0 100644
--- a/include/mach_debug/mach_debug_types.defs
+++ b/include/mach_debug/mach_debug_types.defs
@@ -32,11 +32,8 @@
#include <mach/std_types.defs>
-type zone_name_t = struct[80] of char;
-type zone_name_array_t = array[] of zone_name_t;
-
-type zone_info_t = struct[9] of integer_t;
-type zone_info_array_t = array[] of zone_info_t;
+type cache_info_t = struct[19] of integer_t;
+type cache_info_array_t = array[] of cache_info_t;
type hash_info_bucket_t = struct[1] of natural_t;
type hash_info_bucket_array_t = array[] of hash_info_bucket_t;
diff --git a/include/mach_debug/mach_debug_types.h b/include/mach_debug/mach_debug_types.h
index 2ba0cb1f..5d4efcde 100644
--- a/include/mach_debug/mach_debug_types.h
+++ b/include/mach_debug/mach_debug_types.h
@@ -32,7 +32,7 @@
#include <mach_debug/ipc_info.h>
#include <mach_debug/vm_info.h>
-#include <mach_debug/zone_info.h>
+#include <mach_debug/slab_info.h>
#include <mach_debug/hash_info.h>
typedef char symtab_name_t[32];
diff --git a/include/mach_debug/zone_info.h b/include/mach_debug/slab_info.h
index 1b36fe02..37dcb8c4 100644
--- a/include/mach_debug/zone_info.h
+++ b/include/mach_debug/slab_info.h
@@ -24,38 +24,39 @@
* the rights to redistribute these changes.
*/
-#ifndef _MACH_DEBUG_ZONE_INFO_H_
-#define _MACH_DEBUG_ZONE_INFO_H_
+#ifndef _MACH_DEBUG_SLAB_INFO_H_
+#define _MACH_DEBUG_SLAB_INFO_H_
-#include <mach/boolean.h>
-#include <mach/machine/vm_types.h>
+#include <sys/types.h>
/*
* Remember to update the mig type definitions
* in mach_debug_types.defs when adding/removing fields.
*/
-#define ZONE_NAME_MAX_LEN 80
-
-typedef struct zone_name {
- char zn_name[ZONE_NAME_MAX_LEN];
-} zone_name_t;
-
-typedef zone_name_t *zone_name_array_t;
-
-
-typedef struct zone_info {
- integer_t zi_count; /* Number of elements used now */
- vm_size_t zi_cur_size; /* current memory utilization */
- vm_size_t zi_max_size; /* how large can this zone grow */
- vm_size_t zi_elem_size; /* size of an element */
- vm_size_t zi_alloc_size; /* size used for more memory */
-/*boolean_t*/integer_t zi_pageable; /* zone pageable? */
-/*boolean_t*/integer_t zi_sleepable; /* sleep if empty? */
-/*boolean_t*/integer_t zi_exhaustible; /* merely return if empty? */
-/*boolean_t*/integer_t zi_collectable; /* garbage collect elements? */
-} zone_info_t;
-
-typedef zone_info_t *zone_info_array_t;
-
-#endif /* _MACH_DEBUG_ZONE_INFO_H_ */
+#define CACHE_NAME_MAX_LEN 32
+
+#define CACHE_FLAGS_NO_CPU_POOL 0x01
+#define CACHE_FLAGS_SLAB_EXTERNAL 0x02
+#define CACHE_FLAGS_NO_RECLAIM 0x04
+#define CACHE_FLAGS_VERIFY 0x08
+#define CACHE_FLAGS_DIRECT 0x10
+
+typedef struct cache_info {
+ int flags;
+ size_t cpu_pool_size;
+ size_t obj_size;
+ size_t align;
+ size_t buf_size;
+ size_t slab_size;
+ unsigned long bufs_per_slab;
+ unsigned long nr_objs;
+ unsigned long nr_bufs;
+ unsigned long nr_slabs;
+ unsigned long nr_free_slabs;
+ char name[CACHE_NAME_MAX_LEN];
+} cache_info_t;
+
+typedef cache_info_t *cache_info_array_t;
+
+#endif /* _MACH_DEBUG_SLAB_INFO_H_ */
diff --git a/include/string.h b/include/string.h
index 8059bedb..c77d387b 100644
--- a/include/string.h
+++ b/include/string.h
@@ -32,7 +32,7 @@ extern void *memcpy (void *dest, const void *src, size_t n);
extern void *memmove (void *dest, const void *src, size_t n);
-extern int *memcmp (const void *s1, const void *s2, size_t n);
+extern int memcmp (const void *s1, const void *s2, size_t n);
extern void *memset (void *s, int c, size_t n);
diff --git a/include/sys/types.h b/include/sys/types.h
index d79e077c..19e7b242 100644
--- a/include/sys/types.h
+++ b/include/sys/types.h
@@ -30,7 +30,7 @@
#ifndef _SIZE_T
#define _SIZE_T
-typedef natural_t size_t;
+typedef unsigned long size_t;
#endif
#ifndef _SSIZE_T