mirror of
https://github.com/torvalds/linux.git
synced 2026-11-25 07:52:34 +00:00
Many of the privileged CSRs exist in a supervisor and machine version that are used very similarly. Provide versions of the CSR names and fields that map to either the S-mode or M-mode variant depending on a new CONFIG_RISCV_M_MODE kconfig symbol. Contains contributions from Damien Le Moal <[email protected]> and Paul Walmsley <[email protected]>. Signed-off-by: Christoph Hellwig <[email protected]> Acked-by: Thomas Gleixner <[email protected]> # for drivers/clocksource, drivers/irqchip [[email protected]: updated to apply] Signed-off-by: Paul Walmsley <[email protected]>
25 lines
539 B
C
25 lines
539 B
C
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
/*
|
|
* Copyright (C) 2009 Sunplus Core Technology Co., Ltd.
|
|
* Lennox Wu <[email protected]>
|
|
* Chen Liqin <[email protected]>
|
|
* Copyright (C) 2013 Regents of the University of California
|
|
*/
|
|
|
|
|
|
#include <linux/extable.h>
|
|
#include <linux/module.h>
|
|
#include <linux/uaccess.h>
|
|
|
|
int fixup_exception(struct pt_regs *regs)
|
|
{
|
|
const struct exception_table_entry *fixup;
|
|
|
|
fixup = search_exception_tables(regs->epc);
|
|
if (fixup) {
|
|
regs->epc = fixup->fixup;
|
|
return 1;
|
|
}
|
|
return 0;
|
|
}
|