[PATCH 2/4] Add UV bios call infrastructure
Add the EFI callback function and associated wrapper code.
Initialize SAL system table entry info at boot time.
Signed-off-by: Russ Anderson <rja@sgi.com>
Signed-off-by: Paul Jackson <pj@sgi.com>
---
arch/x86/kernel/bios_uv.c | 101 ++++++++++++++++++++++++++++++---------
arch/x86/kernel/genx2apic_uv_x.c | 1
include/asm-x86/efi.h | 14 +++++
include/asm-x86/uv/bios.h | 73 +++++++++++++++-------------
4 files changed, 136 insertions(+), 53 deletions(-)
Index: linux/arch/x86/kernel/bios_uv.c
===================================================================
--- linux.orig/arch/x86/kernel/bios_uv.c 2008-09-26 14:13:24.000000000 -0500
+++ linux/arch/x86/kernel/bios_uv.c 2008-09-26 14:13:36.000000000 -0500
@@ -1,8 +1,6 @@
/*
* BIOS run time interface routines.
*
- * Copyright (c) 2008 Silicon Graphics, Inc. All Rights Reserved.
- *
* 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
@@ -16,33 +14,94 @@
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Copyright (c) 2008 Silicon Graphics, Inc. All Rights Reserved.
+ * Copyright (c) Russ Anderson
*/
+#include <linux/efi.h>
+#include <asm/efi.h>
+#include <linux/io.h>
#include <asm/uv/bios.h>
-const char *
-x86_bios_strerror(long status)
+struct uv_systab uv_systab;
+
+s64 uv_bios_call(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3, u64 a4, u64 a5)
{
- const char *str;
- switch (status) {
- case 0: str = "Call completed without error"; break;
- case -1: str = "Not implemented"; break;
- case -2: str = "Invalid argument"; break;
- case -3: str = "Call completed with ...=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= efi_call_virt<n> and efi_call_phys<n> is the API instead of efi_call<n>. And please put the implementation without CONFIG_EFI defined out of #ifdef CONFIG_X86_32 <...> #else <...> #endif Best Regards, Huang Ying
ok - i'll wait for v3 of this patchset. Ingo --
#define efi_call_virt6(f, a1, a2, a3, a4, a5, a6) \
efi_call6((void *)(efi.systab->runtime->f), (u64)(a1), (u64)(a2), \
(u64)(a3), (u64)(a4), (u64)(a5), (u64)(a6))
efi_call_virt6() uses efi.systab->runtime->f.
My call needs to use uv_systab, not efi.systab.
How about something like this?
#define efi_call_uv_virt6(a1, a2, a3, a4, a5, a6) \
efi_call6((void *)(__va(uv_systab.function)), (u64)(a1), (u64)(a2), \
--
Russ Anderson, OS RAS/Partitioning Project Lead
SGI - Silicon Graphics Inc rja@sgi.com
--
After thinking about this, if a new runtime call was added to efi_runtime_services_t, then the existing efi_call_virt<n> could be used. This would remove the need to create uv_systab. I'll post a patch shortly. -- Russ Anderson, OS RAS/Partitioning Project Lead SGI - Silicon Graphics Inc rja@sgi.com --
Please don't touch efi_runtime_services_t, if you do not go through UEFI standard procedure. It can not be extended in a non-standard way. Thinking about someone else adds another new field to efi_runtime_services_t in a conflict way. Best Regards, Huang Ying --
Hi, Russ, Yes. efi_call_virt6() is tied with standard EFI runtime services, so it may be not suitable for your need. What you need is just to do calling convention converting, like efi_call6 does. So I think it is better to just use your current implementation. Acked-by: Huang Ying <ying.huang@intel.com> Best Regards, Huang Ying --
-- Russ Anderson, OS RAS/Partitioning Project Lead SGI - Silicon Graphics Inc rja@sgi.com --
ok - could you please resend the lot with all the Acked-by's in place? (and with all the bits that are being objected left out) Ingo --
Resent on Friday. Here are the links. http://marc.info/?l=linux-kernel&m=122305331422380&w=2 http://marc.info/?l=linux-kernel&m=122305331522386&w=2 http://marc.info/?l=linux-kernel&m=122305331522389&w=2 http://marc.info/?l=linux-kernel&m=122305331622393&w=2 http://marc.info/?l=linux-kernel&m=122305331722396&w=2 Thanks, -- Russ Anderson, OS RAS/Partitioning Project Lead SGI - Silicon Graphics Inc rja@sgi.com --
