ppc_linux.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589
  1. /*
  2. * (C) Copyright 2008 Semihalf
  3. *
  4. * (C) Copyright 2000-2006
  5. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  6. *
  7. * See file CREDITS for list of people who contributed to this
  8. * project.
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License as
  12. * published by the Free Software Foundation; either version 2 of
  13. * the License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  23. * MA 02111-1307 USA
  24. */
  25. #include <common.h>
  26. #include <watchdog.h>
  27. #include <command.h>
  28. #include <image.h>
  29. #include <malloc.h>
  30. #include <zlib.h>
  31. #include <bzlib.h>
  32. #include <environment.h>
  33. #include <asm/byteorder.h>
  34. #if defined(CONFIG_OF_LIBFDT)
  35. #include <fdt.h>
  36. #include <libfdt.h>
  37. #include <fdt_support.h>
  38. #elif defined(CONFIG_OF_FLAT_TREE)
  39. #include <ft_build.h>
  40. #endif
  41. #ifdef CONFIG_LOGBUFFER
  42. #include <logbuff.h>
  43. #endif
  44. #ifdef CFG_INIT_RAM_LOCK
  45. #include <asm/cache.h>
  46. #endif
  47. DECLARE_GLOBAL_DATA_PTR;
  48. extern image_header_t header;
  49. /*cmd_boot.c*/
  50. extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  51. #if defined(CONFIG_CMD_BDI)
  52. extern int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
  53. #endif
  54. void __attribute__((noinline))
  55. do_bootm_linux (cmd_tbl_t *cmdtp, int flag,
  56. int argc, char *argv[],
  57. ulong addr,
  58. ulong *len_ptr,
  59. int verify)
  60. {
  61. ulong sp;
  62. ulong len;
  63. ulong initrd_start, initrd_end;
  64. ulong cmd_start, cmd_end;
  65. ulong initrd_high;
  66. ulong data;
  67. int initrd_copy_to_ram = 1;
  68. char *cmdline;
  69. char *s;
  70. bd_t *kbd;
  71. void (*kernel)(bd_t *, ulong, ulong, ulong, ulong);
  72. image_header_t *hdr = &header;
  73. #if defined(CONFIG_OF_FLAT_TREE) || defined(CONFIG_OF_LIBFDT)
  74. char *of_flat_tree = NULL;
  75. ulong of_data = 0;
  76. #endif
  77. if ((s = getenv ("initrd_high")) != NULL) {
  78. /* a value of "no" or a similar string will act like 0,
  79. * turning the "load high" feature off. This is intentional.
  80. */
  81. initrd_high = simple_strtoul(s, NULL, 16);
  82. if (initrd_high == ~0)
  83. initrd_copy_to_ram = 0;
  84. } else { /* not set, no restrictions to load high */
  85. initrd_high = ~0;
  86. }
  87. #ifdef CONFIG_LOGBUFFER
  88. kbd=gd->bd;
  89. /* Prevent initrd from overwriting logbuffer */
  90. if (initrd_high < (kbd->bi_memsize-LOGBUFF_LEN-LOGBUFF_OVERHEAD))
  91. initrd_high = kbd->bi_memsize-LOGBUFF_LEN-LOGBUFF_OVERHEAD;
  92. debug ("## Logbuffer at 0x%08lX ", kbd->bi_memsize-LOGBUFF_LEN);
  93. #endif
  94. /*
  95. * Booting a (Linux) kernel image
  96. *
  97. * Allocate space for command line and board info - the
  98. * address should be as high as possible within the reach of
  99. * the kernel (see CFG_BOOTMAPSZ settings), but in unused
  100. * memory, which means far enough below the current stack
  101. * pointer.
  102. */
  103. asm( "mr %0,1": "=r"(sp) : );
  104. debug ("## Current stack ends at 0x%08lX ", sp);
  105. sp -= 2048; /* just to be sure */
  106. if (sp > CFG_BOOTMAPSZ)
  107. sp = CFG_BOOTMAPSZ;
  108. sp &= ~0xF;
  109. debug ("=> set upper limit to 0x%08lX\n", sp);
  110. cmdline = (char *)((sp - CFG_BARGSIZE) & ~0xF);
  111. kbd = (bd_t *)(((ulong)cmdline - sizeof(bd_t)) & ~0xF);
  112. if ((s = getenv("bootargs")) == NULL)
  113. s = "";
  114. strcpy (cmdline, s);
  115. cmd_start = (ulong)&cmdline[0];
  116. cmd_end = cmd_start + strlen(cmdline);
  117. *kbd = *(gd->bd);
  118. #ifdef DEBUG
  119. printf ("## cmdline at 0x%08lX ... 0x%08lX\n", cmd_start, cmd_end);
  120. #if defined(CONFIG_CMD_BDI)
  121. do_bdinfo (NULL, 0, 0, NULL);
  122. #endif
  123. #endif
  124. if ((s = getenv ("clocks_in_mhz")) != NULL) {
  125. /* convert all clock information to MHz */
  126. kbd->bi_intfreq /= 1000000L;
  127. kbd->bi_busfreq /= 1000000L;
  128. #if defined(CONFIG_MPC8220)
  129. kbd->bi_inpfreq /= 1000000L;
  130. kbd->bi_pcifreq /= 1000000L;
  131. kbd->bi_pevfreq /= 1000000L;
  132. kbd->bi_flbfreq /= 1000000L;
  133. kbd->bi_vcofreq /= 1000000L;
  134. #endif
  135. #if defined(CONFIG_CPM2)
  136. kbd->bi_cpmfreq /= 1000000L;
  137. kbd->bi_brgfreq /= 1000000L;
  138. kbd->bi_sccfreq /= 1000000L;
  139. kbd->bi_vco /= 1000000L;
  140. #endif
  141. #if defined(CONFIG_MPC5xxx)
  142. kbd->bi_ipbfreq /= 1000000L;
  143. kbd->bi_pcifreq /= 1000000L;
  144. #endif /* CONFIG_MPC5xxx */
  145. }
  146. kernel = (void (*)(bd_t *, ulong, ulong, ulong, ulong))image_get_ep (hdr);
  147. /*
  148. * Check if there is an initrd image
  149. */
  150. #if defined(CONFIG_OF_FLAT_TREE) || defined(CONFIG_OF_LIBFDT)
  151. /* Look for a '-' which indicates to ignore the ramdisk argument */
  152. if (argc >= 3 && strcmp(argv[2], "-") == 0) {
  153. debug ("Skipping initrd\n");
  154. len = data = 0;
  155. }
  156. else
  157. #endif
  158. if (argc >= 3) {
  159. debug ("Not skipping initrd\n");
  160. show_boot_progress (9);
  161. addr = simple_strtoul(argv[2], NULL, 16);
  162. printf ("## Loading RAMDisk Image at %08lx ...\n", addr);
  163. hdr = (image_header_t *)addr;
  164. if (!image_check_magic (hdr)) {
  165. puts ("Bad Magic Number\n");
  166. show_boot_progress (-10);
  167. do_reset (cmdtp, flag, argc, argv);
  168. }
  169. if (!image_check_hcrc (hdr)) {
  170. puts ("Bad Header Checksum\n");
  171. show_boot_progress (-11);
  172. do_reset (cmdtp, flag, argc, argv);
  173. }
  174. show_boot_progress (10);
  175. print_image_hdr (hdr);
  176. if (verify) {
  177. puts (" Verifying Checksum ... ");
  178. if (!image_check_dcrc_wd (hdr, CHUNKSZ)) {
  179. puts ("Bad Data CRC\n");
  180. show_boot_progress (-12);
  181. do_reset (cmdtp, flag, argc, argv);
  182. }
  183. puts ("OK\n");
  184. }
  185. show_boot_progress (11);
  186. if (!image_check_os (hdr, IH_OS_LINUX) ||
  187. !image_check_arch (hdr, IH_ARCH_PPC) ||
  188. !image_check_type (hdr, IH_TYPE_RAMDISK)) {
  189. puts ("No Linux PPC Ramdisk Image\n");
  190. show_boot_progress (-13);
  191. do_reset (cmdtp, flag, argc, argv);
  192. }
  193. data = image_get_data (hdr);
  194. len = image_get_data_size (hdr);
  195. /*
  196. * Now check if we have a multifile image
  197. */
  198. } else if (image_check_type (hdr, IH_TYPE_MULTI) && (len_ptr[1])) {
  199. u_long tail = image_to_cpu (len_ptr[0]) % 4;
  200. int i;
  201. show_boot_progress (13);
  202. /* skip kernel length and terminator */
  203. data = (ulong)(&len_ptr[2]);
  204. /* skip any additional image length fields */
  205. for (i=1; len_ptr[i]; ++i)
  206. data += 4;
  207. /* add kernel length, and align */
  208. data += image_to_cpu (len_ptr[0]);
  209. if (tail) {
  210. data += 4 - tail;
  211. }
  212. len = image_to_cpu (len_ptr[1]);
  213. } else {
  214. /*
  215. * no initrd image
  216. */
  217. show_boot_progress (14);
  218. len = data = 0;
  219. }
  220. #if defined(CONFIG_OF_FLAT_TREE) || defined(CONFIG_OF_LIBFDT)
  221. if(argc > 3) {
  222. of_flat_tree = (char *) simple_strtoul(argv[3], NULL, 16);
  223. hdr = (image_header_t *)of_flat_tree;
  224. #if defined(CONFIG_OF_FLAT_TREE)
  225. if (*((ulong *)(of_flat_tree + image_get_header_size ())) != OF_DT_HEADER) {
  226. #elif defined(CONFIG_OF_LIBFDT)
  227. if (fdt_check_header (of_flat_tree + image_get_header_size ()) != 0) {
  228. #endif
  229. #ifndef CFG_NO_FLASH
  230. if (addr2info((ulong)of_flat_tree) != NULL)
  231. of_data = (ulong)of_flat_tree;
  232. #endif
  233. } else if (image_check_magic (hdr)) {
  234. printf("## Flat Device Tree at %08lX\n", hdr);
  235. print_image_hdr (hdr);
  236. if ((image_get_load (hdr) < ((unsigned long)hdr + image_get_image_size (hdr))) &&
  237. ((image_get_load (hdr) + image_get_data_size (hdr)) > (unsigned long)hdr)) {
  238. puts ("ERROR: fdt overwritten - "
  239. "must RESET the board to recover.\n");
  240. do_reset (cmdtp, flag, argc, argv);
  241. }
  242. puts (" Verifying Checksum ... ");
  243. if (!image_check_hcrc (hdr)) {
  244. puts ("ERROR: fdt header checksum invalid - "
  245. "must RESET the board to recover.\n");
  246. do_reset (cmdtp, flag, argc, argv);
  247. }
  248. if (!image_check_dcrc (hdr)) {
  249. puts ("ERROR: fdt checksum invalid - "
  250. "must RESET the board to recover.\n");
  251. do_reset (cmdtp, flag, argc, argv);
  252. }
  253. puts ("OK\n");
  254. if (!image_check_type (hdr, IH_TYPE_FLATDT)) {
  255. puts ("ERROR: uImage is not a fdt - "
  256. "must RESET the board to recover.\n");
  257. do_reset (cmdtp, flag, argc, argv);
  258. }
  259. if (image_get_comp (hdr) != IH_COMP_NONE) {
  260. puts ("ERROR: uImage is compressed - "
  261. "must RESET the board to recover.\n");
  262. do_reset (cmdtp, flag, argc, argv);
  263. }
  264. #if defined(CONFIG_OF_FLAT_TREE)
  265. if (*((ulong *)(of_flat_tree + image_get_header_size ())) != OF_DT_HEADER) {
  266. #elif defined(CONFIG_OF_LIBFDT)
  267. if (fdt_check_header (of_flat_tree + image_get_header_size ()) != 0) {
  268. #endif
  269. puts ("ERROR: uImage data is not a fdt - "
  270. "must RESET the board to recover.\n");
  271. do_reset (cmdtp, flag, argc, argv);
  272. }
  273. memmove ((void *)image_get_load (hdr),
  274. (void *)(of_flat_tree + image_get_header_size ()),
  275. image_get_data_size (hdr));
  276. of_flat_tree = (char *)image_get_load (hdr);
  277. } else {
  278. puts ("Did not find a flat Flat Device Tree.\n"
  279. "Must RESET the board to recover.\n");
  280. do_reset (cmdtp, flag, argc, argv);
  281. }
  282. printf (" Booting using the fdt at 0x%x\n",
  283. of_flat_tree);
  284. } else if (image_check_type (hdr, IH_TYPE_MULTI) && (len_ptr[1]) && (len_ptr[2])) {
  285. u_long tail = image_to_cpu (len_ptr[0]) % 4;
  286. int i;
  287. /* skip kernel length, initrd length, and terminator */
  288. of_flat_tree = (char *)(&len_ptr[3]);
  289. /* skip any additional image length fields */
  290. for (i=2; len_ptr[i]; ++i)
  291. of_flat_tree += 4;
  292. /* add kernel length, and align */
  293. of_flat_tree += image_to_cpu (len_ptr[0]);
  294. if (tail) {
  295. of_flat_tree += 4 - tail;
  296. }
  297. /* add initrd length, and align */
  298. tail = image_to_cpu (len_ptr[1]) % 4;
  299. of_flat_tree += image_to_cpu (len_ptr[1]);
  300. if (tail) {
  301. of_flat_tree += 4 - tail;
  302. }
  303. #ifndef CFG_NO_FLASH
  304. /* move the blob if it is in flash (set of_data to !null) */
  305. if (addr2info ((ulong)of_flat_tree) != NULL)
  306. of_data = (ulong)of_flat_tree;
  307. #endif
  308. #if defined(CONFIG_OF_FLAT_TREE)
  309. if (*((ulong *)(of_flat_tree)) != OF_DT_HEADER) {
  310. #elif defined(CONFIG_OF_LIBFDT)
  311. if (fdt_check_header (of_flat_tree) != 0) {
  312. #endif
  313. puts ("ERROR: image is not a fdt - "
  314. "must RESET the board to recover.\n");
  315. do_reset (cmdtp, flag, argc, argv);
  316. }
  317. #if defined(CONFIG_OF_FLAT_TREE)
  318. if (((struct boot_param_header *)of_flat_tree)->totalsize !=
  319. image_to_cpu (len_ptr[2])) {
  320. #elif defined(CONFIG_OF_LIBFDT)
  321. if (be32_to_cpu (fdt_totalsize (of_flat_tree)) !=
  322. image_to_cpu (len_ptr[2])) {
  323. #endif
  324. puts ("ERROR: fdt size != image size - "
  325. "must RESET the board to recover.\n");
  326. do_reset (cmdtp, flag, argc, argv);
  327. }
  328. }
  329. #endif
  330. if (!data) {
  331. debug ("No initrd\n");
  332. }
  333. if (data) {
  334. if (!initrd_copy_to_ram) { /* zero-copy ramdisk support */
  335. initrd_start = data;
  336. initrd_end = initrd_start + len;
  337. } else {
  338. initrd_start = (ulong)kbd - len;
  339. initrd_start &= ~(4096 - 1); /* align on page */
  340. if (initrd_high) {
  341. ulong nsp;
  342. /*
  343. * the inital ramdisk does not need to be within
  344. * CFG_BOOTMAPSZ as it is not accessed until after
  345. * the mm system is initialised.
  346. *
  347. * do the stack bottom calculation again and see if
  348. * the initrd will fit just below the monitor stack
  349. * bottom without overwriting the area allocated
  350. * above for command line args and board info.
  351. */
  352. asm( "mr %0,1": "=r"(nsp) : );
  353. nsp -= 2048; /* just to be sure */
  354. nsp &= ~0xF;
  355. if (nsp > initrd_high) /* limit as specified */
  356. nsp = initrd_high;
  357. nsp -= len;
  358. nsp &= ~(4096 - 1); /* align on page */
  359. if (nsp >= sp)
  360. initrd_start = nsp;
  361. }
  362. show_boot_progress (12);
  363. debug ("## initrd at 0x%08lX ... 0x%08lX (len=%ld=0x%lX)\n",
  364. data, data + len - 1, len, len);
  365. initrd_end = initrd_start + len;
  366. printf (" Loading Ramdisk to %08lx, end %08lx ... ",
  367. initrd_start, initrd_end);
  368. #if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG)
  369. {
  370. size_t l = len;
  371. void *to = (void *)initrd_start;
  372. void *from = (void *)data;
  373. while (l > 0) {
  374. size_t tail = (l > CHUNKSZ) ? CHUNKSZ : l;
  375. WATCHDOG_RESET();
  376. memmove (to, from, tail);
  377. to += tail;
  378. from += tail;
  379. l -= tail;
  380. }
  381. }
  382. #else /* !(CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG) */
  383. memmove ((void *)initrd_start, (void *)data, len);
  384. #endif /* CONFIG_HW_WATCHDOG || CONFIG_WATCHDOG */
  385. puts ("OK\n");
  386. }
  387. } else {
  388. initrd_start = 0;
  389. initrd_end = 0;
  390. }
  391. #if defined(CONFIG_OF_LIBFDT)
  392. #ifdef CFG_BOOTMAPSZ
  393. /*
  394. * The blob must be within CFG_BOOTMAPSZ,
  395. * so we flag it to be copied if it is not.
  396. */
  397. if (of_flat_tree >= (char *)CFG_BOOTMAPSZ)
  398. of_data = (ulong)of_flat_tree;
  399. #endif
  400. /* move of_flat_tree if needed */
  401. if (of_data) {
  402. int err;
  403. ulong of_start, of_len;
  404. of_len = be32_to_cpu(fdt_totalsize(of_data));
  405. /* position on a 4K boundary before the kbd */
  406. of_start = (ulong)kbd - of_len;
  407. of_start &= ~(4096 - 1); /* align on page */
  408. debug ("## device tree at 0x%08lX ... 0x%08lX (len=%ld=0x%lX)\n",
  409. of_data, of_data + of_len - 1, of_len, of_len);
  410. of_flat_tree = (char *)of_start;
  411. printf (" Loading Device Tree to %08lx, end %08lx ... ",
  412. of_start, of_start + of_len - 1);
  413. err = fdt_open_into((void *)of_data, (void *)of_start, of_len);
  414. if (err != 0) {
  415. puts ("ERROR: fdt move failed - "
  416. "must RESET the board to recover.\n");
  417. do_reset (cmdtp, flag, argc, argv);
  418. }
  419. puts ("OK\n");
  420. }
  421. /*
  422. * Add the chosen node if it doesn't exist, add the env and bd_t
  423. * if the user wants it (the logic is in the subroutines).
  424. */
  425. if (of_flat_tree) {
  426. if (fdt_chosen(of_flat_tree, initrd_start, initrd_end, 0) < 0) {
  427. puts ("ERROR: /chosen node create failed - "
  428. "must RESET the board to recover.\n");
  429. do_reset (cmdtp, flag, argc, argv);
  430. }
  431. #ifdef CONFIG_OF_HAS_UBOOT_ENV
  432. if (fdt_env(of_flat_tree) < 0) {
  433. puts ("ERROR: /u-boot-env node create failed - "
  434. "must RESET the board to recover.\n");
  435. do_reset (cmdtp, flag, argc, argv);
  436. }
  437. #endif
  438. #ifdef CONFIG_OF_HAS_BD_T
  439. if (fdt_bd_t(of_flat_tree) < 0) {
  440. puts ("ERROR: /bd_t node create failed - "
  441. "must RESET the board to recover.\n");
  442. do_reset (cmdtp, flag, argc, argv);
  443. }
  444. #endif
  445. #ifdef CONFIG_OF_BOARD_SETUP
  446. /* Call the board-specific fixup routine */
  447. ft_board_setup(of_flat_tree, gd->bd);
  448. #endif
  449. }
  450. #elif defined(CONFIG_OF_FLAT_TREE)
  451. #ifdef CFG_BOOTMAPSZ
  452. /*
  453. * The blob must be within CFG_BOOTMAPSZ,
  454. * so we flag it to be copied if it is not.
  455. */
  456. if (of_flat_tree >= (char *)CFG_BOOTMAPSZ)
  457. of_data = (ulong)of_flat_tree;
  458. #endif
  459. /* move of_flat_tree if needed */
  460. if (of_data) {
  461. ulong of_start, of_len;
  462. of_len = ((struct boot_param_header *)of_data)->totalsize;
  463. /* provide extra 8k pad */
  464. of_start = (ulong)kbd - of_len - 8192;
  465. of_start &= ~(4096 - 1); /* align on page */
  466. debug ("## device tree at 0x%08lX ... 0x%08lX (len=%ld=0x%lX)\n",
  467. of_data, of_data + of_len - 1, of_len, of_len);
  468. of_flat_tree = (char *)of_start;
  469. printf (" Loading Device Tree to %08lx, end %08lx ... ",
  470. of_start, of_start + of_len - 1);
  471. memmove ((void *)of_start, (void *)of_data, of_len);
  472. puts ("OK\n");
  473. }
  474. /*
  475. * Create the /chosen node and modify the blob with board specific
  476. * values as needed.
  477. */
  478. ft_setup(of_flat_tree, kbd, initrd_start, initrd_end);
  479. /* ft_dump_blob(of_flat_tree); */
  480. #endif /* #if defined(CONFIG_OF_LIBFDT) #elif defined(CONFIG_OF_FLAT_TREE) */
  481. debug ("## Transferring control to Linux (at address %08lx) ...\n",
  482. (ulong)kernel);
  483. show_boot_progress (15);
  484. #if defined(CFG_INIT_RAM_LOCK) && !defined(CONFIG_E500)
  485. unlock_ram_in_cache();
  486. #endif
  487. #if defined(CONFIG_OF_FLAT_TREE) || defined(CONFIG_OF_LIBFDT)
  488. if (of_flat_tree) { /* device tree; boot new style */
  489. /*
  490. * Linux Kernel Parameters (passing device tree):
  491. * r3: pointer to the fdt, followed by the board info data
  492. * r4: physical pointer to the kernel itself
  493. * r5: NULL
  494. * r6: NULL
  495. * r7: NULL
  496. */
  497. (*kernel) ((bd_t *)of_flat_tree, (ulong)kernel, 0, 0, 0);
  498. /* does not return */
  499. }
  500. #endif
  501. /*
  502. * Linux Kernel Parameters (passing board info data):
  503. * r3: ptr to board info data
  504. * r4: initrd_start or 0 if no initrd
  505. * r5: initrd_end - unused if r4 is 0
  506. * r6: Start of command line string
  507. * r7: End of command line string
  508. */
  509. (*kernel) (kbd, initrd_start, initrd_end, cmd_start, cmd_end);
  510. /* does not return */
  511. }