Changeset 364 for asp3_tinet_ecnl_arm/trunk/ntshell/src/ntshell_main.c
- Timestamp:
- Feb 1, 2019, 9:57:09 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
asp3_tinet_ecnl_arm/trunk/ntshell/src/ntshell_main.c
r352 r364 69 69 const struct utsname host_name = { 70 70 "TOPPERS/ASP3", 71 72 73 74 75 71 TARGET_NAME, 72 "3.2.0", 73 "3.2.0", 74 TARGET_NAME, 75 "toppers.jp" 76 76 }; 77 77 … … 88 88 jmp_buf process_exit; 89 89 void sys_init(void); 90 91 void ntshell_task_init() 92 { 90 NTSHELL_SERIAL_READ ntshell_serial_read = 0; 91 NTSHELL_SERIAL_WRITE ntshell_serial_write = 0; 92 void *ntshell_serial_extobj; 93 94 unsigned char ntstdio_xi(struct ntstdio_t *handle) 95 { 96 unsigned char buf[1]; 97 ntshell_serial_read((char *)buf, 1, ntshell_serial_extobj); 98 return buf[0]; 99 } 100 101 void ntstdio_xo(struct ntstdio_t *handle, unsigned char c) 102 { 103 char buf[1]; 104 buf[0] = c; 105 ntshell_serial_write(buf, 1, ntshell_serial_extobj); 106 } 107 108 void ntshell_task_init(NTSHELL_SERIAL_READ func_read, 109 NTSHELL_SERIAL_WRITE func_write, void *extobj) 110 { 111 ntshell_serial_read = func_read; 112 ntshell_serial_write = func_write; 113 ntshell_serial_extobj = extobj; 114 93 115 sys_init(); 94 116 … … 126 148 int result = 0; 127 149 int found = 0; 150 151 if (*args == 0) 152 return result; 128 153 129 154 if (strcmp((const char *)args[1], "help") == 0) { … … 295 320 int shell_clock_getres(clockid_t clk_id, struct timespec *res) 296 321 { 297 if ( clk_id != CLOCK_REALTIME)322 if ((clk_id != CLOCK_REALTIME) && (clk_id != CLOCK_MONOTONIC)) 298 323 return -EINVAL; 299 324 … … 308 333 SYSTIM now = 0; 309 334 310 if ( clk_id != CLOCK_REALTIME)335 if ((clk_id != CLOCK_REALTIME) && (clk_id != CLOCK_MONOTONIC)) 311 336 return -EINVAL; 312 337 … … 320 345 int shell_clock_settime(clockid_t clk_id, const struct timespec *tp) 321 346 { 322 if ( clk_id != CLOCK_REALTIME)347 if ((clk_id != CLOCK_REALTIME) && (clk_id != CLOCK_MONOTONIC)) 323 348 return -EINVAL; 324 349 325 rtc_write(tp->tv_sec); 350 SYSTIM time; 351 ER ret; 352 353 time = (tp->tv_sec * 1000000ll) + (tp->tv_nsec / 1000ll); 354 355 ret = set_tim(time); 356 if (ret != E_OK) { 357 return -EPERM; 358 } 326 359 327 360 return 0; … … 356 389 } 357 390 358 struct sigaction sigtable[ 6];391 struct sigaction sigtable[7]; 359 392 360 393 int shell_sigaction(int sig, const struct sigaction *restrict sa, struct sigaction *restrict old) … … 381 414 sat = &sigtable[5]; 382 415 break; 416 case SIGPIPE: 417 sat = &sigtable[6]; 418 break; 383 419 default: 384 420 return -EINVAL;
Note:
See TracChangeset
for help on using the changeset viewer.