summaryrefslogtreecommitdiff
path: root/zephyr/shim/src/ztest_system.c
blob: 580368d7f989842e12704197fab5e50ddfe490b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/* Copyright 2021 The Chromium OS Authors. All rights reserved.
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include "system.h"
#include "cros_version.h"

/* Ongoing actions preventing going into deep-sleep mode. */
uint32_t sleep_mask;

void system_common_pre_init(void)
{
}

int system_add_jump_tag(uint16_t tag, int version, int size, const void *data)
{
	return EC_SUCCESS;
}

const uint8_t *system_get_jump_tag(uint16_t tag, int *version, int *size)
{
	return NULL;
}

#ifdef CONFIG_ZTEST
struct system_jumped_late_mock system_jumped_late_mock = {
	.ret_val = 0,
	.call_count = 0,
};
#endif

int system_jumped_late(void)
{
#ifdef CONFIG_ZTEST
	system_jumped_late_mock.call_count++;

	return system_jumped_late_mock.ret_val;
#else
	return 0;
#endif
}

enum ec_image system_get_image_copy(void)
{
	return EC_IMAGE_RW;
}

int system_is_locked(void)
{
	return 0;
}

int system_is_in_rw(void)
{
	return 1;
}

uint32_t system_get_reset_flags(void)
{
	return 0;
}

void system_print_banner(void)
{
	printk("Image: %s\n", build_info);
}

void system_set_reset_flags(uint32_t flags)
{
}

struct jump_data *get_jump_data(void)
{
	return NULL;
}

__attribute__((weak))
void system_reset(int flags)
{
	__builtin_unreachable();
}