summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorStefan Reinauer <stefan.reinauer@coreboot.org>2012-12-06 13:54:29 -0800
committerRonald G. Minnich <rminnich@gmail.com>2012-12-06 23:13:17 +0100
commit399486e8fb8f5b402f1833e496dbed11aa0ac669 (patch)
tree2dbf5ed01e8546eaf534c4dce8758f5b44624f8c /src/arch
parentc269a9b51cac8e6e24cd98b46543b89e1b836bf8 (diff)
Unify assembler function handling
Instead of adding regparm(0) to each assembler function called by coreboot, add an asmlinkage macro (like the Linux kernel does) that can be different per architecture (and that is empty on ARM right now) Change-Id: I7ad10c463f6c552f1201f77ae24ed354ac48e2d9 Signed-off-by: Stefan Reinauer <reinauer@google.com> Reviewed-on: http://review.coreboot.org/1973 Reviewed-by: David Hendricks <dhendrix@chromium.org> Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/armv7/include/arch/cpu.h25
-rw-r--r--src/arch/x86/boot/acpi.c2
-rw-r--r--src/arch/x86/include/arch/cpu.h5
-rw-r--r--src/arch/x86/include/arch/stages.h7
-rw-r--r--src/arch/x86/lib/cbfs_and_run.c4
5 files changed, 38 insertions, 5 deletions
diff --git a/src/arch/armv7/include/arch/cpu.h b/src/arch/armv7/include/arch/cpu.h
new file mode 100644
index 0000000000..b68004a600
--- /dev/null
+++ b/src/arch/armv7/include/arch/cpu.h
@@ -0,0 +1,25 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2012 Google, Inc
+ *
+ * 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; version 2 of the License.
+ *
+ * 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA, 02110-1301 USA
+ */
+
+#ifndef __ARCH_CPU_H__
+#define __ARCH_CPU_H__
+
+#define asmlinkage
+
+#endif
diff --git a/src/arch/x86/boot/acpi.c b/src/arch/x86/boot/acpi.c
index 4d405d9fe0..fd6a1baf88 100644
--- a/src/arch/x86/boot/acpi.c
+++ b/src/arch/x86/boot/acpi.c
@@ -748,7 +748,7 @@ extern int lowmem_backup_size;
#define WAKEUP_BASE 0x600
void (*acpi_do_wakeup)(u32 vector, u32 backup_source, u32 backup_target,
- u32 backup_size) __attribute__((regparm(0))) = (void *)WAKEUP_BASE;
+ u32 backup_size) asmlinkage = (void *)WAKEUP_BASE;
extern unsigned char __wakeup, __wakeup_size;
diff --git a/src/arch/x86/include/arch/cpu.h b/src/arch/x86/include/arch/cpu.h
index abe3f7fba7..ed8148e465 100644
--- a/src/arch/x86/include/arch/cpu.h
+++ b/src/arch/x86/include/arch/cpu.h
@@ -1,6 +1,8 @@
#ifndef ARCH_CPU_H
#define ARCH_CPU_H
+#include <stdint.h>
+
/*
* EFLAGS bits
*/
@@ -205,6 +207,9 @@ static void inline get_fms(struct cpuinfo_x86 *c, uint32_t tfms)
c->x86_model += ((tfms >> 16) & 0xF) << 4;
}
+
+#define asmlinkage __attribute__((regparm(0)))
+
#endif
#endif /* ARCH_CPU_H */
diff --git a/src/arch/x86/include/arch/stages.h b/src/arch/x86/include/arch/stages.h
index 3ddba51783..0d00144cba 100644
--- a/src/arch/x86/include/arch/stages.h
+++ b/src/arch/x86/include/arch/stages.h
@@ -19,6 +19,9 @@
#ifndef __ARCH_STAGES_H
#define __ARCH_STAGES_H
-void __attribute__((regparm(0))) copy_and_run(unsigned cpu_reset);
-void __attribute__((regparm(0))) copy_and_run_ap_code_in_car(unsigned ret_addr);
+
+#include <arch/cpu.h>
+
+void asmlinkage copy_and_run(unsigned cpu_reset);
+void asmlinkage copy_and_run_ap_code_in_car(unsigned ret_addr);
#endif
diff --git a/src/arch/x86/lib/cbfs_and_run.c b/src/arch/x86/lib/cbfs_and_run.c
index 62b2789f53..1f87e7ab62 100644
--- a/src/arch/x86/lib/cbfs_and_run.c
+++ b/src/arch/x86/lib/cbfs_and_run.c
@@ -41,7 +41,7 @@ static void cbfs_and_run_core(const char *filename, unsigned ebp)
);
}
-void __attribute__((regparm(0))) copy_and_run(unsigned cpu_reset)
+void asmlinkage copy_and_run(unsigned cpu_reset)
{
// FIXME fix input parameters instead normalizing them here.
if (cpu_reset == 1) cpu_reset = -1;
@@ -51,7 +51,7 @@ void __attribute__((regparm(0))) copy_and_run(unsigned cpu_reset)
}
#if CONFIG_AP_CODE_IN_CAR
-void __attribute__((regparm(0))) copy_and_run_ap_code_in_car(unsigned ret_addr)
+void asmlinkage copy_and_run_ap_code_in_car(unsigned ret_addr)
{
cbfs_and_run_core(CONFIG_CBFS_PREFIX "/coreboot_ap", ret_addr);
}