[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Make task_info.h structs more portable
From: |
Flavio Cruz |
Subject: |
[PATCH] Make task_info.h structs more portable |
Date: |
Wed, 30 Nov 2022 02:10:16 -0500 |
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.
Changed some counters to simply use unsigned int instead of natural_t.
---
doc/mach.texi | 18 +++++++++---------
include/mach/task_info.h | 24 ++++++++++++------------
2 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/doc/mach.texi b/doc/mach.texi
index 4abafe1a..f1bb54e6 100644
--- a/doc/mach.texi
+++ b/doc/mach.texi
@@ -5011,10 +5011,10 @@ suspend count for task
@item integer_t base_priority
base scheduling priority
-@item vm_size_t virtual_size
+@item rpc_vm_size_t virtual_size
number of virtual pages
-@item vm_size_t resident_size
+@item rpc_vm_size_t resident_size
number of resident pages
@item time_value_t user_time
@@ -5041,25 +5041,25 @@ provided it as the @var{task_info} parameter for the
following members:
@table @code
-@item natural_t faults
+@item unsigned int faults
number of page faults
-@item natural_t zero_fills
+@item unsigned int zero_fills
number of zero fill pages
-@item natural_t reactivations
+@item unsigned int reactivations
number of reactivated pages
-@item natural_t pageins
+@item unsigned int pageins
number of actual pageins
-@item natural_t cow_faults
+@item unsigned int cow_faults
number of copy-on-write faults
-@item natural_t messages_sent
+@item unsigned int messages_sent
number of messages sent
-@item natural_t messages_received
+@item unsigned int messages_received
number of messages received
@end table
@end deftp
diff --git a/include/mach/task_info.h b/include/mach/task_info.h
index 5607178c..c8f171da 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 */
+ unsigned int faults; /* number of page faults */
+ unsigned int zero_fills; /* number of zero fill pages */
+ unsigned int reactivations; /* number of reactivated pages */
+ unsigned int pageins; /* number of actual pageins */
+ unsigned int cow_faults; /* number of copy-on-write faults */
+ unsigned int messages_sent; /* number of messages sent */
+ unsigned int 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
--
2.37.2
- [PATCH] Make task_info.h structs more portable,
Flavio Cruz <=