2 * BIOS run time interface routines.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 * Copyright (c) 2008 Silicon Graphics, Inc. All Rights Reserved.
19 * Copyright (c) Russ Anderson
22 #include <linux/efi.h>
25 #include <asm/uv/bios.h>
27 struct uv_systab uv_systab;
29 s64 uv_bios_call(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3, u64 a4, u64 a5)
31 struct uv_systab *tab = &uv_systab;
35 * BIOS does not support UV systab
37 return BIOS_STATUS_UNIMPLEMENTED;
39 return efi_call6((void *)__va(tab->function),
40 (u64)which, a1, a2, a3, a4, a5);
43 s64 uv_bios_call_irqsave(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3,
46 unsigned long bios_flags;
49 local_irq_save(bios_flags);
50 ret = uv_bios_call(which, a1, a2, a3, a4, a5);
51 local_irq_restore(bios_flags);
56 s64 uv_bios_call_reentrant(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3,
62 ret = uv_bios_call(which, a1, a2, a3, a4, a5);
69 x86_bios_freq_base(unsigned long clock_type, unsigned long *ticks_per_second,
70 unsigned long *drift_info)
72 return uv_bios_call(UV_BIOS_FREQ_BASE, clock_type,
73 (u64)ticks_per_second, 0, 0, 0);
75 EXPORT_SYMBOL_GPL(x86_bios_freq_base);
79 void uv_bios_init(void)
81 struct uv_systab *tab;
83 if ((efi.uv_systab == EFI_INVALID_TABLE_ADDR) ||
84 (efi.uv_systab == (unsigned long)NULL)) {
85 printk(KERN_CRIT "No EFI UV System Table.\n");
86 uv_systab.function = (unsigned long)NULL;
90 tab = (struct uv_systab *)ioremap(efi.uv_systab,
91 sizeof(struct uv_systab));
92 if (strncmp(tab->signature, "UVST", 4) != 0)
93 printk(KERN_ERR "bad signature in UV system table!");
96 * Copy table to permanent spot for later use.
98 memcpy(&uv_systab, tab, sizeof(struct uv_systab));
101 printk(KERN_INFO "EFI UV System Table Revision %d\n", tab->revision);
103 #else /* !CONFIG_EFI */
105 void uv_bios_init(void) { }