host/system: Implement functions for getting pointer to panic data

This patch adds get_panic_data_start() function into chip/host/system.c

This function can be used in unit tests as a mock for its real
counterpart

BUG=b:165773837, b:162254118
BRANCH=none
TEST=make runhosttests && make runfuzztests

Signed-off-by: Patryk Duda <pdk@semihalf.com>
Change-Id: Ib7435b3dc024c7568256898b8752f0361393286f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2401119
Reviewed-by: Jett Rink <jettrink@chromium.org>
This commit is contained in:
Patryk Duda 2020-09-09 15:05:34 +02:00 committed by Commit Bot
parent 55d6a725e3
commit a638524b69
1 changed files with 6 additions and 0 deletions

View File

@ -138,6 +138,12 @@ test_mockable struct panic_data *panic_get_data(void)
(__ram_data + RAM_DATA_SIZE - sizeof(struct panic_data));
}
test_mockable uintptr_t get_panic_data_start()
{
return (uintptr_t)
(__ram_data + RAM_DATA_SIZE - sizeof(struct panic_data));
}
test_mockable void system_reset(int flags)
{
uint32_t save_flags = 0;