コード例 #1
0
void kmain( void )
{
    __asm("cps 0x10"); // switch CPU to USER mode
    // **********************************************************************

    sys_settime(0x12345678CACACACA);

}
コード例 #2
0
/*===========================================================================*
 *				do_settime				     *
 *===========================================================================*/
int
do_settime(void)
{
  int s;

  if (mp->mp_effuid != SUPER_USER) {
      return(EPERM);
  }

  switch (m_in.m_lc_pm_time.clk_id) {
	case CLOCK_REALTIME:
		s = sys_settime(m_in.m_lc_pm_time.now, m_in.m_lc_pm_time.clk_id,
			m_in.m_lc_pm_time.sec, m_in.m_lc_pm_time.nsec);
		return(s);
	case CLOCK_MONOTONIC: /* monotonic cannot be changed */
	default:
		return EINVAL; /* invalid/unsupported clock_id */
  }
}