Skip to contentSkip to conversation

unicore32 core architecture: mm related: fault handling

PATCH In review Guan Xuetao 1 participant 1 message Dec 25, 2010 Generic include/asm header files

lore
Share & tools
lore
#0 lore raw

PATCH 7/12 unicore32 core architecture: mm related: fault handling

From: Guan Xuetao <[email protected]>

Patch 7 implements fault handling of memory management.

---
 arch/unicore32/include/asm/mmu.h           |   17 +
 arch/unicore32/include/asm/mmu_context.h   |   87 +++++
 arch/unicore32/include/asm/pgalloc.h       |  110 ++++++
 arch/unicore32/include/asm/pgtable-hwdef.h |   55 +++
 arch/unicore32/include/asm/pgtable.h       |  317 +++++++++++++++++
 arch/unicore32/mm/alignment.c              |  524 ++++++++++++++++++++++++++++
 arch/unicore32/mm/extable.c                |   24 ++
 arch/unicore32/mm/fault-unicore.c          |   65 ++++
 arch/unicore32/mm/fault.c                  |  491 ++++++++++++++++++++++++++
 arch/unicore32/mm/fault.h                  |   14 +
 arch/unicore32/mm/mmu.c                    |  494 ++++++++++++++++++++++++++
 arch/unicore32/mm/pgd.c                    |  102 ++++++
 12 files changed, 2300 insertions(+), 0 deletions(-)
arch/unicore32/include/asm/mmu.h new file +17 -0
new file mode 100644
index 0000000..66fa341
@@ -0,0 +1,17 @@
+/*
+ * linux/arch/unicore32/include/asm/mmu.h
+ *
+ * Code specific to PKUnity SoC and UniCore ISA
+ *
+ * Copyright (C) 2001-2010 GUAN Xue-tao
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#ifndef __UNICORE_MMU_H__
+#define __UNICORE_MMU_H__
+
+typedef	unsigned long mm_context_t;
+
+#endif
arch/unicore32/include/asm/mmu_context.h new file +87 -0

87 lines not on this page · raw message

arch/unicore32/include/asm/pgalloc.h new file +110 -0

110 lines not on this page · raw message

arch/unicore32/include/asm/pgtable-hwdef.h new file +55 -0

55 lines not on this page · raw message

arch/unicore32/include/asm/pgtable.h new file +317 -0

317 lines not on this page · raw message

arch/unicore32/mm/alignment.c new file +524 -0

524 lines not on this page · raw message

arch/unicore32/mm/extable.c new file +24 -0
new file mode 100644
index 0000000..6564180
@@ -0,0 +1,24 @@
+/*
+ * linux/arch/unicore32/mm/extable.c
+ *
+ * Code specific to PKUnity SoC and UniCore ISA
+ *
+ * Copyright (C) 2001-2010 GUAN Xue-tao
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#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(instruction_pointer(regs));
+	if (fixup)
+		regs->UCreg_pc = fixup->fixup;
+
+	return fixup != NULL;
+}
arch/unicore32/mm/fault-unicore.c new file +65 -0

65 lines not on this page · raw message

arch/unicore32/mm/fault.c new file +491 -0

491 lines not on this page · raw message

arch/unicore32/mm/fault.h new file +14 -0
new file mode 100644
index 0000000..2c00332
@@ -0,0 +1,14 @@
+/*
+ * linux/arch/unicore32/mm/fault.h
+ *
+ * Code specific to PKUnity SoC and UniCore ISA
+ *
+ * Copyright (C) 2001-2010 GUAN Xue-tao
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+void do_bad_area(unsigned long addr, unsigned int fsr, struct pt_regs *regs);
+
+unsigned long search_exception_table(unsigned long addr);
arch/unicore32/mm/mmu.c new file +494 -0

494 lines not on this page · raw message

arch/unicore32/mm/pgd.c new file +102 -0

102 lines not on this page · raw message