# Size of extra stack frame needed by exception context switch.
# See core/cortex-m/switch.S
exception_frame_size: 224
# Missing calls
add:
  # TCPC stack
  tcpm_set_cc[driver/tcpm/tcpm.h:139]:
    - tcpci_tcpm_set_cc
  tcpm_set_rx_enable[driver/tcpm/tcpm.h:160]:
    - tcpci_tcpm_set_rx_enable
  tcpm_set_snk_ctrl[driver/tcpm/tcpm.h:179]:
    - tcpci_tcpm_set_snk_ctrl
  tcpm_get_cc[driver/tcpm/tcpm.h:124]:
    - tcpci_tcpm_get_cc
  enter_low_power_mode[driver/usb_mux.c:42]:
    - tcpci_enter_low_power_mode
  svdm_exit_dp_mode[baseboard/octopus/usb_pd_policy.c:346]:
    - anx7447_tcpc_update_hpd_status
    - ps8xxx_tcpc_update_hpd_status
  tcpm_set_src_ctrl[driver/tcpm/tcpm.h:187]:
    - tcpci_tcpm_set_src_ctrl
  tcpm_init[driver/tcpm/tcpm.h:106]:
    - anx7447_init
    - tcpci_tcpm_init
  tcpm_get_vbus_level[driver/tcpm/tcpm.h:129]:
    - anx7447_tcpm_get_vbus_level
    - tcpci_tcpm_get_vbus_level
  baseboard_tcpc_init[baseboard/octopus/baseboard.c:212]:
    - anx7447_tcpc_update_hpd_status
    - ps8xxx_tcpc_update_hpd_status
  tcpm_get_chip_info[driver/tcpm/tcpm.h:240]:
    - tcpci_get_chip_info
    - ps8xxx_get_chip_info
  tcpm_transmit[driver/tcpm/tcpm.h:172]:
    - tcpci_tcpm_transmit
    - ps8xxx_tcpm_transmit
  tcpc_alert[driver/tcpm/tcpm.h:195]:
    - anx7447_tcpc_alert
    - tcpci_tcpc_alert
  tcpm_set_msg_header[driver/tcpm/tcpm.h:154]:
    - tcpci_tcpm_set_msg_header
  tcpm_set_vconn[driver/tcpm/tcpm.h:149]:
    - tcpci_tcpm_set_vconn
  tcpm_select_rp_value[driver/tcpm/tcpm.h:134]:
    - tcpci_tcpm_select_rp_value
  tcpm_enqueue_message[driver/tcpm/tcpci.c:404]:
    - tcpci_tcpm_get_message_raw
  svdm_dp_post_config[baseboard/octopus/usb_pd_policy.c:320]:
    - anx7447_tcpc_update_hpd_status
    - ps8xxx_tcpc_update_hpd_status
  svdm_dp_attention[baseboard/octopus/usb_pd_policy.c:335]:
    - anx7447_tcpc_update_hpd_status
    - ps8xxx_tcpc_update_hpd_status
  tcpm_release[driver/tcpm/tcpm.h:119]:
    - anx7447_release
    - ps8xxx_tcpm_release
  tcpm_set_polarity[driver/tcpm/tcpm.h:144]:
    - tcpci_tcpm_set_polarity
  tcpm_enable_drp_toggle[driver/tcpm/tcpm.h:211]:
    - tcpci_tcpc_drp_toggle
  tcpm_enter_low_power_mode[driver/tcpm/tcpm.h:218]:
    - tcpci_enter_low_power_mode
  # USB mux
  usb_mux_flip[driver/usb_mux.c:163]:
    - anx7447_mux_get
    - tcpci_tcpm_mux_get
  usb_mux_flip[driver/usb_mux.c:174]:
    - anx7447_mux_set
    - tcpci_tcpm_mux_set
  usb_mux_set[driver/usb_mux.c:112]:
    - anx7447_mux_set
    - tcpci_tcpm_mux_set
  usb_mux_init[driver/usb_mux.c:64]:
    - anx7447_mux_init
    - tcpci_tcpm_mux_init
  usb_mux_get[driver/usb_mux.c:140]:
    - anx7447_mux_get
    - tcpci_tcpm_mux_get
  hc_usb_pd_mux_info[driver/usb_mux.c:240]:
    - anx7447_mux_get
    - tcpci_tcpm_mux_get
  # PPC
  ppc_is_sourcing_vbus[common/usbc_ppc.c:42]:
    - nx20p348x_is_sourcing_vbus
  ppc_init[common/usbc_ppc.c:26]:
    - nx20p348x_init
  ppc_vbus_sink_enable[common/usbc_ppc.c:86]:
    - nx20p348x_vbus_sink_enable
  ppc_discharge_vbus[common/usbc_ppc.c:68]:
    - nx20p348x_discharge_vbus
  ppc_vbus_source_enable[common/usbc_ppc.c:107]:
    - nx20p348x_vbus_source_enable
  ppc_set_vbus_source_current_limit[common/usbc_ppc.c:60]:
    - nx20p348x_set_vbus_source_current_limit
  command_ppc_dump[common/usbc_ppc.c:135]:
    - nx20p348x_dump
  # Motion sensors
  command_accelrange[common/motion_sense.c:1513]:
    - set_range[driver/accel_lis2dh.c]
    - set_range[driver/accelgyro_lsm6dsm.c]
  command_accelrange[common/motion_sense.c:1519]:
    - get_range[driver/accel_lis2dh.c]
    - get_range[driver/accelgyro_lsm6dsm.c]
  motion_sensor_time_to_read[common/motion_sense.c:213]:
    - st_get_data_rate[driver/stm_mems_common.c]
  motion_sense_read[common/motion_sense.c:694]:
    - st_get_data_rate[driver/stm_mems_common.c]
  motion_sense_read[common/motion_sense.c:707]:
    - read[driver/accel_lis2dh.c]
    - read[driver/accelgyro_lsm6dsm.c]
  motion_sense_process[common/motion_sense.c:719]:
    - irq_handler[driver/accelgyro_lsm6dsm.c]
  sensor_init_done[common/motion_sense.c:468]:
    - set_range[driver/accel_lis2dh.c]
    - set_range[driver/accelgyro_lsm6dsm.c]
  sensor_init_done[common/motion_sense.c:471]:
    - get_range[driver/accel_lis2dh.c]
    - get_range[driver/accelgyro_lsm6dsm.c]
  motion_sense_set_ec_rate_from_ap[common/motion_sense.c:305]:
    - st_get_data_rate[driver/stm_mems_common.c]
  host_cmd_motion_sense[common/motion_sense.c:1242]:
    - set_range[driver/accel_lis2dh.c]
    - set_range[driver/accelgyro_lsm6dsm.c]
  host_cmd_motion_sense[common/motion_sense.c:1253]:
    - get_range[driver/accel_lis2dh.c]
    - get_range[driver/accelgyro_lsm6dsm.c]
  host_cmd_motion_sense[common/motion_sense.c:1268]:
    - st_set_offset[driver/stm_mems_common.c]
  host_cmd_motion_sense[common/motion_sense.c:1303]:
    - None
  host_cmd_motion_sense[common/motion_sense.c:1306]:
    - st_get_offset[driver/stm_mems_common.c]
  motion_sense_init[common/motion_sense.c:447]:
    - init[driver/accel_lis2dh.c]
    - init[driver/accelgyro_lsm6dsm.c]
  motion_sense_set_data_rate[common/motion_sense.c:267]:
    - set_data_rate[driver/accel_lis2dh.c]
    - set_data_rate[driver/accelgyro_lsm6dsm.c]
  motion_sense_set_data_rate[common/motion_sense.c:287]:
    - st_get_data_rate[driver/stm_mems_common.c]
  motion_sense_set_motion_intervals[common/motion_sense.c:411]:
    - st_get_data_rate[driver/stm_mems_common.c]
  calculate_lid_angle[common/motion_lid.c:385]:
    - get_range[driver/accelgyro_lsm6dsm.c]
  calculate_lid_angle[common/motion_lid.c:386]:
    - get_range[driver/accel_lis2dh.c]
  motion_sense_set_data_rate[common/motion_sense.c:286]:
    - st_get_data_rate[driver/stm_mems_common.c]
  command_accel_read_xyz[common/motion_sense.c:1657]:
    - read[driver/accel_lis2dh.c]
    - read[driver/accelgyro_lsm6dsm.c]
  host_cmd_motion_sense[common/motion_sense.c:1294]:
    - None
  host_cmd_motion_sense[common/motion_sense.c:1297]:
    - st_get_offset[driver/stm_mems_common.c]
  command_accelresolution[common/motion_sense.c:1562]:
    - None
  command_accelresolution[common/motion_sense.c:1566]:
    - st_get_resolution[driver/stm_mems_common.c]
  command_accelrange[common/motion_sense.c:1518]:
    - get_range[driver/accel_lis2dh.c]
    - get_range[driver/accelgyro_lsm6dsm.c]
  st_normalize[driver/stm_mems_common.c:137]:
    - get_range[driver/accel_lis2dh.c]
    - get_range[driver/accelgyro_lsm6dsm.c]
  command_accel_data_rate[common/motion_sense.c:1621]:
    - st_get_data_rate[driver/stm_mems_common.c]
  # Misc.
  host_send_response[common/host_command.c:153]:
    - host_packet_respond
  pd_dfp_enter_mode[common/usb_pd_policy.c:465]:
    - svdm_enter_dp_mode[baseboard/octopus/usb_pd_policy.c]
    - svdm_enter_gfu_mode[baseboard/octopus/usb_pd_policy.c]
  pd_svdm[common/usb_pd_policy.c:773]:
    - svdm_dp_status[baseboard/octopus/usb_pd_policy.c]
    - svdm_gfu_status[baseboard/octopus/usb_pd_policy.c]
  pd_svdm[common/usb_pd_policy.c:784]:
    - svdm_dp_config[baseboard/octopus/usb_pd_policy.c]
    - svdm_gfu_config[baseboard/octopus/usb_pd_policy.c]
  pd_svdm[common/usb_pd_policy.c:790]:
    - svdm_dp_post_config[baseboard/octopus/usb_pd_policy.c]
  dfp_consume_attention[common/usb_pd_policy.c:503]:
    - svdm_dp_attention[baseboard/octopus/usb_pd_policy.c]
    - svdm_gfu_attention[baseboard/octopus/usb_pd_policy.c]
  kblight_set_deferred[common/keyboard_backlight.c:35]:
    - kblight_pwm_set
  temp_sensor_read[common/temp_sensor.c:26]:
    - charge_get_battery_temp
    - get_temp_3v3_51k1_47k_4050b
    - get_temp_3v3_13k7_47k_4050b
  kblight_enable[common/keyboard_backlight.c:61]:
    - kblight_pwm_enable
  host_packet_respond[common/host_command.c:240]:
    - lpc_send_response
  kblight_init[common/keyboard_backlight.c:28]:
    - kblight_pwm_init
  vfnprintf[common/printf.c:75]:
    - __tx_char
  vfnprintf[common/printf.c:88]:
    - __tx_char
  vfnprintf[common/printf.c:96]:
    - __tx_char
  vfnprintf[common/printf.c:171]:
    - __tx_char
  vfnprintf[common/printf.c:172]:
    - __tx_char
  vfnprintf[common/printf.c:310]:
    - __tx_char
  vfnprintf[common/printf.c:315]:
    - __tx_char
  vfnprintf[common/printf.c:318]:
    - __tx_char
  pd_dfp_exit_mode[common/usb_pd_policy.c:569]:
    - svdm_exit_dp_mode[baseboard/octopus/usb_pd_policy.c]
    - svdm_exit_gfu_mode[baseboard/octopus/usb_pd_policy.c]
  pd_dfp_exit_mode[common/usb_pd_policy.c:586]:
    - svdm_exit_dp_mode[baseboard/octopus/usb_pd_policy.c]
    - svdm_exit_gfu_mode[baseboard/octopus/usb_pd_policy.c]
  # Indirect callsites in common structures - likely common for all boards
  handle_command[common/console.c:248]:
    - { name: __cmds, stride: 16, offset: 4 }
  host_command_process[common/host_command.c:704]:
    - { name: __hcmds, stride: 12, offset: 0 }
  mkbp_get_next_event[common/mkbp_event.c:160]:
    - { name:  __mkbp_evt_srcs, stride: 8, offset: 4 }
  hook_task[common/hooks.c:199]:
    - { name: __deferred_funcs, stride: 4, 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/$BOARD/R*/ec.R*.smap |
  #   sed -e 's/.*\(__hooks.*\)_end/    - { name: \1, stride: 8, offset: 0 }/' |
  #   sort -u`
  hook_notify[common/hooks.c:129]:
    - { name: __hooks_ac_change, stride: 8, offset: 0 }
    - { name: __hooks_base_attached_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_init, 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_second, stride: 8, offset: 0 }
    - { name: __hooks_sysjump, stride: 8, offset: 0 }
    - { name: __hooks_tablet_mode_change, stride: 8, offset: 0 }
    - { name: __hooks_tick, stride: 8, offset: 0 }
    - { name: __hooks_usb_pd_disconnect, stride: 8, offset: 0 }
  # NULL function pointers
  i2c_command_passthru[common/i2c_master.c:678]:
    - None
  pd_svdm[common/usb_pd_policy.c:720]:
    - None
  usb_mux_init[driver/usb_mux.c:75]:
    - None
remove:
# Remove panic callsites.  Once panicking, we no longer care about stack usage
- panic_assert_fail
# Remove reset_device_and_notify for all non-PD analysis since it can only be called from PD task IDs.  Comment this out for the PD tasks
- reset_device_and_notify
# Remove the LPM path because the PD_FLAGS_LPM_TRANSITION flag presents this loop
- [ reset_device_and_notify, tcpci_tcpm_init, [ tcpc_read, tcpc_write16 ], pd_wait_for_wakeup ]
# Remove nonesense hook paths that come from the general hook_notify above (Note: these are not a comprehensive list, but a list of
# paths that came up as longest during analysis
# These functions do not call HOOK_INIT
- [ [ s0ix_transition, charger_task, power_button_change_deferred, jump_to_image, tablet_set_mode, pd_set_suspend, set_state, extpower_deferred, lid_switch_open, lid_switch_close, espi_chipset_reset, lpc_chipset_reset ], hook_notify, [ usb_charger_init, baseboard_tcpc_init, motion_sense_startup, gmr_tablet_switch_init, powerbtn_x86_init, cbi_init  ] ]
# These functions do not call HOOK_CHIPSET_SHUTDOWN
- [ [ s0ix_transition, charger_task, power_button_change_deferred, jump_to_image, tablet_set_mode, pd_set_suspend, set_state, extpower_deferred, lid_switch_open, lid_switch_close, hook_task, espi_chipset_reset, lpc_chipset_reset ], hook_notify, [ system_common_shutdown, motion_sense_shutdown, board_disable_a1_redriver ] ]
# These functions do not call HOOK_LID_CHANGE
- [ [ s0ix_transition, charger_task, power_button_change_deferred, jump_to_image, tablet_set_mode, pd_set_suspend, set_state, extpower_deferred, hook_task, espi_chipset_reset, lpc_chipset_reset ], hook_notify, powerbtn_x86_lid_change ]
# These functions do not call HOOK_BATTERY_SOC_CHANGE
- [ [ s0ix_transition, power_button_change_deferred, jump_to_image, tablet_set_mode, pd_set_suspend, set_state, extpower_deferred, lid_switch_open, lid_switch_close, hook_task, espi_chipset_reset, lpc_chipset_reset ], hook_notify, power_up_inhibited_cb ]
# These functions do not call HOOK_CHIPSET_STARTUP
- [ [ charger_task, power_button_change_deferred, jump_to_image, tablet_set_mode, pd_set_suspend, set_state, extpower_deferred, lid_switch_open, lid_switch_close, hook_task, espi_chipset_reset, lpc_chipset_reset ], hook_notify, board_enable_a1_redriver ]
