# Size of extra stack frame needed by exception context switch.
# See core/cortex-m/switch.S
exception_frame_size: 224
# Add some missing calls.
add:
  # TCPC stuff:
  tcpm_init.lto_priv.255[driver/tcpm/tcpm.h:77]:
    - anx74xx_tcpm_init
    - tcpci_tcpm_init
  tcpm_release[driver/tcpm/tcpm.h:90]:
    - anx74xx_tcpm_release
    - ps8xxx_tcpm_release
  tcpm_get_cc.lto_priv.246[driver/tcpm/tcpm.h:95]:
    - anx74xx_tcpm_get_cc
    - tcpci_tcpm_get_cc
  tcpm_select_rp_value[driver/tcpm/tcpm.h:105]:
    - anx74xx_tcpm_select_rp_value
    - tcpci_tcpm_select_rp_value
  tcpm_set_cc.lto_priv.239[driver/tcpm/tcpm.h:110]:
    - anx74xx_tcpm_set_cc
    - tcpci_tcpm_set_cc
  tcpm_set_polarity[driver/tcpm/tcpm.h:115]:
    - anx74xx_tcpm_set_polarity
    - tcpci_tcpm_set_polarity
  tcpm_set_vconn.lto_priv.249[driver/tcpm/tcpm.h:120]:
    - anx74xx_tcpm_set_vconn
    - tcpci_tcpm_set_vconn
  tcpm_set_msg_header[driver/tcpm/tcpm.h:125]:
    - anx74xx_tcpm_set_msg_header
    - tcpci_tcpm_set_msg_header
  tcpm_set_rx_enable.lto_priv.252[driver/tcpm/tcpm.h:131]:
    - anx74xx_tcpm_set_rx_enable
    - tcpci_tcpm_set_rx_enable
  tcpm_get_message[driver/tcpm/tcpm.h:136]:
    - anx74xx_tcpm_get_message
    - tcpci_tcpm_get_message
  tcpm_transmit[driver/tcpm/tcpm.h:142]:
    - anx74xx_tcpm_transmit
    - ps8xxx_tcpm_transmit
  tcpc_alert[driver/tcpm/tcpm.h:147]:
    - anx74xx_tcpc_alert
    - tcpci_tcpc_alert
  tcpc_discharge_vbus[driver/tcpm/tcpm.h:152]:
    - anx74xx_tcpc_discharge_vbus
    - tcpci_tcpc_discharge_vbus
  tcpm_set_drp_toggle[driver/tcpm/tcpm.h:163]:
    - anx74xx_tcpc_drp_toggle
    - tcpci_tcpc_drp_toggle
  tcpm_get_chip_info[driver/tcpm/tcpm.h:185]:
    - tcpci_get_chip_info
  board_tcpc_init[board/poppy/board.c:336]:
    - anx74xx_tcpc_update_hpd_status
    - ps8xxx_tcpc_update_hpd_status
  tcpci_tcpc_drp_toggle[driver/tcpm/tcpci.c:148]:
    - None
  # USB mux stuff
  usb_mux_init[driver/usb_mux.c:25]:
    - anx74xx_tcpm_mux_init
    - tcpci_tcpm_mux_init
  usb_mux_init[driver/usb_mux.c:31]:
    - None
  usb_mux_set[driver/usb_mux.c:52]:
    - anx74xx_tcpm_mux_set
    - tcpci_tcpm_mux_set
  usb_mux_get[driver/usb_mux.c:71]:
    - anx74xx_tcpm_mux_get
    - tcpci_tcpm_mux_get
  usb_mux_flip[driver/usb_mux.c:92]:
    - anx74xx_tcpm_mux_get
    - tcpci_tcpm_mux_get
  usb_mux_flip[driver/usb_mux.c:103]:
    - anx74xx_tcpm_mux_set
    - tcpci_tcpm_mux_set
  hc_usb_pd_mux_info[driver/usb_mux.c:169]:
    - anx74xx_tcpm_mux_get
    - tcpci_tcpm_mux_get
  svdm_dp_post_config.lto_priv.271[board/poppy/usb_pd_policy.c:364]:
    - anx74xx_tcpc_update_hpd_status
    - ps8xxx_tcpc_update_hpd_status
  svdm_dp_attention.lto_priv.272[board/poppy/usb_pd_policy.c:379]:
    - anx74xx_tcpc_update_hpd_status
    - ps8xxx_tcpc_update_hpd_status
  svdm_exit_dp_mode.lto_priv.273[board/poppy/usb_pd_policy.c:390]:
    - anx74xx_tcpc_update_hpd_status
    - ps8xxx_tcpc_update_hpd_status
  # pd_svdm
  pd_dfp_enter_mode[common/usb_pd_policy.c:459]:
    - svdm_enter_dp_mode
  dfp_consume_attention.lto_priv.259[common/usb_pd_policy.c:497]:
    - svdm_dp_attention
  pd_dfp_exit_mode[common/usb_pd_policy.c:563]:
    - svdm_exit_dp_mode
  pd_dfp_exit_mode[common/usb_pd_policy.c:580]:
    - svdm_exit_dp_mode
  pd_svdm[common/usb_pd_policy.c:767]:
    - svdm_dp_status
  pd_svdm[common/usb_pd_policy.c:778]:
    - svdm_dp_config
  pd_svdm[common/usb_pd_policy.c:784]:
    - svdm_dp_post_config
  # Motion sense
  queue_advance_head[common/queue.c:105]:
    - queue_action_null
  queue_advance_tail[common/queue.c:116]:
    - queue_action_null
  motion_sense_set_data_rate[common/motion_sense.c:270]:
    - set_data_rate[driver/accelgyro_bmi160.c]
    - opt3001_set_data_rate
  motion_sense_set_data_rate[common/motion_sense.c:289]:
    - get_data_rate[driver/accelgyro_bmi160.c]
    - opt3001_get_data_rate
  motion_sense_set_ec_rate_from_ap[common/motion_sense.c:308]:
    - get_data_rate[driver/accelgyro_bmi160.c]
    - opt3001_get_data_rate
  motion_sense_set_motion_intervals.lto_priv.303[common/motion_sense.c:414]:
    - get_data_rate[driver/accelgyro_bmi160.c]
    - opt3001_get_data_rate
  motion_sense_init[common/motion_sense.c:450]:
    - init[driver/accelgyro_bmi160.c]
    - opt3001_init
  sensor_init_done[common/motion_sense.c:471]:
    - set_range[driver/accelgyro_bmi160.c]
    - opt3001_set_range
  sensor_init_done[common/motion_sense.c:474]:
    - get_range[driver/accelgyro_bmi160.c]
    - opt3001_get_range
  motion_sense_process.isra.9[common/motion_sense.c:721]:
    - irq_handler[driver/accelgyro_bmi160.c]
  host_cmd_motion_sense[common/motion_sense.c:1251]:
    - set_range[driver/accelgyro_bmi160.c]
    - opt3001_set_range
  host_cmd_motion_sense[common/motion_sense.c:1259]:
    - get_range[driver/accelgyro_bmi160.c]
    - opt3001_get_range
  host_cmd_motion_sense[common/motion_sense.c:1274]:
    - set_offset[driver/accelgyro_bmi160.c]
    - opt3001_set_offset
  host_cmd_motion_sense[common/motion_sense.c:1297]:
    - perform_calib[driver/accelgyro_bmi160.c]
  host_cmd_motion_sense[common/motion_sense.c:1300]:
    - get_offset[driver/accelgyro_bmi160.c]
    - opt3001_get_offset
  command_accelrange[common/motion_sense.c:1515]:
    - set_range[driver/accelgyro_bmi160.c]
    - opt3001_set_range
  command_accelrange[common/motion_sense.c:1520]:
    - get_range[driver/accelgyro_bmi160.c]
    - opt3001_get_range
  host_cmd_motion_sense[common/motion_sense.c:1520]:
    - get_range[driver/accelgyro_bmi160.c]
    - opt3001_get_range
  command_accelresolution[common/motion_sense.c:1564]:
    - None
  command_accelresolution[common/motion_sense.c:1568]:
    - get_resolution[driver/accelgyro_bmi160.c]
  command_accel_data_rate[common/motion_sense.c:1623]:
    - get_data_rate[driver/accelgyro_bmi160.c]
    - opt3001_get_data_rate
  command_accel_read_xyz[common/motion_sense.c:1659]:
    - read[driver/accelgyro_bmi160.c]
    - opt3001_read_lux
  # Temp (see temp_sensors array in board file)
  temp_sensor_read[common/temp_sensor.c:26]:
    - charge_get_battery_temp
    - bd99992gw_get_val
  # Misc
  jump_to_image[common/system.c:568]:
    - None
  system_download_from_flash[chip/npcx/system-npcx5.c:257]:
    - None
  __hibernate_npcx_series[chip/npcx/system-npcx5.c:144]:
    - None
  handle_command[common/console.c:248]:
    - { name: __cmds, stride: 16, offset: 4 }
  hook_task[common/hooks.c:197]:
    - { name: __deferred_funcs, stride: 4, offset: 0 }
    - { name: __hooks_second, stride: 8, offset: 0 }
    - { name: __hooks_tick, stride: 8, offset: 0 }
  # Note: This assumes worse case, where all hook functions can be called from
  # any hook_notify call
  # Generate using `grep hooks_.*_end build/soraka/R*/ec.R*.smap |
  #   sed -e 's/.*\(__hooks.*\)_end/    - { name: \1, stride: 8, offset: 0 }/' |
  #   sort -u`
  hook_notify[common/hooks.c:127]:
    - { name: __hooks_ac_change, stride: 8, offset: 0 }
    - { name: __hooks_battery_soc_change, stride: 8, offset: 0 }
    - { name: __hooks_chipset_pre_init, stride: 8, offset: 0 }
    - { name: __hooks_chipset_reset, stride: 8, offset: 0 }
    - { name: __hooks_chipset_resume, stride: 8, offset: 0 }
    - { name: __hooks_chipset_shutdown, stride: 8, offset: 0 }
    - { name: __hooks_chipset_startup, stride: 8, offset: 0 }
    - { name: __hooks_chipset_suspend, stride: 8, offset: 0 }
    - { name: __hooks_freq_change, stride: 8, offset: 0 }
    - { name: __hooks_lid_change, stride: 8, offset: 0 }
    - { name: __hooks_pre_freq_change, stride: 8, offset: 0 }
    - { name: __hooks_pwrbtn_change, stride: 8, offset: 0 }
    - { name: __hooks_sysjump, stride: 8, offset: 0 }
    - { name: __hooks_tablet_mode_change, stride: 8, offset: 0 }
  mkbp_get_next_event[common/mkbp_event.c:130]:
    - { name:  __mkbp_evt_srcs, stride: 8, offset: 4 }
  host_send_response[common/host_command.c:153]:
    - lpc_send_response
  host_packet_respond[common/host_command.c:240]:
    - lpc_send_response
  host_command_process[common/host_command.c:704]:
    - { name: __hcmds, stride: 12, offset: 0 }
  # gpio_interrupt.lto_priv.407[chip/npcx/gpio.c:479]
  vfnprintf:
    # This covers all the addchar in vfnprintf, but stackanalyzer does not
    # realize that...
    - __tx_char
  i2c_command_passthru[common/i2c_master.c:597]:
    - None
