Skip to contentSkip to conversation

arch/score/kernel: Add 'score_ksyms.c' to export special symbols

PATCH Superseded Chen Gang 1 participant 2 messages Jul 8, 2014 – Jul 9, 2014

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Chen Gang

author
#0 lore raw

PATCH 1/1 arch/score/kernel: Add 'score_ksyms.c' to export special symbols

Some symbols are not implemented in C, or not in "arch/score", but score need export them, so add 'score_ksyms.c' to export them, just like other architectures have done.

The related error (with allmodconfig under score):

MODPOST 1365 modules
ERROR: "__clear_user" [drivers/md/dm-mod.ko] undefined!
ERROR: "__copy_tofrom_user" [net/x25/x25.ko] undefined!
ERROR: "__strncpy_from_user" [fs/xfs/xfs.ko] undefined!

ERROR: "max_low_pfn" [net/wireless/lib80211_crypt_tkip.ko] undefined!
ERROR: "min_low_pfn" [net/wireless/lib80211_crypt_tkip.ko] undefined!

---
 arch/score/kernel/Makefile      |  2 +-
 arch/score/kernel/score_ksyms.c | 39 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+), 1 deletion(-)
 create mode 100644 arch/score/kernel/score_ksyms.c
arch/score/kernel/Makefile +1 -1
index fb1802b..891133b 100644
@@ -6,6 +6,6 @@ extra-y	:= head.o vmlinux.lds
 
 obj-y += entry.o irq.o process.o ptrace.o \
 	setup.o signal.o sys_score.o time.o traps.o \
-	sys_call_table.o
+	sys_call_table.o score_ksyms.o
 
 obj-$(CONFIG_MODULES) += module.o
arch/score/kernel/score_ksyms.c new file +39 -0
new file mode 100644
index 0000000..507d008
@@ -0,0 +1,39 @@
+/*
+ * arch/score/kernel/score_ksyms.c
+ *
+ * Score Processor version.
+ *
+ * No Copyright (C)
+ *  Chen Gang <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see the file COPYING, or write
+ * to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include <linux/export.h>
+#include <linux/syscalls.h>
+
+/*
+ * Assembly functions that may be used (directly or indirectly) by modules
+ */
+EXPORT_SYMBOL(__clear_user);
+EXPORT_SYMBOL(__copy_tofrom_user);
+EXPORT_SYMBOL(__strncpy_from_user);
+
+/*
+ * Define but not export in generic mm sub-systems, but score need export
+ */
+EXPORT_SYMBOL(min_low_pfn);
+EXPORT_SYMBOL(max_low_pfn);
Signature · 1 line
1.9.2.459.g68773ac
author
#1 lore raw

Oh, sorry, forgot 'csum_partial' which also need export in this file. And I shall send patch v2 for it.

Quoted 80 lines · Chen Gang

Some symbols are not implemented in C, or not in "arch/score", but score need export them, so add 'score_ksyms.c' to export them, just like other architectures have done.

The related error (with allmodconfig under score):

MODPOST 1365 modules
ERROR: "__clear_user" [drivers/md/dm-mod.ko] undefined!
ERROR: "__copy_tofrom_user" [net/x25/x25.ko] undefined!
ERROR: "__strncpy_from_user" [fs/xfs/xfs.ko] undefined!

ERROR: "max_low_pfn" [net/wireless/lib80211_crypt_tkip.ko] undefined!
ERROR: "min_low_pfn" [net/wireless/lib80211_crypt_tkip.ko] undefined!

---
 arch/score/kernel/Makefile      |  2 +-
 arch/score/kernel/score_ksyms.c | 39 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+), 1 deletion(-)
 create mode 100644 arch/score/kernel/score_ksyms.c
arch/score/kernel/Makefile +1 -1
index fb1802b..891133b 100644
@@ -6,6 +6,6 @@ extra-y	:= head.o vmlinux.lds
 
 obj-y += entry.o irq.o process.o ptrace.o \
 	setup.o signal.o sys_score.o time.o traps.o \
-	sys_call_table.o
+	sys_call_table.o score_ksyms.o
 
 obj-$(CONFIG_MODULES) += module.o
arch/score/kernel/score_ksyms.c new file +39 -0
new file mode 100644
index 0000000..507d008
@@ -0,0 +1,39 @@
+/*
+ * arch/score/kernel/score_ksyms.c
+ *
+ * Score Processor version.
+ *
+ * No Copyright (C)
+ *  Chen Gang <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see the file COPYING, or write
+ * to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include <linux/export.h>
+#include <linux/syscalls.h>
+
+/*
+ * Assembly functions that may be used (directly or indirectly) by modules
+ */
+EXPORT_SYMBOL(__clear_user);
+EXPORT_SYMBOL(__copy_tofrom_user);
+EXPORT_SYMBOL(__strncpy_from_user);
+
+/*
+ * Define but not export in generic mm sub-systems, but score need export
+ */
+EXPORT_SYMBOL(min_low_pfn);
+EXPORT_SYMBOL(max_low_pfn);
Signature · 3 lines
Chen Gang

Open, share, and attitude like air, water, and life which God blessed