Permalink
Browse files

arm, arm64: use proper return types for traps

There is a enum type for the return value of traps: enum trap_return. Use the
proper return type, wherever it is used.

Signed-off-by: Ralf Ramsauer <ralf.ramsauer@oth-regensburg.de>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
  • Loading branch information...
rralf authored and jan-kiszka committed Nov 5, 2018
1 parent fca44df commit f930d5d9d0c63d3adfd9aaafbe618ab9943b49b7
@@ -33,4 +33,4 @@

#define SMCCC_IS_CONV_64(function_id) !!(function_id & (1 << 30))

int handle_smc(struct trap_context *ctx);
enum trap_return handle_smc(struct trap_context *ctx);
@@ -22,10 +22,10 @@ enum trap_return {
TRAP_FORBIDDEN = -1,
};

typedef int (*trap_handler)(struct trap_context *ctx);
typedef enum trap_return (*trap_handler)(struct trap_context *ctx);

void arch_skip_instruction(struct trap_context *ctx);

int arch_handle_dabt(struct trap_context *ctx);
enum trap_return arch_handle_dabt(struct trap_context *ctx);

#endif /* !_JAILHOUSE_ASM_TRAPS_H */
@@ -30,7 +30,7 @@ static long handle_arch(struct trap_context *ctx)
}
}

int handle_smc(struct trap_context *ctx)
enum trap_return handle_smc(struct trap_context *ctx)
{
unsigned long *regs = ctx->regs;
u32 *stats = this_cpu_public()->stats;
@@ -62,7 +62,7 @@ static void arch_inject_dabt(struct trap_context *ctx, unsigned long addr)
arm_write_sysreg(DFAR, addr);
}

int arch_handle_dabt(struct trap_context *ctx)
enum trap_return arch_handle_dabt(struct trap_context *ctx)
{
enum mmio_result mmio_result;
struct mmio_access mmio;
@@ -245,7 +245,7 @@ static void dump_guest_regs(struct trap_context *ctx)
panic_printk("\n");
}

static int arch_handle_smc(struct trap_context *ctx)
static enum trap_return arch_handle_smc(struct trap_context *ctx)
{
unsigned long *regs = ctx->regs;

@@ -261,7 +261,7 @@ static int arch_handle_smc(struct trap_context *ctx)
return handle_smc(ctx);
}

static int arch_handle_hvc(struct trap_context *ctx)
static enum trap_return arch_handle_hvc(struct trap_context *ctx)
{
unsigned long *regs = ctx->regs;
unsigned long code = regs[0];
@@ -277,7 +277,7 @@ static int arch_handle_hvc(struct trap_context *ctx)
return TRAP_HANDLED;
}

static int arch_handle_cp15_32(struct trap_context *ctx)
static enum trap_return arch_handle_cp15_32(struct trap_context *ctx)
{
u32 hsr = ctx->hsr;
u32 rt = (hsr >> 5) & 0xf;
@@ -360,7 +360,7 @@ static int arch_handle_cp15_32(struct trap_context *ctx)
return TRAP_HANDLED;
}

static int arch_handle_cp15_64(struct trap_context *ctx)
static enum trap_return arch_handle_cp15_64(struct trap_context *ctx)
{
u32 hsr = ctx->hsr;
u32 rt2 = (hsr >> 10) & 0xf;
@@ -402,7 +402,7 @@ static int arch_handle_cp15_64(struct trap_context *ctx)
return TRAP_HANDLED;
}

static int handle_iabt(struct trap_context *ctx)
static enum trap_return handle_iabt(struct trap_context *ctx)
{
unsigned long hpfar, hdfar;

@@ -30,7 +30,7 @@ static void arch_inject_dabt(struct trap_context *ctx, unsigned long addr)
while (1);
}

int arch_handle_dabt(struct trap_context *ctx)
enum trap_return arch_handle_dabt(struct trap_context *ctx)
{
enum mmio_result mmio_result;
struct mmio_access mmio;
@@ -33,7 +33,7 @@ void arch_skip_instruction(struct trap_context *ctx)
arm_write_sysreg(ELR_EL2, pc);
}

static int handle_hvc(struct trap_context *ctx)
static enum trap_return handle_hvc(struct trap_context *ctx)
{
unsigned long *regs = ctx->regs;
unsigned long code = regs[0];
@@ -51,7 +51,7 @@ static int handle_hvc(struct trap_context *ctx)
return TRAP_HANDLED;
}

static int handle_sysreg(struct trap_context *ctx)
static enum trap_return handle_sysreg(struct trap_context *ctx)
{
u32 esr = ctx->esr;
u32 rt = (esr >> 5) & 0x1f;
@@ -69,7 +69,7 @@ static int handle_sysreg(struct trap_context *ctx)
return TRAP_UNHANDLED;
}

static int handle_iabt(struct trap_context *ctx)
static enum trap_return handle_iabt(struct trap_context *ctx)
{
unsigned long hpfar, hdfar;

0 comments on commit f930d5d

Please sign in to comment.