vsprintf.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696
  1. /*
  2. * linux/lib/vsprintf.c
  3. *
  4. * Copyright (C) 1991, 1992 Linus Torvalds
  5. */
  6. /* vsprintf.c -- Lars Wirzenius & Linus Torvalds. */
  7. /*
  8. * Wirzenius wrote this portably, Torvalds fucked it up :-)
  9. */
  10. #include <stdarg.h>
  11. #include <linux/types.h>
  12. #include <linux/string.h>
  13. #include <linux/ctype.h>
  14. #include <common.h>
  15. #if !defined (CONFIG_PANIC_HANG)
  16. #include <command.h>
  17. /*cmd_boot.c*/
  18. extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  19. #endif
  20. #ifdef CONFIG_SYS_64BIT_VSPRINTF
  21. # define NUM_TYPE long long
  22. #else
  23. # define NUM_TYPE long
  24. #endif
  25. #define noinline __attribute__((noinline))
  26. #define do_div(n, base) ({ \
  27. unsigned int __res; \
  28. __res = ((unsigned NUM_TYPE) n) % base; \
  29. n = ((unsigned NUM_TYPE) n) / base; \
  30. __res; \
  31. })
  32. const char hex_asc[] = "0123456789abcdef";
  33. #define hex_asc_lo(x) hex_asc[((x) & 0x0f)]
  34. #define hex_asc_hi(x) hex_asc[((x) & 0xf0) >> 4]
  35. static inline char *pack_hex_byte(char *buf, u8 byte)
  36. {
  37. *buf++ = hex_asc_hi(byte);
  38. *buf++ = hex_asc_lo(byte);
  39. return buf;
  40. }
  41. unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base)
  42. {
  43. unsigned long result = 0,value;
  44. if (*cp == '0') {
  45. cp++;
  46. if ((*cp == 'x') && isxdigit(cp[1])) {
  47. base = 16;
  48. cp++;
  49. }
  50. if (!base) {
  51. base = 8;
  52. }
  53. }
  54. if (!base) {
  55. base = 10;
  56. }
  57. while (isxdigit(*cp) && (value = isdigit(*cp) ? *cp-'0' : (islower(*cp)
  58. ? toupper(*cp) : *cp)-'A'+10) < base) {
  59. result = result*base + value;
  60. cp++;
  61. }
  62. if (endp)
  63. *endp = (char *)cp;
  64. return result;
  65. }
  66. long simple_strtol(const char *cp,char **endp,unsigned int base)
  67. {
  68. if(*cp=='-')
  69. return -simple_strtoul(cp+1,endp,base);
  70. return simple_strtoul(cp,endp,base);
  71. }
  72. int ustrtoul(const char *cp, char **endp, unsigned int base)
  73. {
  74. unsigned long result = simple_strtoul(cp, endp, base);
  75. switch (**endp) {
  76. case 'G' :
  77. result *= 1024;
  78. /* fall through */
  79. case 'M':
  80. result *= 1024;
  81. /* fall through */
  82. case 'K':
  83. case 'k':
  84. result *= 1024;
  85. if ((*endp)[1] == 'i') {
  86. if ((*endp)[2] == 'B')
  87. (*endp) += 3;
  88. else
  89. (*endp) += 2;
  90. }
  91. }
  92. return result;
  93. }
  94. #ifdef CONFIG_SYS_64BIT_STRTOUL
  95. unsigned long long simple_strtoull (const char *cp, char **endp, unsigned int base)
  96. {
  97. unsigned long long result = 0, value;
  98. if (*cp == '0') {
  99. cp++;
  100. if ((*cp == 'x') && isxdigit (cp[1])) {
  101. base = 16;
  102. cp++;
  103. }
  104. if (!base) {
  105. base = 8;
  106. }
  107. }
  108. if (!base) {
  109. base = 10;
  110. }
  111. while (isxdigit (*cp) && (value = isdigit (*cp)
  112. ? *cp - '0'
  113. : (islower (*cp) ? toupper (*cp) : *cp) - 'A' + 10) < base) {
  114. result = result * base + value;
  115. cp++;
  116. }
  117. if (endp)
  118. *endp = (char *) cp;
  119. return result;
  120. }
  121. #endif /* CONFIG_SYS_64BIT_STRTOUL */
  122. /* we use this so that we can do without the ctype library */
  123. #define is_digit(c) ((c) >= '0' && (c) <= '9')
  124. static int skip_atoi(const char **s)
  125. {
  126. int i=0;
  127. while (is_digit(**s))
  128. i = i*10 + *((*s)++) - '0';
  129. return i;
  130. }
  131. /* Decimal conversion is by far the most typical, and is used
  132. * for /proc and /sys data. This directly impacts e.g. top performance
  133. * with many processes running. We optimize it for speed
  134. * using code from
  135. * http://www.cs.uiowa.edu/~jones/bcd/decimal.html
  136. * (with permission from the author, Douglas W. Jones). */
  137. /* Formats correctly any integer in [0,99999].
  138. * Outputs from one to five digits depending on input.
  139. * On i386 gcc 4.1.2 -O2: ~250 bytes of code. */
  140. static char* put_dec_trunc(char *buf, unsigned q)
  141. {
  142. unsigned d3, d2, d1, d0;
  143. d1 = (q>>4) & 0xf;
  144. d2 = (q>>8) & 0xf;
  145. d3 = (q>>12);
  146. d0 = 6*(d3 + d2 + d1) + (q & 0xf);
  147. q = (d0 * 0xcd) >> 11;
  148. d0 = d0 - 10*q;
  149. *buf++ = d0 + '0'; /* least significant digit */
  150. d1 = q + 9*d3 + 5*d2 + d1;
  151. if (d1 != 0) {
  152. q = (d1 * 0xcd) >> 11;
  153. d1 = d1 - 10*q;
  154. *buf++ = d1 + '0'; /* next digit */
  155. d2 = q + 2*d2;
  156. if ((d2 != 0) || (d3 != 0)) {
  157. q = (d2 * 0xd) >> 7;
  158. d2 = d2 - 10*q;
  159. *buf++ = d2 + '0'; /* next digit */
  160. d3 = q + 4*d3;
  161. if (d3 != 0) {
  162. q = (d3 * 0xcd) >> 11;
  163. d3 = d3 - 10*q;
  164. *buf++ = d3 + '0'; /* next digit */
  165. if (q != 0)
  166. *buf++ = q + '0'; /* most sign. digit */
  167. }
  168. }
  169. }
  170. return buf;
  171. }
  172. /* Same with if's removed. Always emits five digits */
  173. static char* put_dec_full(char *buf, unsigned q)
  174. {
  175. /* BTW, if q is in [0,9999], 8-bit ints will be enough, */
  176. /* but anyway, gcc produces better code with full-sized ints */
  177. unsigned d3, d2, d1, d0;
  178. d1 = (q>>4) & 0xf;
  179. d2 = (q>>8) & 0xf;
  180. d3 = (q>>12);
  181. /*
  182. * Possible ways to approx. divide by 10
  183. * gcc -O2 replaces multiply with shifts and adds
  184. * (x * 0xcd) >> 11: 11001101 - shorter code than * 0x67 (on i386)
  185. * (x * 0x67) >> 10: 1100111
  186. * (x * 0x34) >> 9: 110100 - same
  187. * (x * 0x1a) >> 8: 11010 - same
  188. * (x * 0x0d) >> 7: 1101 - same, shortest code (on i386)
  189. */
  190. d0 = 6*(d3 + d2 + d1) + (q & 0xf);
  191. q = (d0 * 0xcd) >> 11;
  192. d0 = d0 - 10*q;
  193. *buf++ = d0 + '0';
  194. d1 = q + 9*d3 + 5*d2 + d1;
  195. q = (d1 * 0xcd) >> 11;
  196. d1 = d1 - 10*q;
  197. *buf++ = d1 + '0';
  198. d2 = q + 2*d2;
  199. q = (d2 * 0xd) >> 7;
  200. d2 = d2 - 10*q;
  201. *buf++ = d2 + '0';
  202. d3 = q + 4*d3;
  203. q = (d3 * 0xcd) >> 11; /* - shorter code */
  204. /* q = (d3 * 0x67) >> 10; - would also work */
  205. d3 = d3 - 10*q;
  206. *buf++ = d3 + '0';
  207. *buf++ = q + '0';
  208. return buf;
  209. }
  210. /* No inlining helps gcc to use registers better */
  211. static noinline char* put_dec(char *buf, unsigned NUM_TYPE num)
  212. {
  213. while (1) {
  214. unsigned rem;
  215. if (num < 100000)
  216. return put_dec_trunc(buf, num);
  217. rem = do_div(num, 100000);
  218. buf = put_dec_full(buf, rem);
  219. }
  220. }
  221. #define ZEROPAD 1 /* pad with zero */
  222. #define SIGN 2 /* unsigned/signed long */
  223. #define PLUS 4 /* show plus */
  224. #define SPACE 8 /* space if plus */
  225. #define LEFT 16 /* left justified */
  226. #define SMALL 32 /* Must be 32 == 0x20 */
  227. #define SPECIAL 64 /* 0x */
  228. static char *number(char *buf, unsigned NUM_TYPE num, int base, int size, int precision, int type)
  229. {
  230. /* we are called with base 8, 10 or 16, only, thus don't need "G..." */
  231. static const char digits[16] = "0123456789ABCDEF"; /* "GHIJKLMNOPQRSTUVWXYZ"; */
  232. char tmp[66];
  233. char sign;
  234. char locase;
  235. int need_pfx = ((type & SPECIAL) && base != 10);
  236. int i;
  237. /* locase = 0 or 0x20. ORing digits or letters with 'locase'
  238. * produces same digits or (maybe lowercased) letters */
  239. locase = (type & SMALL);
  240. if (type & LEFT)
  241. type &= ~ZEROPAD;
  242. sign = 0;
  243. if (type & SIGN) {
  244. if ((signed NUM_TYPE) num < 0) {
  245. sign = '-';
  246. num = - (signed NUM_TYPE) num;
  247. size--;
  248. } else if (type & PLUS) {
  249. sign = '+';
  250. size--;
  251. } else if (type & SPACE) {
  252. sign = ' ';
  253. size--;
  254. }
  255. }
  256. if (need_pfx) {
  257. size--;
  258. if (base == 16)
  259. size--;
  260. }
  261. /* generate full string in tmp[], in reverse order */
  262. i = 0;
  263. if (num == 0)
  264. tmp[i++] = '0';
  265. /* Generic code, for any base:
  266. else do {
  267. tmp[i++] = (digits[do_div(num,base)] | locase);
  268. } while (num != 0);
  269. */
  270. else if (base != 10) { /* 8 or 16 */
  271. int mask = base - 1;
  272. int shift = 3;
  273. if (base == 16) shift = 4;
  274. do {
  275. tmp[i++] = (digits[((unsigned char)num) & mask] | locase);
  276. num >>= shift;
  277. } while (num);
  278. } else { /* base 10 */
  279. i = put_dec(tmp, num) - tmp;
  280. }
  281. /* printing 100 using %2d gives "100", not "00" */
  282. if (i > precision)
  283. precision = i;
  284. /* leading space padding */
  285. size -= precision;
  286. if (!(type & (ZEROPAD+LEFT)))
  287. while(--size >= 0)
  288. *buf++ = ' ';
  289. /* sign */
  290. if (sign)
  291. *buf++ = sign;
  292. /* "0x" / "0" prefix */
  293. if (need_pfx) {
  294. *buf++ = '0';
  295. if (base == 16)
  296. *buf++ = ('X' | locase);
  297. }
  298. /* zero or space padding */
  299. if (!(type & LEFT)) {
  300. char c = (type & ZEROPAD) ? '0' : ' ';
  301. while (--size >= 0)
  302. *buf++ = c;
  303. }
  304. /* hmm even more zero padding? */
  305. while (i <= --precision)
  306. *buf++ = '0';
  307. /* actual digits of result */
  308. while (--i >= 0)
  309. *buf++ = tmp[i];
  310. /* trailing space padding */
  311. while (--size >= 0)
  312. *buf++ = ' ';
  313. return buf;
  314. }
  315. static char *string(char *buf, char *s, int field_width, int precision, int flags)
  316. {
  317. int len, i;
  318. if (s == 0)
  319. s = "<NULL>";
  320. len = strnlen(s, precision);
  321. if (!(flags & LEFT))
  322. while (len < field_width--)
  323. *buf++ = ' ';
  324. for (i = 0; i < len; ++i)
  325. *buf++ = *s++;
  326. while (len < field_width--)
  327. *buf++ = ' ';
  328. return buf;
  329. }
  330. #ifdef CONFIG_CMD_NET
  331. static char *mac_address_string(char *buf, u8 *addr, int field_width,
  332. int precision, int flags)
  333. {
  334. char mac_addr[6 * 3]; /* (6 * 2 hex digits), 5 colons and trailing zero */
  335. char *p = mac_addr;
  336. int i;
  337. for (i = 0; i < 6; i++) {
  338. p = pack_hex_byte(p, addr[i]);
  339. if (!(flags & SPECIAL) && i != 5)
  340. *p++ = ':';
  341. }
  342. *p = '\0';
  343. return string(buf, mac_addr, field_width, precision, flags & ~SPECIAL);
  344. }
  345. static char *ip6_addr_string(char *buf, u8 *addr, int field_width,
  346. int precision, int flags)
  347. {
  348. char ip6_addr[8 * 5]; /* (8 * 4 hex digits), 7 colons and trailing zero */
  349. char *p = ip6_addr;
  350. int i;
  351. for (i = 0; i < 8; i++) {
  352. p = pack_hex_byte(p, addr[2 * i]);
  353. p = pack_hex_byte(p, addr[2 * i + 1]);
  354. if (!(flags & SPECIAL) && i != 7)
  355. *p++ = ':';
  356. }
  357. *p = '\0';
  358. return string(buf, ip6_addr, field_width, precision, flags & ~SPECIAL);
  359. }
  360. static char *ip4_addr_string(char *buf, u8 *addr, int field_width,
  361. int precision, int flags)
  362. {
  363. char ip4_addr[4 * 4]; /* (4 * 3 decimal digits), 3 dots and trailing zero */
  364. char temp[3]; /* hold each IP quad in reverse order */
  365. char *p = ip4_addr;
  366. int i, digits;
  367. for (i = 0; i < 4; i++) {
  368. digits = put_dec_trunc(temp, addr[i]) - temp;
  369. /* reverse the digits in the quad */
  370. while (digits--)
  371. *p++ = temp[digits];
  372. if (i != 3)
  373. *p++ = '.';
  374. }
  375. *p = '\0';
  376. return string(buf, ip4_addr, field_width, precision, flags & ~SPECIAL);
  377. }
  378. #endif
  379. /*
  380. * Show a '%p' thing. A kernel extension is that the '%p' is followed
  381. * by an extra set of alphanumeric characters that are extended format
  382. * specifiers.
  383. *
  384. * Right now we handle:
  385. *
  386. * - 'M' For a 6-byte MAC address, it prints the address in the
  387. * usual colon-separated hex notation
  388. * - 'I' [46] for IPv4/IPv6 addresses printed in the usual way (dot-separated
  389. * decimal for v4 and colon separated network-order 16 bit hex for v6)
  390. * - 'i' [46] for 'raw' IPv4/IPv6 addresses, IPv6 omits the colons, IPv4 is
  391. * currently the same
  392. *
  393. * Note: The difference between 'S' and 'F' is that on ia64 and ppc64
  394. * function pointers are really function descriptors, which contain a
  395. * pointer to the real address.
  396. */
  397. static char *pointer(const char *fmt, char *buf, void *ptr, int field_width, int precision, int flags)
  398. {
  399. if (!ptr)
  400. return string(buf, "(null)", field_width, precision, flags);
  401. #ifdef CONFIG_CMD_NET
  402. switch (*fmt) {
  403. case 'm':
  404. flags |= SPECIAL;
  405. /* Fallthrough */
  406. case 'M':
  407. return mac_address_string(buf, ptr, field_width, precision, flags);
  408. case 'i':
  409. flags |= SPECIAL;
  410. /* Fallthrough */
  411. case 'I':
  412. if (fmt[1] == '6')
  413. return ip6_addr_string(buf, ptr, field_width, precision, flags);
  414. if (fmt[1] == '4')
  415. return ip4_addr_string(buf, ptr, field_width, precision, flags);
  416. flags &= ~SPECIAL;
  417. break;
  418. }
  419. #endif
  420. flags |= SMALL;
  421. if (field_width == -1) {
  422. field_width = 2*sizeof(void *);
  423. flags |= ZEROPAD;
  424. }
  425. return number(buf, (unsigned long) ptr, 16, field_width, precision, flags);
  426. }
  427. /**
  428. * vsprintf - Format a string and place it in a buffer
  429. * @buf: The buffer to place the result into
  430. * @fmt: The format string to use
  431. * @args: Arguments for the format string
  432. *
  433. * This function follows C99 vsprintf, but has some extensions:
  434. * %pS output the name of a text symbol
  435. * %pF output the name of a function pointer
  436. * %pR output the address range in a struct resource
  437. *
  438. * The function returns the number of characters written
  439. * into @buf.
  440. *
  441. * Call this function if you are already dealing with a va_list.
  442. * You probably want sprintf() instead.
  443. */
  444. int vsprintf(char *buf, const char *fmt, va_list args)
  445. {
  446. unsigned NUM_TYPE num;
  447. int base;
  448. char *str;
  449. int flags; /* flags to number() */
  450. int field_width; /* width of output field */
  451. int precision; /* min. # of digits for integers; max
  452. number of chars for from string */
  453. int qualifier; /* 'h', 'l', or 'L' for integer fields */
  454. /* 'z' support added 23/7/1999 S.H. */
  455. /* 'z' changed to 'Z' --davidm 1/25/99 */
  456. /* 't' added for ptrdiff_t */
  457. str = buf;
  458. for (; *fmt ; ++fmt) {
  459. if (*fmt != '%') {
  460. *str++ = *fmt;
  461. continue;
  462. }
  463. /* process flags */
  464. flags = 0;
  465. repeat:
  466. ++fmt; /* this also skips first '%' */
  467. switch (*fmt) {
  468. case '-': flags |= LEFT; goto repeat;
  469. case '+': flags |= PLUS; goto repeat;
  470. case ' ': flags |= SPACE; goto repeat;
  471. case '#': flags |= SPECIAL; goto repeat;
  472. case '0': flags |= ZEROPAD; goto repeat;
  473. }
  474. /* get field width */
  475. field_width = -1;
  476. if (is_digit(*fmt))
  477. field_width = skip_atoi(&fmt);
  478. else if (*fmt == '*') {
  479. ++fmt;
  480. /* it's the next argument */
  481. field_width = va_arg(args, int);
  482. if (field_width < 0) {
  483. field_width = -field_width;
  484. flags |= LEFT;
  485. }
  486. }
  487. /* get the precision */
  488. precision = -1;
  489. if (*fmt == '.') {
  490. ++fmt;
  491. if (is_digit(*fmt))
  492. precision = skip_atoi(&fmt);
  493. else if (*fmt == '*') {
  494. ++fmt;
  495. /* it's the next argument */
  496. precision = va_arg(args, int);
  497. }
  498. if (precision < 0)
  499. precision = 0;
  500. }
  501. /* get the conversion qualifier */
  502. qualifier = -1;
  503. if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' ||
  504. *fmt == 'Z' || *fmt == 'z' || *fmt == 't') {
  505. qualifier = *fmt;
  506. ++fmt;
  507. if (qualifier == 'l' && *fmt == 'l') {
  508. qualifier = 'L';
  509. ++fmt;
  510. }
  511. }
  512. /* default base */
  513. base = 10;
  514. switch (*fmt) {
  515. case 'c':
  516. if (!(flags & LEFT))
  517. while (--field_width > 0)
  518. *str++ = ' ';
  519. *str++ = (unsigned char) va_arg(args, int);
  520. while (--field_width > 0)
  521. *str++ = ' ';
  522. continue;
  523. case 's':
  524. str = string(str, va_arg(args, char *), field_width, precision, flags);
  525. continue;
  526. case 'p':
  527. str = pointer(fmt+1, str,
  528. va_arg(args, void *),
  529. field_width, precision, flags);
  530. /* Skip all alphanumeric pointer suffixes */
  531. while (isalnum(fmt[1]))
  532. fmt++;
  533. continue;
  534. case 'n':
  535. if (qualifier == 'l') {
  536. long * ip = va_arg(args, long *);
  537. *ip = (str - buf);
  538. } else {
  539. int * ip = va_arg(args, int *);
  540. *ip = (str - buf);
  541. }
  542. continue;
  543. case '%':
  544. *str++ = '%';
  545. continue;
  546. /* integer number formats - set up the flags and "break" */
  547. case 'o':
  548. base = 8;
  549. break;
  550. case 'x':
  551. flags |= SMALL;
  552. case 'X':
  553. base = 16;
  554. break;
  555. case 'd':
  556. case 'i':
  557. flags |= SIGN;
  558. case 'u':
  559. break;
  560. default:
  561. *str++ = '%';
  562. if (*fmt)
  563. *str++ = *fmt;
  564. else
  565. --fmt;
  566. continue;
  567. }
  568. #ifdef CONFIG_SYS_64BIT_VSPRINTF
  569. if (qualifier == 'L') /* "quad" for 64 bit variables */
  570. num = va_arg(args, unsigned long long);
  571. else
  572. #endif
  573. if (qualifier == 'l') {
  574. num = va_arg(args, unsigned long);
  575. if (flags & SIGN)
  576. num = (signed long) num;
  577. } else if (qualifier == 'Z' || qualifier == 'z') {
  578. num = va_arg(args, size_t);
  579. } else if (qualifier == 't') {
  580. num = va_arg(args, ptrdiff_t);
  581. } else if (qualifier == 'h') {
  582. num = (unsigned short) va_arg(args, int);
  583. if (flags & SIGN)
  584. num = (signed short) num;
  585. } else {
  586. num = va_arg(args, unsigned int);
  587. if (flags & SIGN)
  588. num = (signed int) num;
  589. }
  590. str = number(str, num, base, field_width, precision, flags);
  591. }
  592. *str = '\0';
  593. return str-buf;
  594. }
  595. /**
  596. * sprintf - Format a string and place it in a buffer
  597. * @buf: The buffer to place the result into
  598. * @fmt: The format string to use
  599. * @...: Arguments for the format string
  600. *
  601. * The function returns the number of characters written
  602. * into @buf.
  603. *
  604. * See the vsprintf() documentation for format string extensions over C99.
  605. */
  606. int sprintf(char * buf, const char *fmt, ...)
  607. {
  608. va_list args;
  609. int i;
  610. va_start(args, fmt);
  611. i=vsprintf(buf,fmt,args);
  612. va_end(args);
  613. return i;
  614. }
  615. void panic(const char *fmt, ...)
  616. {
  617. va_list args;
  618. va_start(args, fmt);
  619. vprintf(fmt, args);
  620. putc('\n');
  621. va_end(args);
  622. #if defined (CONFIG_PANIC_HANG)
  623. hang();
  624. #else
  625. udelay (100000); /* allow messages to go out */
  626. do_reset (NULL, 0, 0, NULL);
  627. #endif
  628. }