diff options
author | Anup Patel <anup.patel@wdc.com> | 2018-12-11 16:54:06 +0300 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2018-12-11 16:54:06 +0300 |
commit | 9e8ff05cb61f157fb0bcb6b0071d7b6dc0763faa (patch) | |
tree | b9513a86b3b36e569cb46387846fee9c5544f566 /include/sbi/sbi_scratch.h | |
download | opensbi-9e8ff05cb61f157fb0bcb6b0071d7b6dc0763faa.tar.xz |
Initial commit.
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Diffstat (limited to 'include/sbi/sbi_scratch.h')
-rw-r--r-- | include/sbi/sbi_scratch.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/include/sbi/sbi_scratch.h b/include/sbi/sbi_scratch.h new file mode 100644 index 0000000..d5c6f35 --- /dev/null +++ b/include/sbi/sbi_scratch.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2018 Western Digital Corporation or its affiliates. + * + * Authors: + * Anup Patel <anup.patel@wdc.com> + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#ifndef __SBI_SCRATCH_H__ +#define __SBI_SCRATCH_H__ + +#include <sbi/riscv_asm.h> +#include <sbi/sbi_types.h> + +struct sbi_scratch { + unsigned long tmp0; + unsigned long fw_start; + unsigned long fw_size; + unsigned long next_arg1; + unsigned long next_addr; + unsigned long next_mode; + unsigned long warmboot_addr; + unsigned long platform_addr; + unsigned long hartid_to_scratch; + unsigned long ipi_type; +} __attribute__((packed)); + +#define sbi_scratch_thishart_ptr() \ +((struct sbi_scratch *)csr_read(mscratch)) + +#define sbi_scratch_thishart_arg1_ptr() \ +((void *)(sbi_scratch_thishart_ptr()->next_arg1)) + +#endif |