Improved tabs.
El dom., 27 oct. 2019 a las 20:40, Samuel Thibault (<[email protected]>)
escribió:
> We are getting somewhere :)
>
> Now please fix the indentation (tabs vs spaces) to make it match what is
> already there in the file.
>
> Samuel
>
--- gnumach/include/mach/thread_info.h 2019-09-03 01:22:10.920747802 +0200
+++ GNUMach_SMP/include/mach/thread_info.h 2019-10-27 20:06:55.785860002 +0100
@@ -107,6 +107,7 @@
integer_t cur_priority; /* current priority */
/*boolean_t*/integer_t depressed; /* depressed ? */
integer_t depress_priority; /* priority depressed from */
+ integer_t last_processor; /* last processor used by the thread */
};
typedef struct thread_sched_info thread_sched_info_data_t;
--- gnumach/kern/thread.c 2019-09-03 01:22:10.932747830 +0200
+++ GNUMach_SMP/kern/thread.c 2019-10-27 20:51:37.330585145 +0100
@@ -1580,8 +1580,11 @@
else if (flavor == THREAD_SCHED_INFO) {
thread_sched_info_t sched_info;
- if (*thread_info_count < THREAD_SCHED_INFO_COUNT) {
- return KERN_INVALID_ARGUMENT;
+ /* Allow *thread_info_count to be one smaller than the
+ usual amount, because last_processor is a
+ new member that some callers might not know about. */
+ if (*thread_info_count < THREAD_SCHED_INFO_COUNT -1) {
+ return KERN_INVALID_ARGUMENT;
}
sched_info = (thread_sched_info_t) thread_info_out;
@@ -1609,6 +1612,12 @@
sched_info->depressed = (thread->depress_priority >= 0);
sched_info->depress_priority = thread->depress_priority;
+#if NCPUS > 1
+ sched_info->last_processor = thread->last_processor;
+#else
+ sched_info->last_processor = 0;
+#endif
+
thread_unlock(thread);
splx(s);