libpayload: align arm64 with new exception handling model

The exception handling was previously updated, however the
arm64 changes raced with hat one. Make the arm64 align with
the new model. Without these changes compilation will fail.

BUG=None
BRANCH=None
TEST=Can build libpayload for rush.

Change-Id: I320b39a57b985d1f87446ea7757955664f8dba8f
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/204402
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Commit-Queue: Furquan Shaikh <furquan@chromium.org>
This commit is contained in:
Aaron Durbin 2014-06-17 17:46:01 -05:00 committed by chrome-internal-fetch
commit 0080df41b3
2 changed files with 10 additions and 7 deletions

View file

@ -36,9 +36,10 @@ extern unsigned int test_exc;
struct exception_handler_info
{
const char *name;
exception_hook hook;
};
static exception_hook hook;
struct exception_state *exception_state;
static struct exception_handler_info exceptions[EXC_COUNT] = {
[EXC_INV] = { "_invalid_exception" },
[EXC_SYNC] = { "_sync" },
@ -61,14 +62,14 @@ static void print_regs(struct exception_state *state)
void exception_dispatch(struct exception_state *state, int idx);
void exception_dispatch(struct exception_state *state, int idx)
{
exception_state = state;
if (idx >= EXC_COUNT) {
printf("Bad exception index %d.\n", idx);
} else {
struct exception_handler_info *info = &exceptions[idx];
if (info->hook) {
info->hook(idx, state);
if (hook && hook(idx))
return;
}
if (info->name)
printf("exception %s\n", info->name);
@ -89,8 +90,8 @@ void exception_init(void)
set_vbar(exception_table);
}
void exception_install_hook(int type, exception_hook hook)
void exception_install_hook(exception_hook h)
{
die_if(type >= EXC_COUNT, "Out of bounds exception index %d.\n", type);
exceptions[type].hook = hook;
die_if(hook, "Implement support for a list of hooks if you need it.");
hook = h;
}

View file

@ -41,6 +41,8 @@ struct exception_state
uint64_t regs[31];
} __attribute__((packed));
extern struct exception_state *exception_state;
enum {
EXC_INV = 0,
EXC_SYNC = 1,