void svc_handler_main(uint32_t *stack) {
  uint8_t svc_number = ((uint8_t *)stack[6])[-2];
  switch (svc_number) {
    case SVC_BUSR_RET:
      svhandler_button_usr_return();
      break;
    case SVC_TUSR_RET:
      svhandler_timer_usr_return();
      break;
    case SVC_ENA_INTR:
      svhandler_enable_interrupts();
      break;
    case SVC_DIS_INTR:
      svhandler_disable_interrupts();
      break;
    case SVC_FLASH_ERASE:
      svhandler_flash_erase_sector();
      break;
    case SVC_FLASH_PGM_BLK:
      svhandler_flash_pgm_blk();
      break;
    case SVC_FLASH_PGM_WORD:
      svhandler_flash_pgm_word();
      break;
    case SVC_FIRMWARE_PRIV:
    case SVC_FIRMWARE_UNPRIV:
      svhandler_start_firmware(svc_number);
      break;
    default:
      stack[0] = 0xffffffff;
      break;
  }
}
void svc_handler_main(uint32_t *stack) {
  uint8_t svc_number = ((uint8_t *)stack[6])[-2];
  switch (svc_number) {
    case SVC_BUSR_RET:
      svhandler_button_usr_return();
      break;
    case SVC_TUSR_RET:
      svhandler_timer_usr_return();
      break;
    case SVC_ENA_INTR:
      svhandler_enable_interrupts();
      break;
    case SVC_DIS_INTR:
      svhandler_disable_interrupts();
      break;
    case SVC_FLASH_ERASE:
      svhandler_flash_erase_sector();
      break;
    case SVC_FLASH_PGM_BLK:
      svhandler_flash_pgm_blk();
      break;
    case SVC_FLASH_PGM_WORD:
      svhandler_flash_pgm_word();
      break;
    case SVC_FIRMWARE_PRIV:
    case SVC_FIRMWARE_UNPRIV:
      svhandler_start_firmware(svc_number);
      break;
    default:
      stack[0] = 0xffffffff;
      break;
  }
}