bootloader_init.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  1. // Copyright 2018 Espressif Systems (Shanghai) PTE LTD
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #include <string.h>
  15. #include <stdint.h>
  16. #include <limits.h>
  17. #include <sys/param.h>
  18. #include "esp_attr.h"
  19. #include "esp_log.h"
  20. #include "esp32/rom/cache.h"
  21. #include "esp32/rom/efuse.h"
  22. #include "esp32/rom/ets_sys.h"
  23. #include "esp32/rom/spi_flash.h"
  24. #include "esp32/rom/crc.h"
  25. #include "esp32/rom/rtc.h"
  26. #include "esp32/rom/uart.h"
  27. #include "esp32/rom/gpio.h"
  28. #include "esp32/rom/secure_boot.h"
  29. #include "soc/soc.h"
  30. #include "soc/cpu.h"
  31. #include "soc/rtc.h"
  32. #include "soc/dport_reg.h"
  33. #include "soc/gpio_periph.h"
  34. #include "soc/efuse_periph.h"
  35. #include "soc/rtc_periph.h"
  36. #include "soc/timer_periph.h"
  37. #include "soc/rtc_wdt.h"
  38. #include "soc/spi_periph.h"
  39. #include "sdkconfig.h"
  40. #include "esp_image_format.h"
  41. #include "esp_secure_boot.h"
  42. #include "esp_flash_encrypt.h"
  43. #include "esp_flash_partitions.h"
  44. #include "bootloader_flash.h"
  45. #include "bootloader_random.h"
  46. #include "bootloader_config.h"
  47. #include "bootloader_clock.h"
  48. #include "bootloader_common.h"
  49. #include "bootloader_flash_config.h"
  50. #include "flash_qio_mode.h"
  51. extern int _bss_start;
  52. extern int _bss_end;
  53. extern int _data_start;
  54. extern int _data_end;
  55. static const char* TAG = "boot";
  56. static esp_err_t bootloader_main();
  57. static void print_flash_info(const esp_image_header_t* pfhdr);
  58. static void update_flash_config(const esp_image_header_t* pfhdr);
  59. static void bootloader_init_flash_configure(const esp_image_header_t* pfhdr);
  60. static void uart_console_configure(void);
  61. static void wdt_reset_check(void);
  62. esp_err_t bootloader_init()
  63. {
  64. cpu_configure_region_protection();
  65. cpu_init_memctl();
  66. /* Sanity check that static RAM is after the stack */
  67. #ifndef NDEBUG
  68. {
  69. int *sp = get_sp();
  70. assert(&_bss_start <= &_bss_end);
  71. assert(&_data_start <= &_data_end);
  72. assert(sp < &_bss_start);
  73. assert(sp < &_data_start);
  74. }
  75. #endif
  76. //Clear bss
  77. memset(&_bss_start, 0, (&_bss_end - &_bss_start) * sizeof(_bss_start));
  78. /* completely reset MMU for both CPUs
  79. (in case serial bootloader was running) */
  80. Cache_Read_Disable(0);
  81. Cache_Read_Disable(1);
  82. Cache_Flush(0);
  83. Cache_Flush(1);
  84. mmu_init(0);
  85. DPORT_REG_SET_BIT(DPORT_APP_CACHE_CTRL1_REG, DPORT_APP_CACHE_MMU_IA_CLR);
  86. mmu_init(1);
  87. DPORT_REG_CLR_BIT(DPORT_APP_CACHE_CTRL1_REG, DPORT_APP_CACHE_MMU_IA_CLR);
  88. /* (above steps probably unnecessary for most serial bootloader
  89. usage, all that's absolutely needed is that we unmask DROM0
  90. cache on the following two lines - normal ROM boot exits with
  91. DROM0 cache unmasked, but serial bootloader exits with it
  92. masked. However can't hurt to be thorough and reset
  93. everything.)
  94. The lines which manipulate DPORT_APP_CACHE_MMU_IA_CLR bit are
  95. necessary to work around a hardware bug.
  96. */
  97. DPORT_REG_CLR_BIT(DPORT_PRO_CACHE_CTRL1_REG, DPORT_PRO_CACHE_MASK_DROM0);
  98. DPORT_REG_CLR_BIT(DPORT_APP_CACHE_CTRL1_REG, DPORT_APP_CACHE_MASK_DROM0);
  99. if(bootloader_main() != ESP_OK){
  100. return ESP_FAIL;
  101. }
  102. return ESP_OK;
  103. }
  104. static esp_err_t bootloader_main()
  105. {
  106. bootloader_common_vddsdio_configure();
  107. /* Read and keep flash ID, for further use. */
  108. g_rom_flashchip.device_id = bootloader_read_flash_id();
  109. esp_image_header_t fhdr;
  110. if (bootloader_flash_read(ESP_BOOTLOADER_OFFSET, &fhdr, sizeof(esp_image_header_t), true) != ESP_OK) {
  111. ESP_LOGE(TAG, "failed to load bootloader header!");
  112. return ESP_FAIL;
  113. }
  114. /* Check chip ID and minimum chip revision that supported by this image */
  115. uint8_t revision = bootloader_common_get_chip_revision();
  116. ESP_LOGI(TAG, "Chip Revision: %d", revision);
  117. if (bootloader_common_check_chip_validity(&fhdr, ESP_IMAGE_BOOTLOADER) != ESP_OK) {
  118. return ESP_FAIL;
  119. }
  120. bootloader_init_flash_configure(&fhdr);
  121. #if (CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ == 240)
  122. //Check if ESP32 is rated for a CPU frequency of 160MHz only
  123. if (REG_GET_BIT(EFUSE_BLK0_RDATA3_REG, EFUSE_RD_CHIP_CPU_FREQ_RATED) &&
  124. REG_GET_BIT(EFUSE_BLK0_RDATA3_REG, EFUSE_RD_CHIP_CPU_FREQ_LOW)) {
  125. ESP_LOGE(TAG, "Chip CPU frequency rated for 160MHz. Modify CPU frequency in menuconfig");
  126. return ESP_FAIL;
  127. }
  128. #endif
  129. bootloader_clock_configure();
  130. uart_console_configure();
  131. wdt_reset_check();
  132. ESP_LOGI(TAG, "ESP-IDF %s 2nd stage bootloader", IDF_VER);
  133. ESP_LOGI(TAG, "compile time " __TIME__ );
  134. ets_set_appcpu_boot_addr(0);
  135. #ifdef CONFIG_BOOTLOADER_WDT_ENABLE
  136. ESP_LOGD(TAG, "Enabling RTCWDT(%d ms)", CONFIG_BOOTLOADER_WDT_TIME_MS);
  137. rtc_wdt_protect_off();
  138. rtc_wdt_disable();
  139. rtc_wdt_set_length_of_reset_signal(RTC_WDT_SYS_RESET_SIG, RTC_WDT_LENGTH_3_2us);
  140. rtc_wdt_set_length_of_reset_signal(RTC_WDT_CPU_RESET_SIG, RTC_WDT_LENGTH_3_2us);
  141. rtc_wdt_set_stage(RTC_WDT_STAGE0, RTC_WDT_STAGE_ACTION_RESET_RTC);
  142. rtc_wdt_set_time(RTC_WDT_STAGE0, CONFIG_BOOTLOADER_WDT_TIME_MS);
  143. rtc_wdt_enable();
  144. rtc_wdt_protect_on();
  145. #else
  146. /* disable watch dog here */
  147. rtc_wdt_disable();
  148. #endif
  149. REG_SET_FIELD(TIMG_WDTWPROTECT_REG(0), TIMG_WDT_WKEY, TIMG_WDT_WKEY_VALUE);
  150. REG_CLR_BIT( TIMG_WDTCONFIG0_REG(0), TIMG_WDT_FLASHBOOT_MOD_EN );
  151. #ifndef CONFIG_SPI_FLASH_ROM_DRIVER_PATCH
  152. const uint32_t spiconfig = ets_efuse_get_spiconfig();
  153. if(spiconfig != EFUSE_SPICONFIG_SPI_DEFAULTS && spiconfig != EFUSE_SPICONFIG_HSPI_DEFAULTS) {
  154. ESP_LOGE(TAG, "SPI flash pins are overridden. \"Enable SPI flash ROM driver patched functions\" must be enabled in menuconfig");
  155. return ESP_FAIL;
  156. }
  157. #endif
  158. esp_rom_spiflash_unlock();
  159. ESP_LOGI(TAG, "Enabling RNG early entropy source...");
  160. bootloader_random_enable();
  161. #if CONFIG_ESPTOOLPY_FLASHMODE_QIO || CONFIG_ESPTOOLPY_FLASHMODE_QOUT
  162. bootloader_enable_qio_mode();
  163. #endif
  164. print_flash_info(&fhdr);
  165. update_flash_config(&fhdr);
  166. return ESP_OK;
  167. }
  168. static void update_flash_config(const esp_image_header_t* pfhdr)
  169. {
  170. uint32_t size;
  171. switch(pfhdr->spi_size) {
  172. case ESP_IMAGE_FLASH_SIZE_1MB:
  173. size = 1;
  174. break;
  175. case ESP_IMAGE_FLASH_SIZE_2MB:
  176. size = 2;
  177. break;
  178. case ESP_IMAGE_FLASH_SIZE_4MB:
  179. size = 4;
  180. break;
  181. case ESP_IMAGE_FLASH_SIZE_8MB:
  182. size = 8;
  183. break;
  184. case ESP_IMAGE_FLASH_SIZE_16MB:
  185. size = 16;
  186. break;
  187. default:
  188. size = 2;
  189. }
  190. Cache_Read_Disable( 0 );
  191. // Set flash chip size
  192. esp_rom_spiflash_config_param(g_rom_flashchip.device_id, size * 0x100000, 0x10000, 0x1000, 0x100, 0xffff);
  193. // TODO: set mode
  194. // TODO: set frequency
  195. Cache_Flush(0);
  196. Cache_Read_Enable( 0 );
  197. }
  198. static void print_flash_info(const esp_image_header_t* phdr)
  199. {
  200. #if (BOOT_LOG_LEVEL >= BOOT_LOG_LEVEL_NOTICE)
  201. ESP_LOGD(TAG, "magic %02x", phdr->magic );
  202. ESP_LOGD(TAG, "segments %02x", phdr->segment_count );
  203. ESP_LOGD(TAG, "spi_mode %02x", phdr->spi_mode );
  204. ESP_LOGD(TAG, "spi_speed %02x", phdr->spi_speed );
  205. ESP_LOGD(TAG, "spi_size %02x", phdr->spi_size );
  206. const char* str;
  207. switch ( phdr->spi_speed ) {
  208. case ESP_IMAGE_SPI_SPEED_40M:
  209. str = "40MHz";
  210. break;
  211. case ESP_IMAGE_SPI_SPEED_26M:
  212. str = "26.7MHz";
  213. break;
  214. case ESP_IMAGE_SPI_SPEED_20M:
  215. str = "20MHz";
  216. break;
  217. case ESP_IMAGE_SPI_SPEED_80M:
  218. str = "80MHz";
  219. break;
  220. default:
  221. str = "20MHz";
  222. break;
  223. }
  224. ESP_LOGI(TAG, "SPI Speed : %s", str );
  225. /* SPI mode could have been set to QIO during boot already,
  226. so test the SPI registers not the flash header */
  227. uint32_t spi_ctrl = REG_READ(SPI_CTRL_REG(0));
  228. if (spi_ctrl & SPI_FREAD_QIO) {
  229. str = "QIO";
  230. } else if (spi_ctrl & SPI_FREAD_QUAD) {
  231. str = "QOUT";
  232. } else if (spi_ctrl & SPI_FREAD_DIO) {
  233. str = "DIO";
  234. } else if (spi_ctrl & SPI_FREAD_DUAL) {
  235. str = "DOUT";
  236. } else if (spi_ctrl & SPI_FASTRD_MODE) {
  237. str = "FAST READ";
  238. } else {
  239. str = "SLOW READ";
  240. }
  241. ESP_LOGI(TAG, "SPI Mode : %s", str );
  242. switch ( phdr->spi_size ) {
  243. case ESP_IMAGE_FLASH_SIZE_1MB:
  244. str = "1MB";
  245. break;
  246. case ESP_IMAGE_FLASH_SIZE_2MB:
  247. str = "2MB";
  248. break;
  249. case ESP_IMAGE_FLASH_SIZE_4MB:
  250. str = "4MB";
  251. break;
  252. case ESP_IMAGE_FLASH_SIZE_8MB:
  253. str = "8MB";
  254. break;
  255. case ESP_IMAGE_FLASH_SIZE_16MB:
  256. str = "16MB";
  257. break;
  258. default:
  259. str = "2MB";
  260. break;
  261. }
  262. ESP_LOGI(TAG, "SPI Flash Size : %s", str );
  263. #endif
  264. }
  265. /*
  266. * Bootloader reads SPI configuration from bin header, so that
  267. * the burning configuration can be different with compiling configuration.
  268. */
  269. static void IRAM_ATTR bootloader_init_flash_configure(const esp_image_header_t* pfhdr)
  270. {
  271. bootloader_flash_gpio_config(pfhdr);
  272. bootloader_flash_dummy_config(pfhdr);
  273. bootloader_flash_cs_timing_config();
  274. }
  275. static void uart_console_configure(void)
  276. {
  277. #if CONFIG_ESP_CONSOLE_UART_NONE
  278. ets_install_putc1(NULL);
  279. ets_install_putc2(NULL);
  280. #else // CONFIG_ESP_CONSOLE_UART_NONE
  281. const int uart_num = CONFIG_ESP_CONSOLE_UART_NUM;
  282. uartAttach();
  283. ets_install_uart_printf();
  284. // Wait for UART FIFO to be empty.
  285. uart_tx_wait_idle(0);
  286. #if CONFIG_ESP_CONSOLE_UART_CUSTOM
  287. // Some constants to make the following code less upper-case
  288. const int uart_tx_gpio = CONFIG_ESP_CONSOLE_UART_TX_GPIO;
  289. const int uart_rx_gpio = CONFIG_ESP_CONSOLE_UART_RX_GPIO;
  290. // Switch to the new UART (this just changes UART number used for
  291. // ets_printf in ROM code).
  292. uart_tx_switch(uart_num);
  293. // If console is attached to UART1 or if non-default pins are used,
  294. // need to reconfigure pins using GPIO matrix
  295. if (uart_num != 0 || uart_tx_gpio != 1 || uart_rx_gpio != 3) {
  296. // Change pin mode for GPIO1/3 from UART to GPIO
  297. PIN_FUNC_SELECT(PERIPHS_IO_MUX_U0RXD_U, FUNC_U0RXD_GPIO3);
  298. PIN_FUNC_SELECT(PERIPHS_IO_MUX_U0TXD_U, FUNC_U0TXD_GPIO1);
  299. // Route GPIO signals to/from pins
  300. // (arrays should be optimized away by the compiler)
  301. const uint32_t tx_idx_list[3] = { U0TXD_OUT_IDX, U1TXD_OUT_IDX, U2TXD_OUT_IDX };
  302. const uint32_t rx_idx_list[3] = { U0RXD_IN_IDX, U1RXD_IN_IDX, U2RXD_IN_IDX };
  303. const uint32_t uart_reset[3] = { DPORT_UART_RST, DPORT_UART1_RST, DPORT_UART2_RST };
  304. const uint32_t tx_idx = tx_idx_list[uart_num];
  305. const uint32_t rx_idx = rx_idx_list[uart_num];
  306. PIN_INPUT_ENABLE(GPIO_PIN_MUX_REG[uart_rx_gpio]);
  307. gpio_pad_pullup(uart_rx_gpio);
  308. gpio_matrix_out(uart_tx_gpio, tx_idx, 0, 0);
  309. gpio_matrix_in(uart_rx_gpio, rx_idx, 0);
  310. DPORT_SET_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, uart_reset[uart_num]);
  311. DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, uart_reset[uart_num]);
  312. }
  313. #endif // CONFIG_ESP_CONSOLE_UART_CUSTOM
  314. // Set configured UART console baud rate
  315. const int uart_baud = CONFIG_ESP_CONSOLE_UART_BAUDRATE;
  316. uart_div_modify(uart_num, (rtc_clk_apb_freq_get() << 4) / uart_baud);
  317. #endif // CONFIG_ESP_CONSOLE_UART_NONE
  318. }
  319. static void wdt_reset_cpu0_info_enable(void)
  320. {
  321. //We do not reset core1 info here because it didn't work before cpu1 was up. So we put it into call_start_cpu1.
  322. DPORT_REG_SET_BIT(DPORT_PRO_CPU_RECORD_CTRL_REG, DPORT_PRO_CPU_PDEBUG_ENABLE | DPORT_PRO_CPU_RECORD_ENABLE);
  323. DPORT_REG_CLR_BIT(DPORT_PRO_CPU_RECORD_CTRL_REG, DPORT_PRO_CPU_RECORD_ENABLE);
  324. }
  325. static void wdt_reset_info_dump(int cpu)
  326. {
  327. uint32_t inst = 0, pid = 0, stat = 0, data = 0, pc = 0,
  328. lsstat = 0, lsaddr = 0, lsdata = 0, dstat = 0;
  329. const char *cpu_name = cpu ? "APP" : "PRO";
  330. if (cpu == 0) {
  331. stat = DPORT_REG_READ(DPORT_PRO_CPU_RECORD_STATUS_REG);
  332. pid = DPORT_REG_READ(DPORT_PRO_CPU_RECORD_PID_REG);
  333. inst = DPORT_REG_READ(DPORT_PRO_CPU_RECORD_PDEBUGINST_REG);
  334. dstat = DPORT_REG_READ(DPORT_PRO_CPU_RECORD_PDEBUGSTATUS_REG);
  335. data = DPORT_REG_READ(DPORT_PRO_CPU_RECORD_PDEBUGDATA_REG);
  336. pc = DPORT_REG_READ(DPORT_PRO_CPU_RECORD_PDEBUGPC_REG);
  337. lsstat = DPORT_REG_READ(DPORT_PRO_CPU_RECORD_PDEBUGLS0STAT_REG);
  338. lsaddr = DPORT_REG_READ(DPORT_PRO_CPU_RECORD_PDEBUGLS0ADDR_REG);
  339. lsdata = DPORT_REG_READ(DPORT_PRO_CPU_RECORD_PDEBUGLS0DATA_REG);
  340. } else {
  341. stat = DPORT_REG_READ(DPORT_APP_CPU_RECORD_STATUS_REG);
  342. pid = DPORT_REG_READ(DPORT_APP_CPU_RECORD_PID_REG);
  343. inst = DPORT_REG_READ(DPORT_APP_CPU_RECORD_PDEBUGINST_REG);
  344. dstat = DPORT_REG_READ(DPORT_APP_CPU_RECORD_PDEBUGSTATUS_REG);
  345. data = DPORT_REG_READ(DPORT_APP_CPU_RECORD_PDEBUGDATA_REG);
  346. pc = DPORT_REG_READ(DPORT_APP_CPU_RECORD_PDEBUGPC_REG);
  347. lsstat = DPORT_REG_READ(DPORT_APP_CPU_RECORD_PDEBUGLS0STAT_REG);
  348. lsaddr = DPORT_REG_READ(DPORT_APP_CPU_RECORD_PDEBUGLS0ADDR_REG);
  349. lsdata = DPORT_REG_READ(DPORT_APP_CPU_RECORD_PDEBUGLS0DATA_REG);
  350. }
  351. if (DPORT_RECORD_PDEBUGINST_SZ(inst) == 0 &&
  352. DPORT_RECORD_PDEBUGSTATUS_BBCAUSE(dstat) == DPORT_RECORD_PDEBUGSTATUS_BBCAUSE_WAITI) {
  353. ESP_LOGW(TAG, "WDT reset info: %s CPU PC=0x%x (waiti mode)", cpu_name, pc);
  354. } else {
  355. ESP_LOGW(TAG, "WDT reset info: %s CPU PC=0x%x", cpu_name, pc);
  356. }
  357. ESP_LOGD(TAG, "WDT reset info: %s CPU STATUS 0x%08x", cpu_name, stat);
  358. ESP_LOGD(TAG, "WDT reset info: %s CPU PID 0x%08x", cpu_name, pid);
  359. ESP_LOGD(TAG, "WDT reset info: %s CPU PDEBUGINST 0x%08x", cpu_name, inst);
  360. ESP_LOGD(TAG, "WDT reset info: %s CPU PDEBUGSTATUS 0x%08x", cpu_name, dstat);
  361. ESP_LOGD(TAG, "WDT reset info: %s CPU PDEBUGDATA 0x%08x", cpu_name, data);
  362. ESP_LOGD(TAG, "WDT reset info: %s CPU PDEBUGPC 0x%08x", cpu_name, pc);
  363. ESP_LOGD(TAG, "WDT reset info: %s CPU PDEBUGLS0STAT 0x%08x", cpu_name, lsstat);
  364. ESP_LOGD(TAG, "WDT reset info: %s CPU PDEBUGLS0ADDR 0x%08x", cpu_name, lsaddr);
  365. ESP_LOGD(TAG, "WDT reset info: %s CPU PDEBUGLS0DATA 0x%08x", cpu_name, lsdata);
  366. }
  367. static void wdt_reset_check(void)
  368. {
  369. int wdt_rst = 0;
  370. RESET_REASON rst_reas[2];
  371. rst_reas[0] = rtc_get_reset_reason(0);
  372. rst_reas[1] = rtc_get_reset_reason(1);
  373. if (rst_reas[0] == RTCWDT_SYS_RESET || rst_reas[0] == TG0WDT_SYS_RESET || rst_reas[0] == TG1WDT_SYS_RESET ||
  374. rst_reas[0] == TGWDT_CPU_RESET || rst_reas[0] == RTCWDT_CPU_RESET) {
  375. ESP_LOGW(TAG, "PRO CPU has been reset by WDT.");
  376. wdt_rst = 1;
  377. }
  378. if (rst_reas[1] == RTCWDT_SYS_RESET || rst_reas[1] == TG0WDT_SYS_RESET || rst_reas[1] == TG1WDT_SYS_RESET ||
  379. rst_reas[1] == TGWDT_CPU_RESET || rst_reas[1] == RTCWDT_CPU_RESET) {
  380. ESP_LOGW(TAG, "APP CPU has been reset by WDT.");
  381. wdt_rst = 1;
  382. }
  383. if (wdt_rst) {
  384. // if reset by WDT dump info from trace port
  385. wdt_reset_info_dump(0);
  386. wdt_reset_info_dump(1);
  387. }
  388. wdt_reset_cpu0_info_enable();
  389. }
  390. void __assert_func(const char *file, int line, const char *func, const char *expr)
  391. {
  392. ESP_LOGE(TAG, "Assert failed in %s, %s:%d (%s)", func, file, line, expr);
  393. while(1) {}
  394. }
  395. void abort()
  396. {
  397. #if !CONFIG_ESP32_PANIC_SILENT_REBOOT
  398. ets_printf("abort() was called at PC 0x%08x\r\n", (intptr_t)__builtin_return_address(0) - 3);
  399. #endif
  400. if (esp_cpu_in_ocd_debug_mode()) {
  401. __asm__ ("break 0,0");
  402. }
  403. while(1) {}
  404. }