From 9d1ed02a04124d9f7eff54a95a146f5b04c1c94f Mon Sep 17 00:00:00 2001 From: Lionel Sambuc Date: Thu, 22 May 2014 15:30:51 +0200 Subject: [PATCH] Message type for SYS_STIME Change-Id: Ic4401e736bb66960e2ea4b30f5e1946dd93fd76e --- include/minix/com.h | 2 -- include/minix/ipc.h | 8 ++++++++ kernel/system/do_stime.c | 4 ++-- lib/libsys/sys_stime.c | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/include/minix/com.h b/include/minix/com.h index a931d6dee..f37f01d99 100644 --- a/include/minix/com.h +++ b/include/minix/com.h @@ -338,8 +338,6 @@ # define GET_REGS 24 /* get general process registers */ # define GET_RUSAGE 25 /* get resource usage */ -#define T_BOOTTIME m4_ll1 /* Boottime in seconds (also for SYS_STIME) */ - /* Field names for SYS_SETTIME. */ #define T_SETTIME_NOW m4_l2 /* non-zero for immediate, 0 for adjtime */ #define T_CLOCK_ID m4_l3 /* clock to adjust */ diff --git a/include/minix/ipc.h b/include/minix/ipc.h index 0f3e7fecc..f53c938e2 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -784,6 +784,13 @@ typedef struct { } mess_lsys_krn_sys_setalarm; _ASSERT_MSG_SIZE(mess_lsys_krn_sys_setalarm); +typedef struct { + time_t boot_time; + + uint8_t padding[48]; +} mess_lsys_krn_sys_stime; +_ASSERT_MSG_SIZE(mess_lsys_krn_sys_stime); + typedef struct { endpoint_t endpt; @@ -1595,6 +1602,7 @@ typedef struct { mess_lsys_krn_sys_memset m_lsys_krn_sys_memset; mess_lsys_krn_sys_sdevio m_lsys_krn_sys_sdevio; mess_lsys_krn_sys_setalarm m_lsys_krn_sys_setalarm; + mess_lsys_krn_sys_stime m_lsys_krn_sys_stime; mess_lsys_krn_sys_times m_lsys_krn_sys_times; mess_lsys_krn_sys_umap m_lsys_krn_sys_umap; mess_lsys_krn_sys_vdevio m_lsys_krn_sys_vdevio; diff --git a/kernel/system/do_stime.c b/kernel/system/do_stime.c index db6b6652a..2347f3652 100644 --- a/kernel/system/do_stime.c +++ b/kernel/system/do_stime.c @@ -2,7 +2,7 @@ * m_type: SYS_STIME * * The parameters for this kernel call are: - * m4_ll1: T_BOOTTIME + * m_lsys_krn_sys_stime.boot_time */ #include "kernel/system.h" @@ -14,6 +14,6 @@ *===========================================================================*/ int do_stime(struct proc * caller, message * m_ptr) { - boottime= m_ptr->T_BOOTTIME; + boottime = m_ptr->m_lsys_krn_sys_stime.boot_time; return(OK); } diff --git a/lib/libsys/sys_stime.c b/lib/libsys/sys_stime.c index e2b2bb587..a06a7a0a5 100644 --- a/lib/libsys/sys_stime.c +++ b/lib/libsys/sys_stime.c @@ -6,7 +6,7 @@ time_t boottime; /* New boottime */ message m; int r; - m.T_BOOTTIME = boottime; + m.m_lsys_krn_sys_stime.boot_time = boottime; r = _kernel_call(SYS_STIME, &m); return(r); }