summaryrefslogtreecommitdiff
path: root/firmware/payloads/dummy_main.c
blob: d4bc3603b0211a45824328df272ae5a7f951b25b (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
/*
 * Copyright (c) 2018 Western Digital Corporation or its affiliates.
 *
 * Authors:
 *   Anup Patel <anup.patel@wdc.com>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#include <sbi/sbi_ecall_interface.h>

#define wfi()						\
do {							\
	__asm__ __volatile__ ("wfi" ::: "memory");	\
} while (0)

static void sbi_puts(const char *str)
{
	while (*str) {
		SBI_ECALL_1(SBI_ECALL_CONSOLE_PUTCHAR, *str);
		str++;
	}
}

void dummy_main(unsigned long a0, unsigned long a1)
{
	sbi_puts("\nDummy Payload\n");

	while (1)
		wfi();
}