summaryrefslogtreecommitdiffstats
path: root/sys/ia64
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2003-02-01 22:50:09 +0000
committermarcel <marcel@FreeBSD.org>2003-02-01 22:50:09 +0000
commit389e4c3a2a331c3d7194d0a3252e266dd42daa80 (patch)
treeaeaa0efb42081601d640cc4f467d7de7fc56a1df /sys/ia64
parent785fe397ccfcda0950251b71412f7936ad68b224 (diff)
downloadFreeBSD-src-389e4c3a2a331c3d7194d0a3252e266dd42daa80.zip
FreeBSD-src-389e4c3a2a331c3d7194d0a3252e266dd42daa80.tar.gz
Remove special casing for running in the simulator from the kernel
and instead add platform, firmware and EFI stubs to the loader. The net effect of this change is that besides a special console and disk driver, the kernel has no knowledge of the simulator. This has the following advantages: o Simulator support is much harder to break, o It's easier to make use of more feature complete simulators. This would only need a change in the simulator specific loader, o Running SMP kernels within the simulator. Note that ski at this time does not simulate IPIs, so there's no way to start APs. The platform, firmware and EFI stubs describe the following hardware: o 4 CPU Itanium, o 128 MB RAM within the 4GB address space, o 64 MB RAM above the 4GB address space. NOTE: The stubs in the skiloader describe a machine that should in parts be defined by the simulator. Things like processor interrupt block and AP wakeup vector cannot be choosen at random because they require interpretation by the simulator. Currently the simulator is ignorant of this. This change introduces an unofficial SSC call SSC_SAL_SET_VECTORS which is ignored by the simulator. Tested with: ski (version 0.943 for linux)
Diffstat (limited to 'sys/ia64')
-rw-r--r--sys/ia64/conf/SKI70
-rw-r--r--sys/ia64/ia64/autoconf.c3
-rw-r--r--sys/ia64/ia64/efi.c62
-rw-r--r--sys/ia64/ia64/machdep.c67
-rw-r--r--sys/ia64/ia64/mca.c17
-rw-r--r--sys/ia64/ia64/pal.S15
-rw-r--r--sys/ia64/ia64/pal.s15
-rw-r--r--sys/ia64/ia64/pal_stub.s66
-rw-r--r--sys/ia64/ia64/pmap.c4
-rw-r--r--sys/ia64/ia64/sal.c2
-rw-r--r--sys/ia64/ia64/ski.c163
-rw-r--r--sys/ia64/ia64/ssc.c5
-rw-r--r--sys/ia64/ia64/sscdisk.c3
-rw-r--r--sys/ia64/include/md_var.h1
-rw-r--r--sys/ia64/include/sal.h1
15 files changed, 66 insertions, 428 deletions
diff --git a/sys/ia64/conf/SKI b/sys/ia64/conf/SKI
index 1b8f179..10443cd 100644
--- a/sys/ia64/conf/SKI
+++ b/sys/ia64/conf/SKI
@@ -25,59 +25,45 @@
machine ia64
cpu ITANIUM
ident SKI
-maxusers 32
-
-#To statically compile in device wiring instead of /boot/device.hints
-#hints "GENERIC.hints"
+maxusers 0
makeoptions DEBUG=-g #Build kernel with gdb(1) debug symbols
-makeoptions NO_CPU_COPTFLAGS=true #Ignore any x86 CPUTYPE
+makeoptions NO_MODULES=yes #Ignore any x86 CPUTYPE
-options SKI #Support for HP simulator
-options SCHED_4BSD #4BSD scheduler
-options INET #InterNETworking
-#options INET6 #IPv6 communications protocols
-options FFS #Berkeley Fast Filesystem
-options SOFTUPDATES #Enable FFS soft updates support
-options MD_ROOT #MD is a potential root device
-options PROCFS #Process filesystem (requires PSEUDOFS)
-options PSEUDOFS #Pseudo-filesystem framework
options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!]
options COMPAT_FREEBSD4
-options SCSI_DELAY=2000 #Delay (in ms) before probing SCSI
-options KTRACE #ktrace(1) syscall trace support
-options SYSVSHM #SYSV-style shared memory
-options SYSVMSG #SYSV-style message queues
-options SYSVSEM #SYSV-style semaphores
-options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
-options CONSPEED=115200
-options BREAK_TO_DEBUGGER #a BREAK on a comconsole goes to
-
-# Debugging for use in -current
options DDB
+options FFS #Berkeley Fast Filesystem
+options INET #InterNETworking
+options INET6 #IPv6 communications protocols
options INVARIANTS
options INVARIANT_SUPPORT
-options WITNESS
-
options KTR
-options KTR_ENTRIES=1024
+options KTRACE #ktrace(1) syscall trace support
options KTR_COMPILE="(KTR_INTR|KTR_PROC)"
-options KTR_MASK=0
options KTR_CPUMASK=0x3
-#options KTR_VERBOSE
+options KTR_ENTRIES=1024
+options KTR_MASK=0
+options KTR_VERBOSE
+options MD_ROOT #MD is a potential root device
+options PROCFS #Process filesystem (requires PSEUDOFS)
+options PSEUDOFS #Pseudo-filesystem framework
+options SCHED_4BSD #4BSD scheduler
+options SCSI_DELAY=500 #Delay (in ms) before probing SCSI
+options SKI
+options SOFTUPDATES #Enable FFS soft updates support
+options SYSVMSG #SYSV-style message queues
+options SYSVSEM #SYSV-style semaphores
+options SYSVSHM #SYSV-style shared memory
+options WITNESS
+options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions
-# Pseudo devices - the number indicates how many units to allocated.
-device random # Entropy device
-device loop # Network loopback
+device acpi
+device bpf # Berkeley packet filter
device ether # Ethernet support
-device sl # Kernel SLIP
-device ppp # Kernel PPP
-device tun # Packet tunnel.
-device pty # Pseudo-ttys (telnet etc)
+device loop # Network loopback
device md # Memory "disks"
-device gif # IPv6 and IPv4 tunneling
-device faith # IPv6-to-IPv4 relaying/(translation)
-
-# The `bpf' device enables the Berkeley Packet Filter.
-# Be aware of the administrative consequences of enabling this!
-device bpf #Berkeley packet filter
+device pci
+device pty # Pseudo-ttys (telnet etc)
+device random # Entropy device
+device tun # Packet tunnel.
diff --git a/sys/ia64/ia64/autoconf.c b/sys/ia64/ia64/autoconf.c
index c58f4f2..65da451 100644
--- a/sys/ia64/ia64/autoconf.c
+++ b/sys/ia64/ia64/autoconf.c
@@ -105,8 +105,7 @@ cpu_rootconf()
#endif
#ifdef BOOTP
- if (!ia64_running_in_simulator())
- bootpc_init();
+ bootpc_init();
#endif
#if defined(NFSCLIENT) && defined(NFS_ROOT)
#if !defined(BOOTP_NFSROOT)
diff --git a/sys/ia64/ia64/efi.c b/sys/ia64/ia64/efi.c
index ab6917c..a9a8fd2 100644
--- a/sys/ia64/ia64/efi.c
+++ b/sys/ia64/ia64/efi.c
@@ -40,35 +40,6 @@ u_int64_t ia64_efi_acpi20_table;
extern u_int64_t ia64_call_efi_physical(u_int64_t, u_int64_t, u_int64_t,
u_int64_t, u_int64_t, u_int64_t);
-static EFI_STATUS fake_efi_proc(void);
-
-static EFI_RUNTIME_SERVICES fake_efi = {
- { EFI_RUNTIME_SERVICES_SIGNATURE,
- EFI_RUNTIME_SERVICES_REVISION,
- 0, 0, 0 },
-
- (EFI_GET_TIME) fake_efi_proc,
- (EFI_SET_TIME) fake_efi_proc,
- (EFI_GET_WAKEUP_TIME) fake_efi_proc,
- (EFI_SET_WAKEUP_TIME) fake_efi_proc,
-
- (EFI_SET_VIRTUAL_ADDRESS_MAP) fake_efi_proc,
- (EFI_CONVERT_POINTER) fake_efi_proc,
-
- (EFI_GET_VARIABLE) fake_efi_proc,
- (EFI_GET_NEXT_VARIABLE_NAME) fake_efi_proc,
- (EFI_SET_VARIABLE) fake_efi_proc,
-
- (EFI_GET_NEXT_HIGH_MONO_COUNT) fake_efi_proc,
- (EFI_RESET_SYSTEM) fake_efi_proc
-};
-
-static EFI_STATUS
-fake_efi_proc(void)
-{
- return EFI_UNSUPPORTED;
-}
-
void
ia64_efi_init(void)
{
@@ -78,14 +49,25 @@ ia64_efi_init(void)
EFI_MEMORY_DESCRIPTOR *md, *mdp;
int mdcount, i;
EFI_STATUS status;
-
- ia64_efi_runtime = &fake_efi;
if (!bootinfo.bi_systab) {
printf("No system table!\n");
return;
}
+ ia64_efi_systab = (EFI_SYSTEM_TABLE *)
+ IA64_PHYS_TO_RR7(bootinfo.bi_systab);
+ rs = (EFI_RUNTIME_SERVICES *)
+ IA64_PHYS_TO_RR7((u_int64_t)ia64_efi_systab->RuntimeServices);
+ if (!rs)
+ panic("No runtime services!");
+
+ ia64_efi_runtime = rs;
+ conf = (EFI_CONFIGURATION_TABLE *)
+ IA64_PHYS_TO_RR7((u_int64_t)ia64_efi_systab->ConfigurationTable);
+ if (!conf)
+ panic("No configuration tables!");
+
mdcount = bootinfo.bi_memmap_size / bootinfo.bi_memdesc_size;
md = (EFI_MEMORY_DESCRIPTOR *) IA64_PHYS_TO_RR7(bootinfo.bi_memmap);
@@ -104,19 +86,9 @@ ia64_efi_init(void)
}
}
- ia64_efi_systab = (EFI_SYSTEM_TABLE *)
- IA64_PHYS_TO_RR7(bootinfo.bi_systab);
-
- rs = (EFI_RUNTIME_SERVICES *)
- IA64_PHYS_TO_RR7((u_int64_t) ia64_efi_systab->RuntimeServices);
- ia64_efi_runtime = rs;
-
- status = ia64_call_efi_physical
- ((u_int64_t) rs->SetVirtualAddressMap,
- bootinfo.bi_memmap_size,
- bootinfo.bi_memdesc_size,
- bootinfo.bi_memdesc_version,
- bootinfo.bi_memmap, 0);
+ status = ia64_call_efi_physical((u_int64_t)rs->SetVirtualAddressMap,
+ bootinfo.bi_memmap_size, bootinfo.bi_memdesc_size,
+ bootinfo.bi_memdesc_version, bootinfo.bi_memmap, 0);
if (EFI_ERROR(status)) {
/*
@@ -126,8 +98,6 @@ ia64_efi_init(void)
panic("Can't set firmware into virtual mode");
}
- conf = (EFI_CONFIGURATION_TABLE *)
- IA64_PHYS_TO_RR7((u_int64_t) ia64_efi_systab->ConfigurationTable);
for (i = 0; i < ia64_efi_systab->NumberOfTableEntries; i++) {
static EFI_GUID sal = SAL_SYSTEM_TABLE_GUID;
static EFI_GUID acpi = ACPI_TABLE_GUID;
diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c
index 02ab39d..8de0d9c 100644
--- a/sys/ia64/ia64/machdep.c
+++ b/sys/ia64/ia64/machdep.c
@@ -28,14 +28,9 @@
#include "opt_compat.h"
#include "opt_ddb.h"
-#include "opt_ski.h"
#include "opt_msgbuf.h"
#include "opt_acpi.h"
-#if !defined(SKI) && !defined(DEV_ACPI)
-#error "You need the SKI option and/or the acpi device"
-#endif
-
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/eventhandler.h>
@@ -92,10 +87,6 @@
#include <machine/unwind.h>
#include <i386/include/specialreg.h>
-#ifdef SKI
-extern void ia64_ski_init(void);
-#endif
-
u_int64_t processor_frequency;
u_int64_t bus_frequency;
u_int64_t itc_frequency;
@@ -104,6 +95,7 @@ int cold = 1;
u_int64_t pa_bootinfo;
struct bootinfo bootinfo;
+struct pcpu early_pcpu;
extern char kstack[];
struct user *proc0uarea;
vm_offset_t proc0kstack;
@@ -205,21 +197,12 @@ cpu_startup(dummy)
bufinit();
vm_pager_bufferinit();
- if (!ia64_running_in_simulator()) {
-#ifdef DEV_ACPI
- /*
- * Traverse the MADT to discover IOSAPIC and Local SAPIC
- * information.
- */
- ia64_probe_sapics();
- ia64_mca_init();
-#else
- /*
- * It is an error to boot a SKI-only kernel on hardware.
- */
- panic("Mandatory 'device acpi' is missing");
-#endif
- }
+ /*
+ * Traverse the MADT to discover IOSAPIC and Local SAPIC
+ * information.
+ */
+ ia64_probe_sapics();
+ ia64_mca_init();
}
void
@@ -411,30 +394,6 @@ ia64_init(u_int64_t arg1, u_int64_t arg2)
*/
mdcount = bootinfo.bi_memmap_size / bootinfo.bi_memdesc_size;
md = (EFI_MEMORY_DESCRIPTOR *) IA64_PHYS_TO_RR7(bootinfo.bi_memmap);
- if (md == NULL || mdcount == 0) {
-#ifdef SKI
- static EFI_MEMORY_DESCRIPTOR ski_md[2];
- /*
- * XXX hack for ski. In reality, the loader will probably ask
- * EFI and pass the results to us. Possibly, we will call EFI
- * directly.
- */
- ski_md[0].Type = EfiConventionalMemory;
- ski_md[0].PhysicalStart = 2L*1024*1024;
- ski_md[0].VirtualStart = 0;
- ski_md[0].NumberOfPages = (64L*1024*1024)>>12;
- ski_md[0].Attribute = EFI_MEMORY_WB;
-
- ski_md[1].Type = EfiMemoryMappedIOPortSpace;
- ski_md[1].PhysicalStart = 0xffffc000000;
- ski_md[1].VirtualStart = 0;
- ski_md[1].NumberOfPages = (64L*1024*1024)>>12;
- ski_md[1].Attribute = EFI_MEMORY_UC;
-
- md = ski_md;
- mdcount = 2;
-#endif
- }
for (i = 0, mdp = md; i < mdcount; i++,
mdp = NextMemoryDescriptor(mdp, bootinfo.bi_memdesc_size)) {
@@ -444,9 +403,6 @@ ia64_init(u_int64_t arg1, u_int64_t arg2)
ia64_pal_base = mdp->PhysicalStart;
}
- /* Map the memory mapped I/O Port space */
- KASSERT(ia64_port_base != 0,
- ("%s: no I/O port memory region", __func__));
map_port_space();
metadata_missing = 0;
@@ -503,9 +459,6 @@ ia64_init(u_int64_t arg1, u_int64_t arg2)
*/
map_pal_code();
ia64_efi_init();
-#ifdef SKI
- ia64_ski_init();
-#endif
calculate_frequencies();
/*
@@ -734,12 +687,6 @@ ia64_init(u_int64_t arg1, u_int64_t arg2)
ia64_set_tpr(0);
}
-int
-ia64_running_in_simulator()
-{
- return bootinfo.bi_systab == 0;
-}
-
void
bzero(void *buf, size_t len)
{
diff --git a/sys/ia64/ia64/mca.c b/sys/ia64/ia64/mca.c
index ca24cab..4109e3d 100644
--- a/sys/ia64/ia64/mca.c
+++ b/sys/ia64/ia64/mca.c
@@ -198,14 +198,15 @@ ia64_mca_init(void)
}
max_size = round_page(max_size);
- p = contigmalloc(max_size, M_TEMP, 0, 0ul, 256*1024*1024 - 1,
- PAGE_SIZE, 256*1024*1024);
-
- mca_info_block = IA64_PHYS_TO_RR7(ia64_tpa((u_int64_t)p));
-
- if (bootverbose)
- printf("MCA: allocated %ld bytes for state information\n",
- max_size);
+ if (max_size) {
+ p = contigmalloc(max_size, M_TEMP, 0, 0ul, 256*1024*1024 - 1,
+ PAGE_SIZE, 256*1024*1024);
+ mca_info_block = IA64_PHYS_TO_RR7(ia64_tpa((u_int64_t)p));
+
+ if (bootverbose)
+ printf("MCA: allocated %ld bytes for state info.\n",
+ max_size);
+ }
/*
* Initialize the spin lock used to protect the info block. When APs
diff --git a/sys/ia64/ia64/pal.S b/sys/ia64/ia64/pal.S
index 4c5abe5..eca57ac 100644
--- a/sys/ia64/ia64/pal.S
+++ b/sys/ia64/ia64/pal.S
@@ -30,23 +30,10 @@
.data
.global ia64_pal_entry
-ia64_pal_entry: .quad ia64_call_pal_stub
+ia64_pal_entry: .quad 0
.text
/*
- * Stub for running in simulation.
- */
-ENTRY(ia64_call_pal_stub, 0)
-
- mov r8=-3
- tbit.nz p6,p7=r28,8 // static or stacked?
- ;;
-(p6) br.ret.sptk.few rp
-(p7) br.cond.sptk.few rp
-
-END(ia64_call_pal_stub)
-
-/*
* struct ia64_pal_result ia64_call_pal_static(u_int64_t proc,
* u_int64_t arg1, u_int64_t arg2, u_int64_t arg3)
*/
diff --git a/sys/ia64/ia64/pal.s b/sys/ia64/ia64/pal.s
index 4c5abe5..eca57ac 100644
--- a/sys/ia64/ia64/pal.s
+++ b/sys/ia64/ia64/pal.s
@@ -30,23 +30,10 @@
.data
.global ia64_pal_entry
-ia64_pal_entry: .quad ia64_call_pal_stub
+ia64_pal_entry: .quad 0
.text
/*
- * Stub for running in simulation.
- */
-ENTRY(ia64_call_pal_stub, 0)
-
- mov r8=-3
- tbit.nz p6,p7=r28,8 // static or stacked?
- ;;
-(p6) br.ret.sptk.few rp
-(p7) br.cond.sptk.few rp
-
-END(ia64_call_pal_stub)
-
-/*
* struct ia64_pal_result ia64_call_pal_static(u_int64_t proc,
* u_int64_t arg1, u_int64_t arg2, u_int64_t arg3)
*/
diff --git a/sys/ia64/ia64/pal_stub.s b/sys/ia64/ia64/pal_stub.s
deleted file mode 100644
index b91d02c..0000000
--- a/sys/ia64/ia64/pal_stub.s
+++ /dev/null
@@ -1,66 +0,0 @@
-/*-
- * Copyright (c) 2001 Doug Rabson
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-#include <machine/asm.h>
-#include <assym.s>
-
-/*
- * Stub for running in simulation. Fakes the values from an SDV.
- */
-ENTRY(ski_fake_pal, 0)
-
- mov r8=-3 // default to return error
-
- cmp.eq p6,p0=PAL_PTCE_INFO,r28
- ;;
-(p6) mov r8=0
-(p6) mov r9=0
-(p6) movl r10=0x100000001
-(p6) mov r11=0
- ;;
- cmp.eq p6,p0=PAL_FREQ_RATIOS,r28
- ;;
-(p6) mov r8=0
-(p6) movl r9=0xb00000002 // proc 11/1
-(p6) movl r10=0x100000001 // bus 1/1
-(p6) movl r11=0xb00000002 // itc 11/1
- mov r14=PAL_VM_SUMMARY
- ;;
- cmp.eq p6,p0=r14,r28
- ;;
-(p6) mov r8=0
-(p6) movl r9=(8<<40)|(8<<32)
-(p6) movl r10=(18<<8)|(41<<0)
-(p6) mov r11=0
- ;;
- tbit.nz p6,p7=r28,8 // static or stacked?
- ;;
-(p6) br.ret.sptk.few rp
-(p7) br.cond.sptk.few rp
-
-END(ski_fake_pal)
diff --git a/sys/ia64/ia64/pmap.c b/sys/ia64/ia64/pmap.c
index ac5c4cf..cb3d1d3 100644
--- a/sys/ia64/ia64/pmap.c
+++ b/sys/ia64/ia64/pmap.c
@@ -207,9 +207,7 @@ static struct ia64_lpte **kptdir;
vm_offset_t kernel_vm_end;
-/*
- * Values for ptc.e. XXX values for SKI.
- */
+/* Values for ptc.e. XXX values for SKI. */
static u_int64_t pmap_ptc_e_base = 0x100000000;
static u_int64_t pmap_ptc_e_count1 = 3;
static u_int64_t pmap_ptc_e_count2 = 2;
diff --git a/sys/ia64/ia64/sal.c b/sys/ia64/ia64/sal.c
index f16d796..24ae989 100644
--- a/sys/ia64/ia64/sal.c
+++ b/sys/ia64/ia64/sal.c
@@ -85,7 +85,7 @@ ia64_sal_init(struct sal_system_table *saltab)
u_int8_t *p;
int i;
- if (memcmp(saltab->sal_signature, "SST_", 4)) {
+ if (memcmp(saltab->sal_signature, SAL_SIGNATURE, 4)) {
printf("Bad signature for SAL System Table\n");
return;
}
diff --git a/sys/ia64/ia64/ski.c b/sys/ia64/ia64/ski.c
deleted file mode 100644
index a387000..0000000
--- a/sys/ia64/ia64/ski.c
+++ /dev/null
@@ -1,163 +0,0 @@
-/*-
- * Copyright (c) 2001 Doug Rabson
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-/*
- * Fake out bits of EFI and SAL when running under SKI.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <machine/efi.h>
-#include <machine/sal.h>
-#include <machine/md_var.h>
-
-struct ssc_time {
- int year;
- int month;
- int day;
- int hour;
- int minute;
- int second;
- int msec;
- int wday;
-};
-
-#define SSC_GET_RTC 65
-
-static u_int64_t
-ssc(u_int64_t in0, u_int64_t in1, u_int64_t in2, u_int64_t in3, int which)
-{
- register u_int64_t ret0 __asm("r8");
-
- __asm __volatile("mov r15=%1\n\t"
- "break 0x80001"
- : "=r"(ret0)
- : "r"(which), "r"(in0), "r"(in1), "r"(in2), "r"(in3));
-
- /*
- * Ugh... Work around a bug in the Linux version of ski for
- * SSC_GET_RTC. The PSR.dt register is not preserved properly
- * and causes further memory references to be done without
- * translation. All we need to do is set PSR.dt again. Note
- * that dependency violations do not exist in ski, so we
- * don't have to serialize.
- */
- __asm __volatile("ssm psr.dt");
-
- return ret0;
-}
-
-extern u_int64_t ski_fake_pal[]; /* *not* a function decl */
-extern void ia64_ski_init(void);
-extern u_int64_t ia64_pal_entry;
-
-static EFI_STATUS ski_fake_efi_proc(void);
-static EFI_STATUS ski_fake_efi_get_time(EFI_TIME *time,
- EFI_TIME_CAPABILITIES *caps);
-
-static EFI_RUNTIME_SERVICES ski_fake_efi = {
- { EFI_RUNTIME_SERVICES_SIGNATURE,
- EFI_RUNTIME_SERVICES_REVISION,
- 0, 0, 0 },
-
- (EFI_GET_TIME) ski_fake_efi_get_time,
- (EFI_SET_TIME) ski_fake_efi_proc,
- (EFI_GET_WAKEUP_TIME) ski_fake_efi_proc,
- (EFI_SET_WAKEUP_TIME) ski_fake_efi_proc,
-
- (EFI_SET_VIRTUAL_ADDRESS_MAP) ski_fake_efi_proc,
- (EFI_CONVERT_POINTER) ski_fake_efi_proc,
-
- (EFI_GET_VARIABLE) ski_fake_efi_proc,
- (EFI_GET_NEXT_VARIABLE_NAME) ski_fake_efi_proc,
- (EFI_SET_VARIABLE) ski_fake_efi_proc,
-
- (EFI_GET_NEXT_HIGH_MONO_COUNT) ski_fake_efi_proc,
- (EFI_RESET_SYSTEM) ski_fake_efi_proc
-};
-
-static EFI_STATUS
-ski_fake_efi_get_time(EFI_TIME *time, EFI_TIME_CAPABILITIES *caps)
-{
- struct ssc_time ssctime;
-
- ssc(ia64_tpa((vm_offset_t) &ssctime), 0, 0, 0, SSC_GET_RTC);
-
- time->Second = ssctime.second;
- time->Minute = ssctime.minute;
- time->Hour = ssctime.hour;
- time->Day = ssctime.day;
- time->Month = ssctime.month + 1;
- time->Year = ssctime.year + 1900;
-
- return EFI_SUCCESS;
-}
-
-static EFI_STATUS
-ski_fake_efi_proc(void)
-{
- return EFI_UNSUPPORTED;
-}
-
-static struct ia64_sal_result
-ski_fake_sal(u_int64_t a1, u_int64_t a2, u_int64_t a3, u_int64_t a4,
- u_int64_t a5, u_int64_t a6, u_int64_t a7, u_int64_t a8)
-{
- struct ia64_sal_result res;
-
- if (a1 == SAL_FREQ_BASE) {
- /*
- * Fake the values from my SDV.
- */
- res.sal_status = 0;
- res.sal_result[0] = 133347096;
- res.sal_result[1] = 0;
- res.sal_result[2] = 0;
- return res;
- }
-
- /*
- * Return an error for anything we don't care about.
- */
- res.sal_status = -3;
- res.sal_result[0] = 0;
- res.sal_result[1] = 0;
- res.sal_result[2] = 0;
- return res;
-}
-
-void
-ia64_ski_init(void)
-{
- if (!ia64_running_in_simulator())
- return;
-
- ia64_efi_runtime = &ski_fake_efi;
- ia64_pal_entry = (u_int64_t) ski_fake_pal;
- ia64_sal_entry = ski_fake_sal;
-}
diff --git a/sys/ia64/ia64/ssc.c b/sys/ia64/ia64/ssc.c
index a18eae9..6c3cb35 100644
--- a/sys/ia64/ia64/ssc.c
+++ b/sys/ia64/ia64/ssc.c
@@ -99,9 +99,6 @@ ssc(u_int64_t in0, u_int64_t in1, u_int64_t in2, u_int64_t in3, int which)
static void
ssccnprobe(struct consdev *cp)
{
- if (!ia64_running_in_simulator())
- return;
-
cp->cn_dev = makedev(CDEV_MAJOR, 0);
cp->cn_pri = CN_INTERNAL;
}
@@ -114,8 +111,6 @@ ssccninit(struct consdev *cp)
static void
ssccnattach(void *arg)
{
- if (!ia64_running_in_simulator())
- return;
make_dev(&ssc_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "ssccons");
}
SYSINIT(ssccnattach, SI_SUB_DRIVERS, SI_ORDER_ANY, ssccnattach, 0);
diff --git a/sys/ia64/ia64/sscdisk.c b/sys/ia64/ia64/sscdisk.c
index c4d5195..561ffc5 100644
--- a/sys/ia64/ia64/sscdisk.c
+++ b/sys/ia64/ia64/sscdisk.c
@@ -288,9 +288,6 @@ ssc_clone (void *arg, char *name, int namelen, dev_t *dev)
static void
ssc_drvinit(void *unused)
{
- if (!ia64_running_in_simulator())
- return;
-
ssccreate(-1);
}
diff --git a/sys/ia64/include/md_var.h b/sys/ia64/include/md_var.h
index 706294f..38d98de 100644
--- a/sys/ia64/include/md_var.h
+++ b/sys/ia64/include/md_var.h
@@ -53,7 +53,6 @@ struct ia64_fdesc {
void busdma_swi(void);
void cpu_halt(void);
void cpu_reset(void);
-int ia64_running_in_simulator(void);
int is_physical_memory(vm_offset_t addr);
void os_boot_rendez(void);
void os_mca(void);
diff --git a/sys/ia64/include/sal.h b/sys/ia64/include/sal.h
index 40940f5..abe7c1f 100644
--- a/sys/ia64/include/sal.h
+++ b/sys/ia64/include/sal.h
@@ -31,6 +31,7 @@
struct sal_system_table {
char sal_signature[4];
+#define SAL_SIGNATURE "SST_"
u_int32_t sal_length;
u_int8_t sal_rev[2];
u_int16_t sal_entry_count;
OpenPOWER on IntegriCloud