Skip to contentSkip to conversation

unicore32 core architecture: processor and system headers

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 3/12 unicore32 core architecture: processor and system headers

From: Guan Xuetao <[email protected]>

This patch includes processor and system headers. System call interface is here.
We used the similar syscall interface as ARM formerly, so the similar calls.S, unistd.h
and sys_unicore.c. While we are defining new ABI, it will use the syscall numbers in asm-generic/unistd.h.

---
 arch/unicore32/include/asm/byteorder.h  |   24 ++
 arch/unicore32/include/asm/cpu-single.h |   45 +++
 arch/unicore32/include/asm/cputype.h    |   33 +++
 arch/unicore32/include/asm/hwcap.h      |   32 +++
 arch/unicore32/include/asm/processor.h  |   92 +++++++
 arch/unicore32/include/asm/system.h     |  171 ++++++++++++
 arch/unicore32/include/asm/unistd.h     |  450 +++++++++++++++++++++++++++++++
 arch/unicore32/kernel/calls.S           |  390 ++++++++++++++++++++++++++
 arch/unicore32/kernel/sys_unicore.c     |  132 +++++++++
 arch/unicore32/mm/proc-macros.S         |  145 ++++++++++
 arch/unicore32/mm/proc-ucv2.S           |  134 +++++++++
 11 files changed, 1648 insertions(+), 0 deletions(-)
arch/unicore32/include/asm/byteorder.h new file +24 -0
new file mode 100644
index 0000000..ebe1b3f
@@ -0,0 +1,24 @@
+/*
+ * linux/arch/unicore32/include/asm/byteorder.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.
+ *
+ * UniCore ONLY support Little Endian mode, the data bus is connected such
+ * that byte accesses appear as:
+ *  0 = d0...d7, 1 = d8...d15, 2 = d16...d23, 3 = d24...d31
+ * and word accesses (data or instruction) appear as:
+ *  d0...d31
+ */
+#ifndef __UNICORE_BYTEORDER_H__
+#define __UNICORE_BYTEORDER_H__
+
+#include <linux/byteorder/little_endian.h>
+
+#endif
+
arch/unicore32/include/asm/cpu-single.h new file +45 -0

45 lines not on this page · raw message

arch/unicore32/include/asm/cputype.h new file +33 -0
new file mode 100644
index 0000000..ec1a30f
@@ -0,0 +1,33 @@
+/*
+ * linux/arch/unicore32/include/asm/cputype.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_CPUTYPE_H__
+#define __UNICORE_CPUTYPE_H__
+
+#include <linux/stringify.h>
+
+#define CPUID_CPUID	0
+#define CPUID_CACHETYPE	1
+
+#define read_cpuid(reg)							\
+	({								\
+		unsigned int __val;					\
+		asm("movc	%0, p0.c0, #" __stringify(reg)		\
+		    : "=r" (__val)					\
+		    :							\
+		    : "cc");						\
+		__val;							\
+	})
+
+#define uc32_cpuid		read_cpuid(CPUID_CPUID)
+#define uc32_cachetype		read_cpuid(CPUID_CACHETYPE)
+
+#endif
arch/unicore32/include/asm/hwcap.h new file +32 -0
new file mode 100644
index 0000000..97bd40f
@@ -0,0 +1,32 @@
+/*
+ * linux/arch/unicore32/include/asm/hwcap.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_HWCAP_H__
+#define __UNICORE_HWCAP_H__
+
+/*
+ * HWCAP flags
+ */
+#define HWCAP_MSP		1
+#define HWCAP_UNICORE16		2
+#define HWCAP_CMOV		4
+#define HWCAP_UNICORE_F64       8
+#define HWCAP_TLS		0x80
+
+#if defined(__KERNEL__) && !defined(__ASSEMBLY__)
+/*
+ * This yields a mask that user programs can use to figure out what
+ * instruction set this cpu supports.
+ */
+#define ELF_HWCAP		(HWCAP_CMOV | HWCAP_UNICORE_F64)
+#endif
+
+#endif
arch/unicore32/include/asm/processor.h new file +92 -0

92 lines not on this page · raw message

arch/unicore32/include/asm/system.h new file +171 -0

171 lines not on this page · raw message

arch/unicore32/include/asm/unistd.h new file +450 -0

450 lines not on this page · raw message

arch/unicore32/kernel/calls.S new file +390 -0

390 lines not on this page · raw message

arch/unicore32/kernel/sys_unicore.c new file +132 -0

132 lines not on this page · raw message

arch/unicore32/mm/proc-macros.S new file +145 -0

145 lines not on this page · raw message

arch/unicore32/mm/proc-ucv2.S new file +134 -0

134 lines not on this page · raw message