soc/intel/xeon_sp: Align resources to 4K
[coreboot2.git] / payloads / libpayload / sample / arch_mock / hello_mocks.c
blob84e86ff257fac614ffb55833675b39a91bd777ea
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <libpayload-config.h>
4 #include <arch/types.h>
5 #include <stddef.h>
6 #include <unistd.h>
7 #include <stdio.h>
9 /* Use libc version. calling exit() or abort() would cause infinite recursion */
10 __attribute__((noreturn))
11 void _exit(int);
13 __attribute__((noreturn))
14 void halt(void)
16 _exit(0);
19 #define TEST_SYMBOL(symbol, value) asm(".set " #symbol ", " #value "\n\t.globl " #symbol)
21 #define TEST_REGION(region, size) uint8_t _##region[size]; \
22 TEST_SYMBOL(_e##region, _##region + size); \
23 TEST_SYMBOL(_##region##_size, size)
25 TEST_REGION(heap, CONFIG_LP_HEAP_SIZE);
27 uint64_t timer_raw_value(void)
29 return 0;
32 uint64_t timer_hz(void)
34 return 0;
37 /* Not present in libpayload. Can be used to write to real stdout. */
38 ssize_t write(int fildes, const void *buf, size_t nbyte);
40 void console_write(const void *buffer, size_t count)
42 write(1, buffer, count);