diff options
author | Maximilian Brune <maximilian.brune@9elements.com> | 2024-03-07 22:56:27 +0100 |
---|---|---|
committer | Martin L Roth <gaumless@gmail.com> | 2024-03-09 23:47:19 +0000 |
commit | 5d0fa0de70145de85dcc6bd7c1ba0db19b864b89 (patch) | |
tree | 496dca4a6569a9c44e6c33f7709bc7febcafc531 /src/arch/riscv/include | |
parent | 56c3444d85a1b60fcc891910c9c60e5f75ba9197 (diff) |
arch/riscv: Remove typedefs
typedefs violate our coding-style
Signed-off-by: Maximilian Brune <maximilian.brune@9elements.com>
Change-Id: Id51eda53b6b53ed2cc66c0339c03c855c12c1bd8
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81124
Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philipp Hug <philipp@hug.cx>
Diffstat (limited to 'src/arch/riscv/include')
-rw-r--r-- | src/arch/riscv/include/arch/exception.h | 14 | ||||
-rw-r--r-- | src/arch/riscv/include/mcall.h | 24 | ||||
-rw-r--r-- | src/arch/riscv/include/sbi.h | 2 |
3 files changed, 20 insertions, 20 deletions
diff --git a/src/arch/riscv/include/arch/exception.h b/src/arch/riscv/include/arch/exception.h index 9339437019..e807a3f3c8 100644 --- a/src/arch/riscv/include/arch/exception.h +++ b/src/arch/riscv/include/arch/exception.h @@ -5,29 +5,29 @@ #include <stdint.h> -typedef struct { +struct trapframe { uintptr_t gpr[32]; uintptr_t status; uintptr_t epc; uintptr_t badvaddr; uintptr_t cause; uintptr_t insn; -} trapframe; +}; typedef uint32_t insn_t; -typedef struct { +struct insn_fetch { uintptr_t error; insn_t insn; -} insn_fetch_t; +}; static inline void exception_init(void) { } void redirect_trap(void); -void default_trap_handler(trapframe *tf); -void handle_supervisor_call(trapframe *tf); -void handle_misaligned(trapframe *tf); +void default_trap_handler(struct trapframe *tf); +void handle_supervisor_call(struct trapframe *tf); +void handle_misaligned(struct trapframe *tf); #endif diff --git a/src/arch/riscv/include/mcall.h b/src/arch/riscv/include/mcall.h index b0b4bc768b..c6ed7d804e 100644 --- a/src/arch/riscv/include/mcall.h +++ b/src/arch/riscv/include/mcall.h @@ -3,7 +3,7 @@ #ifndef _MCALL_H #define _MCALL_H -// NOTE: this is the size of hls_t below. A static_assert would be +// NOTE: this is the size of struct hls below. A static_assert would be // nice to have. #if __riscv_xlen == 64 #define HLS_SIZE 88 @@ -22,12 +22,12 @@ #include <arch/smp/atomic.h> #include <stdint.h> -typedef struct { +struct sbi_device_message { unsigned long dev; unsigned long cmd; unsigned long data; unsigned long sbi_private_data; -} sbi_device_message; +}; struct blocker { void *arg; @@ -36,11 +36,11 @@ struct blocker { atomic_t sync_b; }; -typedef struct { - sbi_device_message *device_request_queue_head; +struct hls { + struct sbi_device_message *device_request_queue_head; unsigned long device_request_queue_size; - sbi_device_message *device_response_queue_head; - sbi_device_message *device_response_queue_tail; + struct sbi_device_message *device_response_queue_head; + struct sbi_device_message *device_response_queue_tail; int hart_id; int ipi_pending; @@ -48,11 +48,11 @@ typedef struct { uint64_t *time; void *fdt; struct blocker entry; -} hls_t; +}; _Static_assert( - sizeof(hls_t) == HLS_SIZE, - "HLS_SIZE must equal to sizeof(hls_t)"); + sizeof(struct hls) == HLS_SIZE, + "HLS_SIZE must equal to sizeof(struct hls)"); register uintptr_t current_stack_pointer asm("sp"); @@ -60,8 +60,8 @@ register uintptr_t current_stack_pointer asm("sp"); (void *)((current_stack_pointer + RISCV_PGSIZE) & -RISCV_PGSIZE); }) // hart-local storage, at top of stack -#define HLS() ((hls_t*)(MACHINE_STACK_TOP() - HLS_SIZE)) -#define OTHER_HLS(id) ((hls_t*)((void*)HLS() + RISCV_PGSIZE * ((id) - HLS()->hart_id))) +#define HLS() ((struct hls *)(MACHINE_STACK_TOP() - HLS_SIZE)) +#define OTHER_HLS(id) ((struct hls *)((void *)HLS() + RISCV_PGSIZE * ((id) - HLS()->hart_id))) #define MACHINE_STACK_SIZE RISCV_PGSIZE diff --git a/src/arch/riscv/include/sbi.h b/src/arch/riscv/include/sbi.h index 04b0ac7c3f..8c526fcd81 100644 --- a/src/arch/riscv/include/sbi.h +++ b/src/arch/riscv/include/sbi.h @@ -21,6 +21,6 @@ #define IPI_SFENCE_VMA_ASID 8 #define IPI_SHUTDOWN 16 -void handle_sbi(trapframe *tf); +void handle_sbi(struct trapframe *tf); #endif /* RISCV_SBI_H */ |