aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorFlavio Cruz <flaviocruz@gmail.com>2022-12-06 00:35:01 -0500
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2022-12-06 21:26:19 +0100
commit2a7263559572f178322451a6a1e0a43dc90cdb32 (patch)
treebeb008838cac227cc7844ac02067731a5ca3ef20 /include
parent45afcc68979b700bdef1dc0e27ba79e0822b1c18 (diff)
downloadgnumach-2a7263559572f178322451a6a1e0a43dc90cdb32.tar.gz
gnumach-2a7263559572f178322451a6a1e0a43dc90cdb32.tar.bz2
gnumach-2a7263559572f178322451a6a1e0a43dc90cdb32.zip
Make task_info.h structs more portable
Changed vm_size_t to rpc_size_t so that both userland and kernel agree on the same size. Also changed the denominator for the maximum struct sizes to be integer_t to match the other declarations. Introduced long_natural_t and rpc_long_natural_t to represent large counters. Replaced rpc_unsigned_long with rpc_long_natural_t. Message-Id: <Y47UhaOzKnqhgYq4@reue>
Diffstat (limited to 'include')
-rw-r--r--include/mach/task_info.h24
-rw-r--r--include/mach_debug/mach_debug_types.defs10
-rw-r--r--include/mach_debug/slab_info.h10
3 files changed, 22 insertions, 22 deletions
diff --git a/include/mach/task_info.h b/include/mach/task_info.h
index 5607178c..3aaa7cd6 100644
--- a/include/mach/task_info.h
+++ b/include/mach/task_info.h
@@ -54,8 +54,8 @@ typedef integer_t task_info_data_t[TASK_INFO_MAX];
struct task_basic_info {
integer_t suspend_count; /* suspend count for task */
integer_t base_priority; /* base scheduling priority */
- vm_size_t virtual_size; /* number of virtual pages */
- vm_size_t resident_size; /* number of resident pages */
+ rpc_vm_size_t virtual_size; /* number of virtual pages */
+ rpc_vm_size_t resident_size; /* number of resident pages */
time_value_t user_time; /* total user run time for
terminated threads */
time_value_t system_time; /* total system run time for
@@ -66,24 +66,24 @@ struct task_basic_info {
typedef struct task_basic_info task_basic_info_data_t;
typedef struct task_basic_info *task_basic_info_t;
#define TASK_BASIC_INFO_COUNT \
- (sizeof(task_basic_info_data_t) / sizeof(natural_t))
+ (sizeof(task_basic_info_data_t) / sizeof(integer_t))
#define TASK_EVENTS_INFO 2 /* various event counts */
struct task_events_info {
- natural_t faults; /* number of page faults */
- natural_t zero_fills; /* number of zero fill pages */
- natural_t reactivations; /* number of reactivated pages */
- natural_t pageins; /* number of actual pageins */
- natural_t cow_faults; /* number of copy-on-write faults */
- natural_t messages_sent; /* number of messages sent */
- natural_t messages_received; /* number of messages received */
+ rpc_long_natural_t faults; /* number of page faults */
+ rpc_long_natural_t zero_fills; /* number of zero fill pages */
+ rpc_long_natural_t reactivations; /* number of reactivated pages */
+ rpc_long_natural_t pageins; /* number of actual pageins */
+ rpc_long_natural_t cow_faults; /* number of copy-on-write faults */
+ rpc_long_natural_t messages_sent; /* number of messages sent */
+ rpc_long_natural_t messages_received; /* number of messages received */
};
typedef struct task_events_info task_events_info_data_t;
typedef struct task_events_info *task_events_info_t;
#define TASK_EVENTS_INFO_COUNT \
- (sizeof(task_events_info_data_t) / sizeof(natural_t))
+ (sizeof(task_events_info_data_t) / sizeof(integer_t))
#define TASK_THREAD_TIMES_INFO 3 /* total times for live threads -
only accurate if suspended */
@@ -98,7 +98,7 @@ struct task_thread_times_info {
typedef struct task_thread_times_info task_thread_times_info_data_t;
typedef struct task_thread_times_info *task_thread_times_info_t;
#define TASK_THREAD_TIMES_INFO_COUNT \
- (sizeof(task_thread_times_info_data_t) / sizeof(natural_t))
+ (sizeof(task_thread_times_info_data_t) / sizeof(integer_t))
/*
* Flavor definitions for task_ras_control
diff --git a/include/mach_debug/mach_debug_types.defs b/include/mach_debug/mach_debug_types.defs
index c138dc40..fd940384 100644
--- a/include/mach_debug/mach_debug_types.defs
+++ b/include/mach_debug/mach_debug_types.defs
@@ -42,11 +42,11 @@ type cache_info_t = struct {
rpc_vm_size_t align;
rpc_vm_size_t buf_size;
rpc_vm_size_t slab_size;
- rpc_unsigned_long bufs_per_slab;
- rpc_unsigned_long nr_objs;
- rpc_unsigned_long nr_bufs;
- rpc_unsigned_long nr_slabs;
- rpc_unsigned_long nr_free_slabs;
+ rpc_long_natural_t bufs_per_slab;
+ rpc_long_natural_t nr_objs;
+ rpc_long_natural_t nr_bufs;
+ rpc_long_natural_t nr_slabs;
+ rpc_long_natural_t nr_free_slabs;
cache_name_t name;
};
type cache_info_array_t = array[] of cache_info_t;
diff --git a/include/mach_debug/slab_info.h b/include/mach_debug/slab_info.h
index 19a87307..0f6b5a2c 100644
--- a/include/mach_debug/slab_info.h
+++ b/include/mach_debug/slab_info.h
@@ -43,11 +43,11 @@ typedef struct cache_info {
rpc_vm_size_t align;
rpc_vm_size_t buf_size;
rpc_vm_size_t slab_size;
- rpc_unsigned_long bufs_per_slab;
- rpc_unsigned_long nr_objs;
- rpc_unsigned_long nr_bufs;
- rpc_unsigned_long nr_slabs;
- rpc_unsigned_long nr_free_slabs;
+ rpc_long_natural_t bufs_per_slab;
+ rpc_long_natural_t nr_objs;
+ rpc_long_natural_t nr_bufs;
+ rpc_long_natural_t nr_slabs;
+ rpc_long_natural_t nr_free_slabs;
char name[CACHE_NAME_MAX_LEN];
} cache_info_t;