remove:
# Remove all callsites pointing to panic_assert_fail.
- panic_assert_fail
# Remove hook paths that don't make sense
- [ common_intel_x86_power_handle_state, hook_notify, powerbtn_x86_lid_change ]
- [ base_disable, hook_notify, handle_pending_reboot.lto_priv.290 ]
- [ system_common_shutdown, hook_notify, system_run_image_copy ]
- [ base_detect_change, hook_notify, [ powerbtn_x86_lid_change, jump_to_image, power_up_inhibited_cb, motion_sense_shutdown, motion_sense_resume, system_common_shutdown, base_disable ] ]
- [ jump_to_image, hook_notify, [ powerbtn_x86_lid_change, system_common_shutdown, power_up_inhibited_cb, motion_sense_shutdown, motion_sense_resume, base_disable ] ]
- [ [ extpower_deferred, charger_task ], hook_notify, [ powerbtn_x86_lid_change, system_common_shutdown ] ]
- [ common_intel_x86_power_handle_state, hook_notify, power_up_inhibited_cb ]
# pd_request_power_swap calls set_state with either PD_STATE_SRC_SWAP_INIT or
# PD_STATE_SNK_SWAP_INIT as parameters, which cannot call any of the
# charge_manager functions.
- [ [ pd_request_power_swap, pd_execute_hard_reset, pd_request_data_swap, pd_request_vconn_swap.lto_priv.237, pd_send_request_msg.lto_priv.250 ], set_state.lto_priv.236, [ typec_set_input_current_limit, charge_manager_update_charge, pd_power_supply_reset, pd_dfp_exit_mode, usb_mux_set ] ]
# Debug prints that do not actually need a 64 uint division, of the time
- [ [i2c_reset, i2c_abort_data, i2c_xfer], cprintf, vfnprintf, [uint64divmod.part.3.lto_priv.141, get_time] ]
