Skip to contentSkip to conversation

add addrespace definition for sh2a.

PATCH In review Takashi Yoshii 2 participants 2 messages Aug 4, 2008 SuperH

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 add addrespace definition for sh2a.

Newfile: arch/sh/include/cpu-sh2a/cpu/addrspace.h

This file seems had be removed to use fallback (cpu-common/cpu/addrspace.h), but, I'd like to add sh2a specific file here, because
1. the values defined there are not suitable for sh2a.
2. I don't think there is "common" definition for these values.

Values are chosen by consideration of followings...
P1 is 0. perhaps no question.
P2 is from hardware manual, which says no-cache area starts at 20000000. It means that P? space size 000000.
P3 is P2+size since asm/ptrace.h uses P3 as a end of P2.
P4 is P3+size since asm/fixup.h uses P4 as a end of P3.

---
 arch/sh/include/cpu-sh2a/cpu/addrspace.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
 create mode 100644 arch/sh/include/cpu-sh2a/cpu/addrspace.h
arch/sh/include/cpu-sh2a/cpu/addrspace.h new file +10 -0
new file mode 100644
index 0000000..31eb4b5
@@ -0,0 +1,10 @@
+#ifndef __ASM_SH_CPU_SH2A_ADDRSPACE_H
+#define __ASM_SH_CPU_SH2A_ADDRSPACE_H
+
+#define P0SEG		0x00000000
+#define P1SEG		0x00000000
+#define P2SEG		0x20000000
+#define P3SEG		0x40000000
+#define P4SEG		0x60000000
+
+#endif /* __ASM_SH_CPU_SH2A_ADDRSPACE_H */
Signature · 1 line
1.5.4.5
#1 lore raw
Quoted 7 lines · Takashi Yoshii

Newfile: arch/sh/include/cpu-sh2a/cpu/addrspace.h

This file seems had be removed to use fallback (cpu-common/cpu/addrspace.h), but, I'd like to add sh2a specific file here, because
1. the values defined there are not suitable for sh2a.
2. I don't think there is "common" definition for these values.

Quoted 8 lines

Values are chosen by consideration of followings...
P1 is 0. perhaps no question.
P2 is from hardware manual, which says no-cache area starts at 20000000. It means that P? space size 000000.
P3 is P2+size since asm/ptrace.h uses P3 as a end of P2.
P4 is P3+size since asm/fixup.h uses P4 as a end of P3.

This is a good indicator for why we should just kill off all of the references in-tree that we can find, it's been a terrible abstraction from the beginning. It would have been nice if more than a single family of CPUs could have been consistent with its segmentation.

For SH-2A these look fine, so I'll check this in as it is, but I would much rather see patches that get rid of more of these references, rather than adding more ;-)