# define GET_REGS 24 /* get general process registers */
# define GET_RUSAGE 25 /* get resource usage */
-/* 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 */
-#define T_TIME_SEC m4_ll1 /* time in seconds since 1970 */
-#define T_TIME_NSEC m4_l5 /* number of nano seconds */
-
/* Field names for SYS_TRACE, SYS_PRIVCTL, SYS_STATECTL. */
#define CTL_ENDPT m2_i1 /* process number of the caller */
#define CTL_REQUEST m2_i2 /* server control request */
} mess_lsys_krn_sys_stime;
_ASSERT_MSG_SIZE(mess_lsys_krn_sys_stime);
+typedef struct {
+ time_t sec; /* time in seconds since 1970 */
+ long int nsec;
+ int now; /* non-zero for immediate, 0 for adjtime */
+ clockid_t clock_id;
+
+ uint8_t padding[36];
+} mess_lsys_krn_sys_settime;
+_ASSERT_MSG_SIZE(mess_lsys_krn_sys_settime);
+
typedef struct {
endpoint_t endpt;
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_settime m_lsys_krn_sys_settime;
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;
* m_type: SYS_SETTIME
*
* The parameters for this kernel call are:
- * m4_l2: T_SETTIME_NOW
- * m4_l3: T_CLOCK_ID
- * m4_ll1: T_TIME_SEC
- * m4_l5: T_TIME_NSEC
+ * m_lsys_krn_sys_settime.now
+ * m_lsys_krn_sys_settime.clock_id
+ * m_lsys_krn_sys_settime.sec
+ * m_lsys_krn_sys_settime.nsec
*/
#include "kernel/system.h"
int32_t ticks;
time_t timediff, timediff_ticks;
- if (m_ptr->T_CLOCK_ID != CLOCK_REALTIME) /* only realtime can change */
+ if (m_ptr->m_lsys_krn_sys_settime.clock_id != CLOCK_REALTIME) /* only realtime can change */
return EINVAL;
- if (m_ptr->T_SETTIME_NOW == 0) { /* user just wants to adjtime() */
+ if (m_ptr->m_lsys_krn_sys_settime.now == 0) { /* user just wants to adjtime() */
/* convert delta value from seconds and nseconds to ticks */
- ticks = (m_ptr->T_TIME_SEC * system_hz) +
- (m_ptr->T_TIME_NSEC/(1000000000/system_hz));
+ ticks = (m_ptr->m_lsys_krn_sys_settime.sec * system_hz) +
+ (m_ptr->m_lsys_krn_sys_settime.nsec/(1000000000/system_hz));
set_adjtime_delta(ticks);
return(OK);
} /* else user wants to set the time */
- timediff = m_ptr->T_TIME_SEC - boottime;
+ timediff = m_ptr->m_lsys_krn_sys_settime.sec - boottime;
timediff_ticks = timediff * system_hz;
/* prevent a negative value for realtime */
- if (m_ptr->T_TIME_SEC <= boottime ||
+ if (m_ptr->m_lsys_krn_sys_settime.sec <= boottime ||
timediff_ticks < LONG_MIN/2 || timediff_ticks > LONG_MAX/2) {
/* boottime was likely wrong, try to correct it. */
- boottime = m_ptr->T_TIME_SEC;
+ boottime = m_ptr->m_lsys_krn_sys_settime.sec;
set_realtime(1);
return(OK);
}
/* calculate the new value of realtime in ticks */
- newclock = timediff_ticks + (m_ptr->T_TIME_NSEC/(1000000000/system_hz));
+ newclock = timediff_ticks +
+ (m_ptr->m_lsys_krn_sys_settime.nsec/(1000000000/system_hz));
set_realtime(newclock);