From 0d592163cdd7ff87b6cc68558d6c642ed530ce2a Mon Sep 17 00:00:00 2001 From: Eugene Syromyatnikov Date: Thu, 15 Feb 2018 19:41:28 +0100 Subject: [PATCH] xlat: update the list of SCHED_FLAG_* constants * xlat/sched_flags.in (SCHED_FLAG_RECLAIM, SCHED_FLAG_DL_OVERRUN): New constants introduced by linux kernel commits v4.13-rc1~205^2~27 and v4.16-rc1~164^2~8, respectively. (SCHED_FLAG_RESET_ON_FORK): Add constant value. * tests/sched_xetattr.c: Update expected output. * NEWS: Mention it. --- NEWS | 2 +- tests/sched_xetattr.c | 42 +++++++++++++++++++++++++++++++++++++++++- xlat/sched_flags.in | 4 +++- 3 files changed, 45 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 819c91f1..6123ca08 100644 --- a/NEWS +++ b/NEWS @@ -9,7 +9,7 @@ Noteworthy changes in release ?.?? (????-??-??) in brackets. * Enhanced NETLINK_ROUTE protocol decoding. * Updated lists of signal codes. - * Updated lists of POLL* and RWF_* constants. + * Updated lists of POLL*, RWF_*, and SCHED_FLAG_* constants. * Bug fixes * Fixed build on m68k. diff --git a/tests/sched_xetattr.c b/tests/sched_xetattr.c index a9bd2baa..af4a6c50 100644 --- a/tests/sched_xetattr.c +++ b/tests/sched_xetattr.c @@ -202,7 +202,7 @@ main(void) attr->size = 0x90807060; attr->sched_policy = 0xca7faced; - attr->sched_flags = 0xbadc0ded1057da7aULL; + attr->sched_flags = 0xbadc0ded1057da78ULL; attr->sched_nice = 0xafbfcfdf; attr->sched_priority = 0xb8c8d8e8; attr->sched_runtime = 0xbadcaffedeadf157ULL; @@ -239,6 +239,46 @@ main(void) (unsigned long long) ill, errstr); } + + attr->size = 0x90807060; + attr->sched_policy = 0xca7faced; + attr->sched_flags = 0xfULL; + attr->sched_nice = 0xafbfcfdf; + attr->sched_priority = 0xb8c8d8e8; + attr->sched_runtime = 0xbadcaffedeadf157ULL; + attr->sched_deadline = 0xc0de70a57badac75ULL; + attr->sched_period = 0xded1ca7edda7aca7ULL; + + sys_sched_setattr(bogus_pid, (unsigned long) attr, bogus_flags); + printf("sched_setattr(%d, {size=%u, sched_policy=%#x /* SCHED_??? */, " + "sched_flags=SCHED_FLAG_RESET_ON_FORK|SCHED_FLAG_RECLAIM|" + "SCHED_FLAG_DL_OVERRUN|0x8, " + "sched_nice=%d, sched_priority=%u, sched_runtime=%" PRIu64 ", " + "sched_deadline=%" PRIu64 ", sched_period=%" PRIu64 ", ...}, %u)" + " = %s\n", + (int) bogus_pid, + attr->size, + attr->sched_policy, + attr->sched_nice, + attr->sched_priority, + attr->sched_runtime, + attr->sched_deadline, + attr->sched_period, + (unsigned) bogus_flags, errstr); + + if (F8ILL_KULONG_SUPPORTED) { + const kernel_ulong_t ill = f8ill_ptr_to_kulong(attr); + + sys_sched_getattr(0, ill, sizeof(*attr), 0); + printf("sched_getattr(0, %#llx, %u, 0) = %s\n", + (unsigned long long) ill, (unsigned) sizeof(*attr), + errstr); + + sys_sched_setattr(0, ill, 0); + printf("sched_setattr(0, %#llx, 0) = %s\n", + (unsigned long long) ill, errstr); + } + puts("+++ exited with 0 +++"); return 0; } diff --git a/xlat/sched_flags.in b/xlat/sched_flags.in index 824d91dc..10c90661 100644 --- a/xlat/sched_flags.in +++ b/xlat/sched_flags.in @@ -1 +1,3 @@ -SCHED_FLAG_RESET_ON_FORK 1 +SCHED_FLAG_RESET_ON_FORK 1 +SCHED_FLAG_RECLAIM 2 +SCHED_FLAG_DL_OVERRUN 4