summaryrefslogtreecommitdiffstats
path: root/sys/boot
diff options
context:
space:
mode:
Diffstat (limited to 'sys/boot')
-rw-r--r--sys/boot/Makefile.ia644
-rw-r--r--sys/boot/common/Makefile.inc2
-rw-r--r--sys/boot/efi/include/amd64/pe.h1
-rw-r--r--sys/boot/efi/include/efiapi.h4
-rw-r--r--sys/boot/efi/include/i386/pe.h1
-rw-r--r--sys/boot/efi/include/ia64/efibind.h219
-rw-r--r--sys/boot/efi/include/ia64/pe.h637
-rw-r--r--sys/boot/ficl/ia64/sysdep.c101
-rw-r--r--sys/boot/ficl/ia64/sysdep.h434
-rw-r--r--sys/boot/ficl/loader.c6
-rw-r--r--sys/boot/ia64/Makefile10
-rw-r--r--sys/boot/ia64/Makefile.inc9
-rw-r--r--sys/boot/ia64/common/Makefile47
-rw-r--r--sys/boot/ia64/common/autoload.c35
-rw-r--r--sys/boot/ia64/common/bootinfo.c296
-rw-r--r--sys/boot/ia64/common/copy.c217
-rw-r--r--sys/boot/ia64/common/devicename.c169
-rw-r--r--sys/boot/ia64/common/exec.c268
-rw-r--r--sys/boot/ia64/common/icache.c51
-rw-r--r--sys/boot/ia64/common/libia64.h75
-rw-r--r--sys/boot/ia64/efi/Makefile59
-rw-r--r--sys/boot/ia64/efi/conf.c82
-rw-r--r--sys/boot/ia64/efi/efimd.c264
-rw-r--r--sys/boot/ia64/efi/ldscript.ia6473
-rw-r--r--sys/boot/ia64/efi/main.c618
-rw-r--r--sys/boot/ia64/efi/start.S290
-rw-r--r--sys/boot/ia64/efi/version27
-rw-r--r--sys/boot/ia64/ski/Makefile39
-rw-r--r--sys/boot/ia64/ski/acpi_stub.c183
-rw-r--r--sys/boot/ia64/ski/conf.c74
-rw-r--r--sys/boot/ia64/ski/delay.c34
-rw-r--r--sys/boot/ia64/ski/efi_stub.c259
-rw-r--r--sys/boot/ia64/ski/exit.c42
-rw-r--r--sys/boot/ia64/ski/ldscript.ia6461
-rw-r--r--sys/boot/ia64/ski/libski.h65
-rw-r--r--sys/boot/ia64/ski/main.c121
-rw-r--r--sys/boot/ia64/ski/pal_stub.S74
-rw-r--r--sys/boot/ia64/ski/sal_stub.c118
-rw-r--r--sys/boot/ia64/ski/skiconsole.c96
-rw-r--r--sys/boot/ia64/ski/skifs.c194
-rw-r--r--sys/boot/ia64/ski/skiload.cmd16
-rw-r--r--sys/boot/ia64/ski/skimd.c82
-rw-r--r--sys/boot/ia64/ski/ssc.c53
-rw-r--r--sys/boot/ia64/ski/start.S62
-rw-r--r--sys/boot/ia64/ski/time.c174
-rw-r--r--sys/boot/ia64/ski/version12
-rw-r--r--sys/boot/libstand32/Makefile13
-rw-r--r--sys/boot/userboot/libstand/Makefile12
48 files changed, 0 insertions, 5783 deletions
diff --git a/sys/boot/Makefile.ia64 b/sys/boot/Makefile.ia64
deleted file mode 100644
index 256201d..0000000
--- a/sys/boot/Makefile.ia64
+++ /dev/null
@@ -1,4 +0,0 @@
-# $FreeBSD$
-
-SUBDIR+= efi
-SUBDIR+= zfs
diff --git a/sys/boot/common/Makefile.inc b/sys/boot/common/Makefile.inc
index 2a4d561..5aae7548 100644
--- a/sys/boot/common/Makefile.inc
+++ b/sys/boot/common/Makefile.inc
@@ -7,8 +7,6 @@ SRCS+= module.c panic.c
.if ${MACHINE} == "i386" || ${MACHINE_CPUARCH} == "amd64"
SRCS+= load_elf32.c load_elf32_obj.c reloc_elf32.c
SRCS+= load_elf64.c load_elf64_obj.c reloc_elf64.c
-.elif ${MACHINE_CPUARCH} == "ia64"
-SRCS+= load_elf64.c load_elf64_obj.c reloc_elf64.c
.elif ${MACHINE} == "pc98"
SRCS+= load_elf32.c load_elf32_obj.c reloc_elf32.c
.elif ${MACHINE_CPUARCH} == "arm"
diff --git a/sys/boot/efi/include/amd64/pe.h b/sys/boot/efi/include/amd64/pe.h
index 1120464..f8033c5 100644
--- a/sys/boot/efi/include/amd64/pe.h
+++ b/sys/boot/efi/include/amd64/pe.h
@@ -498,7 +498,6 @@ typedef struct _IMAGE_BASE_RELOCATION {
#define IMAGE_REL_BASED_HIGHLOW 3
#define IMAGE_REL_BASED_HIGHADJ 4
#define IMAGE_REL_BASED_MIPS_JMPADDR 5
-#define IMAGE_REL_BASED_IA64_IMM64 9
#define IMAGE_REL_BASED_DIR64 10
//
diff --git a/sys/boot/efi/include/efiapi.h b/sys/boot/efi/include/efiapi.h
index 187fe29..b955338 100644
--- a/sys/boot/efi/include/efiapi.h
+++ b/sys/boot/efi/include/efiapi.h
@@ -314,10 +314,6 @@ EFI_STATUS
#define EFI_IMAGE_MACHINE_IA32 0x014c
#endif
-#if !defined(EFI_IMAGE_MACHINE_IA64)
-#define EFI_IMAGE_MACHINE_IA64 0x0200
-#endif
-
#if !defined(EFI_IMAGE_MACHINE_EBC)
#define EFI_IMAGE_MACHINE_EBC 0x0EBC
#endif
diff --git a/sys/boot/efi/include/i386/pe.h b/sys/boot/efi/include/i386/pe.h
index 0381a44..e2ae25c 100644
--- a/sys/boot/efi/include/i386/pe.h
+++ b/sys/boot/efi/include/i386/pe.h
@@ -498,7 +498,6 @@ typedef struct _IMAGE_BASE_RELOCATION {
#define IMAGE_REL_BASED_HIGHLOW 3
#define IMAGE_REL_BASED_HIGHADJ 4
#define IMAGE_REL_BASED_MIPS_JMPADDR 5
-#define IMAGE_REL_BASED_IA64_IMM64 9
#define IMAGE_REL_BASED_DIR64 10
//
diff --git a/sys/boot/efi/include/ia64/efibind.h b/sys/boot/efi/include/ia64/efibind.h
deleted file mode 100644
index 21f0d25..0000000
--- a/sys/boot/efi/include/ia64/efibind.h
+++ /dev/null
@@ -1,219 +0,0 @@
-/* $FreeBSD$ */
-/*++
-
-Copyright (c) 1999 - 2003 Intel Corporation. All rights reserved
-This software and associated documentation (if any) is furnished
-under a license and may only be used or copied in accordance
-with the terms of the license. Except as permitted by such
-license, no part of this software or documentation may be
-reproduced, stored in a retrieval system, or transmitted in any
-form or by any means without the express written consent of
-Intel Corporation.
-
-Module Name:
-
- efefind.h
-
-Abstract:
-
- EFI to compile bindings
-
-
-
-
-Revision History
-
---*/
-
-#pragma pack()
-
-
-#ifdef __FreeBSD__
-#include <sys/stdint.h>
-#else
-//
-// Basic int types of various widths
-//
-
-#if (__STDC_VERSION__ < 199901L )
-
- // No ANSI C 1999/2000 stdint.h integer width declarations
-
- #if _MSC_EXTENSIONS
-
- // Use Microsoft C compiler integer width declarations
-
- typedef unsigned __int64 uint64_t;
- typedef __int64 int64_t;
- typedef unsigned __int32 uint32_t;
- typedef __int32 int32_t;
- typedef unsigned __int16 uint16_t;
- typedef __int16 int16_t;
- typedef unsigned __int8 uint8_t;
- typedef __int8 int8_t;
- #else
- #ifdef UNIX_LP64
-
- // Use LP64 programming model from C_FLAGS for integer width declarations
-
- typedef unsigned long uint64_t;
- typedef long int64_t;
- typedef unsigned int uint32_t;
- typedef int int32_t;
- typedef unsigned short uint16_t;
- typedef short int16_t;
- typedef unsigned char uint8_t;
- typedef char int8_t;
- #else
-
- // Assume P64 programming model from C_FLAGS for integer width declarations
-
- typedef unsigned long long uint64_t;
- typedef long long int64_t;
- typedef unsigned int uint32_t;
- typedef int int32_t;
- typedef unsigned short uint16_t;
- typedef short int16_t;
- typedef unsigned char uint8_t;
- typedef char int8_t;
- #endif
- #endif
-#endif
-#endif /* __FreeBSD__ */
-
-//
-// Basic EFI types of various widths
-//
-
-
-typedef uint64_t UINT64;
-typedef int64_t INT64;
-typedef uint32_t UINT32;
-typedef int32_t INT32;
-typedef uint16_t UINT16;
-typedef int16_t INT16;
-typedef uint8_t UINT8;
-typedef int8_t INT8;
-
-
-#undef VOID
-#define VOID void
-
-
-typedef int64_t INTN;
-typedef uint64_t UINTN;
-
-//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-// BugBug: Code to debug
-//
-#define BIT63 0x8000000000000000
-
-#define PLATFORM_IOBASE_ADDRESS (0xffffc000000 | BIT63)
-#define PORT_TO_MEMD(_Port) (PLATFORM_IOBASE_ADDRESS | ( ( ( (_Port) & 0xfffc) << 10 ) | ( (_Port) & 0x0fff) ) )
-
-//
-// Macro's with casts make this much easier to use and read.
-//
-#define PORT_TO_MEM8D(_Port) (*(UINT8 *)(PORT_TO_MEMD(_Port)))
-#define POST_CODE(_Data) (PORT_TO_MEM8D(0x80) = (_Data))
-//
-// BugBug: End Debug Code!!!
-//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
-#define EFIERR(a) (0x8000000000000000 | a)
-#define EFI_ERROR_MASK 0x8000000000000000
-#define EFIERR_OEM(a) (0xc000000000000000 | a)
-
-#define BAD_POINTER 0xFBFBFBFBFBFBFBFB
-#define MAX_ADDRESS 0xFFFFFFFFFFFFFFFF
-
-#pragma intrinsic (__break)
-#define BREAKPOINT() __break(0)
-
-//
-// Pointers must be aligned to these address to function
-// you will get an alignment fault if this value is less than 8
-//
-#define MIN_ALIGNMENT_SIZE 8
-
-#define ALIGN_VARIABLE(Value , Adjustment) \
- (UINTN) Adjustment = 0; \
- if((UINTN)Value % MIN_ALIGNMENT_SIZE) \
- (UINTN)Adjustment = MIN_ALIGNMENT_SIZE - ((UINTN)Value % MIN_ALIGNMENT_SIZE); \
- Value = (UINTN)Value + (UINTN)Adjustment
-
-//
-// Define macros to create data structure signatures.
-//
-
-#define EFI_SIGNATURE_16(A,B) ((A) | (B<<8))
-#define EFI_SIGNATURE_32(A,B,C,D) (EFI_SIGNATURE_16(A,B) | (EFI_SIGNATURE_16(C,D) << 16))
-#define EFI_SIGNATURE_64(A,B,C,D,E,F,G,H) (EFI_SIGNATURE_32(A,B,C,D) | ((UINT64)(EFI_SIGNATURE_32(E,F,G,H)) << 32))
-
-//
-// EFIAPI - prototype calling convention for EFI function pointers
-// BOOTSERVICE - prototype for implementation of a boot service interface
-// RUNTIMESERVICE - prototype for implementation of a runtime service interface
-// RUNTIMEFUNCTION - prototype for implementation of a runtime function that is not a service
-// RUNTIME_CODE - pragma macro for declaring runtime code
-//
-
-#ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options
- #if _MSC_EXTENSIONS
- #define EFIAPI __cdecl // Force C calling convention for Microsoft C compiler
- #else
- #define EFIAPI // Substitute expresion to force C calling convention
- #endif
-#endif
-
-#define BOOTSERVICE
-#define RUNTIMESERVICE
-#define RUNTIMEFUNCTION
-
-#define RUNTIME_CODE(a) alloc_text("rtcode", a)
-#define BEGIN_RUNTIME_DATA() data_seg("rtdata")
-#define END_RUNTIME_DATA() data_seg()
-
-#define VOLATILE volatile
-
-//
-// BugBug: Need to find out if this is portable accross compliers.
-//
-void __mfa (void);
-#pragma intrinsic (__mfa)
-#define MEMORY_FENCE() __mfa()
-
-#ifdef EFI_NO_INTERFACE_DECL
- #define EFI_FORWARD_DECLARATION(x)
- #define EFI_INTERFACE_DECL(x)
-#else
- #define EFI_FORWARD_DECLARATION(x) typedef struct _##x x
- #define EFI_INTERFACE_DECL(x) typedef struct x
-#endif
-
-//
-// When build similiar to FW, then link everything together as
-// one big module.
-//
-
-#define EFI_DRIVER_ENTRY_POINT(InitFunction)
-
-#define LOAD_INTERNAL_DRIVER(_if, type, name, entry) \
- (_if)->LoadInternal(type, name, entry)
-// entry(NULL, ST)
-
-#ifdef __FreeBSD__
-#define INTERFACE_DECL(x) struct x
-#else
-//
-// Some compilers don't support the forward reference construct:
-// typedef struct XXXXX
-//
-// The following macro provide a workaround for such cases.
-//
-#ifdef NO_INTERFACE_DECL
-#define INTERFACE_DECL(x)
-#else
-#define INTERFACE_DECL(x) typedef struct x
-#endif
-#endif
diff --git a/sys/boot/efi/include/ia64/pe.h b/sys/boot/efi/include/ia64/pe.h
deleted file mode 100644
index 24480a5..0000000
--- a/sys/boot/efi/include/ia64/pe.h
+++ /dev/null
@@ -1,637 +0,0 @@
-/* $FreeBSD$ */
-/*
- PE32+ header file
- */
-#ifndef _PE_H
-#define _PE_H
-
-#define IMAGE_DOS_SIGNATURE 0x5A4D // MZ
-#define IMAGE_OS2_SIGNATURE 0x454E // NE
-#define IMAGE_OS2_SIGNATURE_LE 0x454C // LE
-#define IMAGE_NT_SIGNATURE 0x00004550 // PE00
-#define IMAGE_EDOS_SIGNATURE 0x44454550 // PEED
-
-/*****************************************************************************
- * The following stuff comes from winnt.h from the ia64sdk, plus the Plabel for
- * loading EM executables.
- *****************************************************************************/
-//
-// Intel IA64 specific
-//
-
-#define IMAGE_REL_BASED_IA64_IMM64 9
-#define IMAGE_REL_BASED_IA64_DIR64 10
-
-struct Plabel {
- UINT64 EntryPoint;
- UINT64 NewGP;
-};
-
-typedef struct _IMAGE_DOS_HEADER { // DOS .EXE header
- UINT16 e_magic; // Magic number
- UINT16 e_cblp; // Bytes on last page of file
- UINT16 e_cp; // Pages in file
- UINT16 e_crlc; // Relocations
- UINT16 e_cparhdr; // Size of header in paragraphs
- UINT16 e_minalloc; // Minimum extra paragraphs needed
- UINT16 e_maxalloc; // Maximum extra paragraphs needed
- UINT16 e_ss; // Initial (relative) SS value
- UINT16 e_sp; // Initial SP value
- UINT16 e_csum; // Checksum
- UINT16 e_ip; // Initial IP value
- UINT16 e_cs; // Initial (relative) CS value
- UINT16 e_lfarlc; // File address of relocation table
- UINT16 e_ovno; // Overlay number
- UINT16 e_res[4]; // Reserved words
- UINT16 e_oemid; // OEM identifier (for e_oeminfo)
- UINT16 e_oeminfo; // OEM information; e_oemid specific
- UINT16 e_res2[10]; // Reserved words
- UINT32 e_lfanew; // File address of new exe header
- } IMAGE_DOS_HEADER, *PIMAGE_DOS_HEADER;
-
-typedef struct _IMAGE_OS2_HEADER { // OS/2 .EXE header
- UINT16 ne_magic; // Magic number
- UINT8 ne_ver; // Version number
- UINT8 ne_rev; // Revision number
- UINT16 ne_enttab; // Offset of Entry Table
- UINT16 ne_cbenttab; // Number of bytes in Entry Table
- UINT32 ne_crc; // Checksum of whole file
- UINT16 ne_flags; // Flag UINT16
- UINT16 ne_autodata; // Automatic data segment number
- UINT16 ne_heap; // Initial heap allocation
- UINT16 ne_stack; // Initial stack allocation
- UINT32 ne_csip; // Initial CS:IP setting
- UINT32 ne_sssp; // Initial SS:SP setting
- UINT16 ne_cseg; // Count of file segments
- UINT16 ne_cmod; // Entries in Module Reference Table
- UINT16 ne_cbnrestab; // Size of non-resident name table
- UINT16 ne_segtab; // Offset of Segment Table
- UINT16 ne_rsrctab; // Offset of Resource Table
- UINT16 ne_restab; // Offset of resident name table
- UINT16 ne_modtab; // Offset of Module Reference Table
- UINT16 ne_imptab; // Offset of Imported Names Table
- UINT32 ne_nrestab; // Offset of Non-resident Names Table
- UINT16 ne_cmovent; // Count of movable entries
- UINT16 ne_align; // Segment alignment shift count
- UINT16 ne_cres; // Count of resource segments
- UINT8 ne_exetyp; // Target Operating system
- UINT8 ne_flagsothers; // Other .EXE flags
- UINT16 ne_pretthunks; // offset to return thunks
- UINT16 ne_psegrefbytes; // offset to segment ref. bytes
- UINT16 ne_swaparea; // Minimum code swap area size
- UINT16 ne_expver; // Expected Windows version number
- } IMAGE_OS2_HEADER, *PIMAGE_OS2_HEADER;
-
-//
-// File header format.
-//
-
-typedef struct _IMAGE_FILE_HEADER {
- UINT16 Machine;
- UINT16 NumberOfSections;
- UINT32 TimeDateStamp;
- UINT32 PointerToSymbolTable;
- UINT32 NumberOfSymbols;
- UINT16 SizeOfOptionalHeader;
- UINT16 Characteristics;
-} IMAGE_FILE_HEADER, *PIMAGE_FILE_HEADER;
-
-#define IMAGE_SIZEOF_FILE_HEADER 20
-
-#define IMAGE_FILE_RELOCS_STRIPPED 0x0001 // Relocation info stripped from file.
-#define IMAGE_FILE_EXECUTABLE_IMAGE 0x0002 // File is executable (i.e. no unresolved externel references).
-#define IMAGE_FILE_LINE_NUMS_STRIPPED 0x0004 // Line nunbers stripped from file.
-#define IMAGE_FILE_LOCAL_SYMS_STRIPPED 0x0008 // Local symbols stripped from file.
-#define IMAGE_FILE_BYTES_REVERSED_LO 0x0080 // Bytes of machine word are reversed.
-#define IMAGE_FILE_32BIT_MACHINE 0x0100 // 32 bit word machine.
-#define IMAGE_FILE_DEBUG_STRIPPED 0x0200 // Debugging info stripped from file in .DBG file
-#define IMAGE_FILE_SYSTEM 0x1000 // System File.
-#define IMAGE_FILE_DLL 0x2000 // File is a DLL.
-#define IMAGE_FILE_BYTES_REVERSED_HI 0x8000 // Bytes of machine word are reversed.
-
-#define IMAGE_FILE_MACHINE_UNKNOWN 0
-#define IMAGE_FILE_MACHINE_I386 0x14c // Intel 386.
-#define IMAGE_FILE_MACHINE_R3000 0x162 // MIPS little-endian, 0540 big-endian
-#define IMAGE_FILE_MACHINE_R4000 0x166 // MIPS little-endian
-#define IMAGE_FILE_MACHINE_ALPHA 0x184 // Alpha_AXP
-#define IMAGE_FILE_MACHINE_POWERPC 0x1F0 // IBM PowerPC Little-Endian
-#define IMAGE_FILE_MACHINE_TAHOE 0x7cc // Intel EM machine
-//
-// Directory format.
-//
-
-typedef struct _IMAGE_DATA_DIRECTORY {
- UINT32 VirtualAddress;
- UINT32 Size;
-} IMAGE_DATA_DIRECTORY, *PIMAGE_DATA_DIRECTORY;
-
-#define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16
-
-
-typedef struct _IMAGE_ROM_OPTIONAL_HEADER {
- UINT16 Magic;
- UINT8 MajorLinkerVersion;
- UINT8 MinorLinkerVersion;
- UINT32 SizeOfCode;
- UINT32 SizeOfInitializedData;
- UINT32 SizeOfUninitializedData;
- UINT32 AddressOfEntryPoint;
- UINT32 BaseOfCode;
- UINT32 BaseOfData;
- UINT32 BaseOfBss;
- UINT32 GprMask;
- UINT32 CprMask[4];
- UINT32 GpValue;
-} IMAGE_ROM_OPTIONAL_HEADER, *PIMAGE_ROM_OPTIONAL_HEADER;
-
-typedef struct _IMAGE_OPTIONAL_HEADER {
- UINT16 Magic;
- UINT8 MajorLinkerVersion;
- UINT8 MinorLinkerVersion;
- UINT32 SizeOfCode;
- UINT32 SizeOfInitializedData;
- UINT32 SizeOfUninitializedData;
- UINT32 AddressOfEntryPoint;
- UINT32 BaseOfCode;
- // UINT32 BaseOfData;
- UINT64 ImageBase;
- UINT32 SectionAlignment;
- UINT32 FileAlignment;
- UINT16 MajorOperatingSystemVersion;
- UINT16 MinorOperatingSystemVersion;
- UINT16 MajorImageVersion;
- UINT16 MinorImageVersion;
- UINT16 MajorSubsystemVersion;
- UINT16 MinorSubsystemVersion;
- UINT32 Win32VersionValue;
- UINT32 SizeOfImage;
- UINT32 SizeOfHeaders;
- UINT32 CheckSum;
- UINT16 Subsystem;
- UINT16 DllCharacteristics;
- UINT64 SizeOfStackReserve;
- UINT64 SizeOfStackCommit;
- UINT64 SizeOfHeapReserve;
- UINT64 SizeOfHeapCommit;
- UINT32 LoaderFlags;
- UINT32 NumberOfRvaAndSizes;
- IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES];
-} IMAGE_OPTIONAL_HEADER, *PIMAGE_OPTIONAL_HEADER;
-
-
-#define IMAGE_SIZEOF_ROM_OPTIONAL_HEADER 56
-#define IMAGE_SIZEOF_STD_OPTIONAL_HEADER 28
-#define IMAGE_SIZEOF_NT_OPTIONAL_HEADER 224
-#define IMAGE_SIZEOF_NT_OPTIONAL64_HEADER 244
-
-#define IMAGE_NT_OPTIONAL_HDR_MAGIC 0x10b
-#define IMAGE_NT_OPTIONAL_HDR64_MAGIC 0x20b
-#define IMAGE_ROM_OPTIONAL_HDR_MAGIC 0x107
-
-typedef struct _IMAGE_NT_HEADERS {
- UINT32 Signature;
- IMAGE_FILE_HEADER FileHeader;
- IMAGE_OPTIONAL_HEADER OptionalHeader;
-} IMAGE_NT_HEADERS, *PIMAGE_NT_HEADERS;
-
-typedef struct _IMAGE_ROM_HEADERS {
- IMAGE_FILE_HEADER FileHeader;
- IMAGE_ROM_OPTIONAL_HEADER OptionalHeader;
-} IMAGE_ROM_HEADERS, *PIMAGE_ROM_HEADERS;
-
-#define IMAGE_FIRST_SECTION( ntheader ) ((PIMAGE_SECTION_HEADER) \
- ((UINT32)ntheader + \
- FIELD_OFFSET( IMAGE_NT_HEADERS, OptionalHeader ) + \
- ((PIMAGE_NT_HEADERS)(ntheader))->FileHeader.SizeOfOptionalHeader \
- ))
-
-
-// Subsystem Values
-
-#define IMAGE_SUBSYSTEM_UNKNOWN 0 // Unknown subsystem.
-#define IMAGE_SUBSYSTEM_NATIVE 1 // Image doesn't require a subsystem.
-#define IMAGE_SUBSYSTEM_WINDOWS_GUI 2 // Image runs in the Windows GUI subsystem.
-#define IMAGE_SUBSYSTEM_WINDOWS_CUI 3 // Image runs in the Windows character subsystem.
-#define IMAGE_SUBSYSTEM_OS2_CUI 5 // image runs in the OS/2 character subsystem.
-#define IMAGE_SUBSYSTEM_POSIX_CUI 7 // image run in the Posix character subsystem.
-
-
-// Directory Entries
-
-#define IMAGE_DIRECTORY_ENTRY_EXPORT 0 // Export Directory
-#define IMAGE_DIRECTORY_ENTRY_IMPORT 1 // Import Directory
-#define IMAGE_DIRECTORY_ENTRY_RESOURCE 2 // Resource Directory
-#define IMAGE_DIRECTORY_ENTRY_EXCEPTION 3 // Exception Directory
-#define IMAGE_DIRECTORY_ENTRY_SECURITY 4 // Security Directory
-#define IMAGE_DIRECTORY_ENTRY_BASERELOC 5 // Base Relocation Table
-#define IMAGE_DIRECTORY_ENTRY_DEBUG 6 // Debug Directory
-#define IMAGE_DIRECTORY_ENTRY_COPYRIGHT 7 // Description String
-#define IMAGE_DIRECTORY_ENTRY_GLOBALPTR 8 // Machine Value (MIPS GP)
-#define IMAGE_DIRECTORY_ENTRY_TLS 9 // TLS Directory
-#define IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG 10 // Load Configuration Directory
-
-//
-// Section header format.
-//
-
-#define IMAGE_SIZEOF_SHORT_NAME 8
-
-typedef struct _IMAGE_SECTION_HEADER {
- UINT8 Name[IMAGE_SIZEOF_SHORT_NAME];
- union {
- UINT32 PhysicalAddress;
- UINT32 VirtualSize;
- } Misc;
- UINT32 VirtualAddress;
- UINT32 SizeOfRawData;
- UINT32 PointerToRawData;
- UINT32 PointerToRelocations;
- UINT32 PointerToLinenumbers;
- UINT16 NumberOfRelocations;
- UINT16 NumberOfLinenumbers;
- UINT32 Characteristics;
-} IMAGE_SECTION_HEADER, *PIMAGE_SECTION_HEADER;
-
-#define IMAGE_SIZEOF_SECTION_HEADER 40
-
-#define IMAGE_SCN_TYPE_NO_PAD 0x00000008 // Reserved.
-
-#define IMAGE_SCN_CNT_CODE 0x00000020 // Section contains code.
-#define IMAGE_SCN_CNT_INITIALIZED_DATA 0x00000040 // Section contains initialized data.
-#define IMAGE_SCN_CNT_UNINITIALIZED_DATA 0x00000080 // Section contains uninitialized data.
-
-#define IMAGE_SCN_LNK_OTHER 0x00000100 // Reserved.
-#define IMAGE_SCN_LNK_INFO 0x00000200 // Section contains comments or some other type of information.
-#define IMAGE_SCN_LNK_REMOVE 0x00000800 // Section contents will not become part of image.
-#define IMAGE_SCN_LNK_COMDAT 0x00001000 // Section contents comdat.
-
-#define IMAGE_SCN_ALIGN_1BYTES 0x00100000 //
-#define IMAGE_SCN_ALIGN_2BYTES 0x00200000 //
-#define IMAGE_SCN_ALIGN_4BYTES 0x00300000 //
-#define IMAGE_SCN_ALIGN_8BYTES 0x00400000 //
-#define IMAGE_SCN_ALIGN_16BYTES 0x00500000 // Default alignment if no others are specified.
-#define IMAGE_SCN_ALIGN_32BYTES 0x00600000 //
-#define IMAGE_SCN_ALIGN_64BYTES 0x00700000 //
-
-#define IMAGE_SCN_MEM_DISCARDABLE 0x02000000 // Section can be discarded.
-#define IMAGE_SCN_MEM_NOT_CACHED 0x04000000 // Section is not cachable.
-#define IMAGE_SCN_MEM_NOT_PAGED 0x08000000 // Section is not pageable.
-#define IMAGE_SCN_MEM_SHARED 0x10000000 // Section is shareable.
-#define IMAGE_SCN_MEM_EXECUTE 0x20000000 // Section is executable.
-#define IMAGE_SCN_MEM_READ 0x40000000 // Section is readable.
-#define IMAGE_SCN_MEM_WRITE 0x80000000 // Section is writeable.
-
-//
-// Symbol format.
-//
-
-
-#define IMAGE_SIZEOF_SYMBOL 18
-
-//
-// Section values.
-//
-// Symbols have a section number of the section in which they are
-// defined. Otherwise, section numbers have the following meanings:
-//
-
-#define IMAGE_SYM_UNDEFINED (UINT16)0 // Symbol is undefined or is common.
-#define IMAGE_SYM_ABSOLUTE (UINT16)-1 // Symbol is an absolute value.
-#define IMAGE_SYM_DEBUG (UINT16)-2 // Symbol is a special debug item.
-
-//
-// Type (fundamental) values.
-//
-
-#define IMAGE_SYM_TYPE_NULL 0 // no type.
-#define IMAGE_SYM_TYPE_VOID 1 //
-#define IMAGE_SYM_TYPE_CHAR 2 // type character.
-#define IMAGE_SYM_TYPE_SHORT 3 // type short integer.
-#define IMAGE_SYM_TYPE_INT 4 //
-#define IMAGE_SYM_TYPE_LONG 5 //
-#define IMAGE_SYM_TYPE_FLOAT 6 //
-#define IMAGE_SYM_TYPE_DOUBLE 7 //
-#define IMAGE_SYM_TYPE_STRUCT 8 //
-#define IMAGE_SYM_TYPE_UNION 9 //
-#define IMAGE_SYM_TYPE_ENUM 10 // enumeration.
-#define IMAGE_SYM_TYPE_MOE 11 // member of enumeration.
-#define IMAGE_SYM_TYPE_BYTE 12 //
-#define IMAGE_SYM_TYPE_WORD 13 //
-#define IMAGE_SYM_TYPE_UINT 14 //
-#define IMAGE_SYM_TYPE_DWORD 15 //
-
-//
-// Type (derived) values.
-//
-
-#define IMAGE_SYM_DTYPE_NULL 0 // no derived type.
-#define IMAGE_SYM_DTYPE_POINTER 1 // pointer.
-#define IMAGE_SYM_DTYPE_FUNCTION 2 // function.
-#define IMAGE_SYM_DTYPE_ARRAY 3 // array.
-
-//
-// Storage classes.
-//
-
-#define IMAGE_SYM_CLASS_END_OF_FUNCTION (BYTE )-1
-#define IMAGE_SYM_CLASS_NULL 0
-#define IMAGE_SYM_CLASS_AUTOMATIC 1
-#define IMAGE_SYM_CLASS_EXTERNAL 2
-#define IMAGE_SYM_CLASS_STATIC 3
-#define IMAGE_SYM_CLASS_REGISTER 4
-#define IMAGE_SYM_CLASS_EXTERNAL_DEF 5
-#define IMAGE_SYM_CLASS_LABEL 6
-#define IMAGE_SYM_CLASS_UNDEFINED_LABEL 7
-#define IMAGE_SYM_CLASS_MEMBER_OF_STRUCT 8
-#define IMAGE_SYM_CLASS_ARGUMENT 9
-#define IMAGE_SYM_CLASS_STRUCT_TAG 10
-#define IMAGE_SYM_CLASS_MEMBER_OF_UNION 11
-#define IMAGE_SYM_CLASS_UNION_TAG 12
-#define IMAGE_SYM_CLASS_TYPE_DEFINITION 13
-#define IMAGE_SYM_CLASS_UNDEFINED_STATIC 14
-#define IMAGE_SYM_CLASS_ENUM_TAG 15
-#define IMAGE_SYM_CLASS_MEMBER_OF_ENUM 16
-#define IMAGE_SYM_CLASS_REGISTER_PARAM 17
-#define IMAGE_SYM_CLASS_BIT_FIELD 18
-#define IMAGE_SYM_CLASS_BLOCK 100
-#define IMAGE_SYM_CLASS_FUNCTION 101
-#define IMAGE_SYM_CLASS_END_OF_STRUCT 102
-#define IMAGE_SYM_CLASS_FILE 103
-// new
-#define IMAGE_SYM_CLASS_SECTION 104
-#define IMAGE_SYM_CLASS_WEAK_EXTERNAL 105
-
-// type packing constants
-
-#define N_BTMASK 017
-#define N_TMASK 060
-#define N_TMASK1 0300
-#define N_TMASK2 0360
-#define N_BTSHFT 4
-#define N_TSHIFT 2
-
-// MACROS
-
-//
-// Communal selection types.
-//
-
-#define IMAGE_COMDAT_SELECT_NODUPLICATES 1
-#define IMAGE_COMDAT_SELECT_ANY 2
-#define IMAGE_COMDAT_SELECT_SAME_SIZE 3
-#define IMAGE_COMDAT_SELECT_EXACT_MATCH 4
-#define IMAGE_COMDAT_SELECT_ASSOCIATIVE 5
-
-#define IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY 1
-#define IMAGE_WEAK_EXTERN_SEARCH_LIBRARY 2
-#define IMAGE_WEAK_EXTERN_SEARCH_ALIAS 3
-
-
-//
-// Relocation format.
-//
-
-typedef struct _IMAGE_RELOCATION {
- UINT32 VirtualAddress;
- UINT32 SymbolTableIndex;
- UINT16 Type;
-} IMAGE_RELOCATION;
-
-#define IMAGE_SIZEOF_RELOCATION 10
-
-//
-// I386 relocation types.
-//
-
-#define IMAGE_REL_I386_ABSOLUTE 0 // Reference is absolute, no relocation is necessary
-#define IMAGE_REL_I386_DIR16 01 // Direct 16-bit reference to the symbols virtual address
-#define IMAGE_REL_I386_REL16 02 // PC-relative 16-bit reference to the symbols virtual address
-#define IMAGE_REL_I386_DIR32 06 // Direct 32-bit reference to the symbols virtual address
-#define IMAGE_REL_I386_DIR32NB 07 // Direct 32-bit reference to the symbols virtual address, base not included
-#define IMAGE_REL_I386_SEG12 011 // Direct 16-bit reference to the segment-selector bits of a 32-bit virtual address
-#define IMAGE_REL_I386_SECTION 012
-#define IMAGE_REL_I386_SECREL 013
-#define IMAGE_REL_I386_REL32 024 // PC-relative 32-bit reference to the symbols virtual address
-
-//
-// MIPS relocation types.
-//
-
-#define IMAGE_REL_MIPS_ABSOLUTE 0 // Reference is absolute, no relocation is necessary
-#define IMAGE_REL_MIPS_REFHALF 01
-#define IMAGE_REL_MIPS_REFWORD 02
-#define IMAGE_REL_MIPS_JMPADDR 03
-#define IMAGE_REL_MIPS_REFHI 04
-#define IMAGE_REL_MIPS_REFLO 05
-#define IMAGE_REL_MIPS_GPREL 06
-#define IMAGE_REL_MIPS_LITERAL 07
-#define IMAGE_REL_MIPS_SECTION 012
-#define IMAGE_REL_MIPS_SECREL 013
-#define IMAGE_REL_MIPS_REFWORDNB 042
-#define IMAGE_REL_MIPS_PAIR 045
-
-//
-// Alpha Relocation types.
-//
-
-#define IMAGE_REL_ALPHA_ABSOLUTE 0x0
-#define IMAGE_REL_ALPHA_REFLONG 0x1
-#define IMAGE_REL_ALPHA_REFQUAD 0x2
-#define IMAGE_REL_ALPHA_GPREL32 0x3
-#define IMAGE_REL_ALPHA_LITERAL 0x4
-#define IMAGE_REL_ALPHA_LITUSE 0x5
-#define IMAGE_REL_ALPHA_GPDISP 0x6
-#define IMAGE_REL_ALPHA_BRADDR 0x7
-#define IMAGE_REL_ALPHA_HINT 0x8
-#define IMAGE_REL_ALPHA_INLINE_REFLONG 0x9
-#define IMAGE_REL_ALPHA_REFHI 0xA
-#define IMAGE_REL_ALPHA_REFLO 0xB
-#define IMAGE_REL_ALPHA_PAIR 0xC
-#define IMAGE_REL_ALPHA_MATCH 0xD
-#define IMAGE_REL_ALPHA_SECTION 0xE
-#define IMAGE_REL_ALPHA_SECREL 0xF
-#define IMAGE_REL_ALPHA_REFLONGNB 0x10
-
-//
-// IBM PowerPC relocation types.
-//
-
-#define IMAGE_REL_PPC_ABSOLUTE 0x0000 // NOP
-#define IMAGE_REL_PPC_ADDR64 0x0001 // 64-bit address
-#define IMAGE_REL_PPC_ADDR32 0x0002 // 32-bit address
-#define IMAGE_REL_PPC_ADDR24 0x0003 // 26-bit address, shifted left 2 (branch absolute)
-#define IMAGE_REL_PPC_ADDR16 0x0004 // 16-bit address
-#define IMAGE_REL_PPC_ADDR14 0x0005 // 16-bit address, shifted left 2 (load doubleword)
-#define IMAGE_REL_PPC_REL24 0x0006 // 26-bit PC-relative offset, shifted left 2 (branch relative)
-#define IMAGE_REL_PPC_REL14 0x0007 // 16-bit PC-relative offset, shifted left 2 (br cond relative)
-#define IMAGE_REL_PPC_TOCREL16 0x0008 // 16-bit offset from TOC base
-#define IMAGE_REL_PPC_TOCREL14 0x0009 // 16-bit offset from TOC base, shifted left 2 (load doubleword)
-
-#define IMAGE_REL_PPC_ADDR32NB 0x000A // 32-bit addr w/o image base
-#define IMAGE_REL_PPC_SECREL 0x000B // va of containing section (as in an image sectionhdr)
-#define IMAGE_REL_PPC_SECTION 0x000C // sectionheader number
-#define IMAGE_REL_PPC_IFGLUE 0x000D // substitute TOC restore instruction iff symbol is glue code
-#define IMAGE_REL_PPC_IMGLUE 0x000E // symbol is glue code; virtual address is TOC restore instruction
-
-#define IMAGE_REL_PPC_TYPEMASK 0x00FF // mask to isolate above values in IMAGE_RELOCATION.Type
-
-// Flag bits in IMAGE_RELOCATION.TYPE
-
-#define IMAGE_REL_PPC_NEG 0x0100 // subtract reloc value rather than adding it
-#define IMAGE_REL_PPC_BRTAKEN 0x0200 // fix branch prediction bit to predict branch taken
-#define IMAGE_REL_PPC_BRNTAKEN 0x0400 // fix branch prediction bit to predict branch not taken
-#define IMAGE_REL_PPC_TOCDEFN 0x0800 // toc slot defined in file (or, data in toc)
-
-//
-// Based relocation format.
-//
-
-typedef struct _IMAGE_BASE_RELOCATION {
- UINT32 VirtualAddress;
- UINT32 SizeOfBlock;
-// UINT16 TypeOffset[1];
-} IMAGE_BASE_RELOCATION, *PIMAGE_BASE_RELOCATION;
-
-#define IMAGE_SIZEOF_BASE_RELOCATION 8
-
-//
-// Based relocation types.
-//
-
-#define IMAGE_REL_BASED_ABSOLUTE 0
-#define IMAGE_REL_BASED_HIGH 1
-#define IMAGE_REL_BASED_LOW 2
-#define IMAGE_REL_BASED_HIGHLOW 3
-#define IMAGE_REL_BASED_HIGHADJ 4
-#define IMAGE_REL_BASED_MIPS_JMPADDR 5
-#define IMAGE_REL_BASED_IA64_IMM64 9
-#define IMAGE_REL_BASED_DIR64 10
-
-//
-// Line number format.
-//
-
-typedef struct _IMAGE_LINENUMBER {
- union {
- UINT32 SymbolTableIndex; // Symbol table index of function name if Linenumber is 0.
- UINT32 VirtualAddress; // Virtual address of line number.
- } Type;
- UINT16 Linenumber; // Line number.
-} IMAGE_LINENUMBER;
-
-#define IMAGE_SIZEOF_LINENUMBER 6
-
-//
-// Archive format.
-//
-
-#define IMAGE_ARCHIVE_START_SIZE 8
-#define IMAGE_ARCHIVE_START "!<arch>\n"
-#define IMAGE_ARCHIVE_END "`\n"
-#define IMAGE_ARCHIVE_PAD "\n"
-#define IMAGE_ARCHIVE_LINKER_MEMBER "/ "
-#define IMAGE_ARCHIVE_LONGNAMES_MEMBER "// "
-
-typedef struct _IMAGE_ARCHIVE_MEMBER_HEADER {
- UINT8 Name[16]; // File member name - `/' terminated.
- UINT8 Date[12]; // File member date - decimal.
- UINT8 UserID[6]; // File member user id - decimal.
- UINT8 GroupID[6]; // File member group id - decimal.
- UINT8 Mode[8]; // File member mode - octal.
- UINT8 Size[10]; // File member size - decimal.
- UINT8 EndHeader[2]; // String to end header.
-} IMAGE_ARCHIVE_MEMBER_HEADER, *PIMAGE_ARCHIVE_MEMBER_HEADER;
-
-#define IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR 60
-
-//
-// DLL support.
-//
-
-//
-// Export Format
-//
-
-typedef struct _IMAGE_EXPORT_DIRECTORY {
- UINT32 Characteristics;
- UINT32 TimeDateStamp;
- UINT16 MajorVersion;
- UINT16 MinorVersion;
- UINT32 Name;
- UINT32 Base;
- UINT32 NumberOfFunctions;
- UINT32 NumberOfNames;
- UINT32 AddressOfFunctions;
- UINT32 AddressOfNames;
- UINT32 AddressOfNameOrdinals;
-} IMAGE_EXPORT_DIRECTORY, *PIMAGE_EXPORT_DIRECTORY;
-
-//
-// Import Format
-//
-
-typedef struct _IMAGE_IMPORT_BY_NAME {
- UINT16 Hint;
- UINT8 Name[1];
-} IMAGE_IMPORT_BY_NAME, *PIMAGE_IMPORT_BY_NAME;
-
-typedef struct _IMAGE_THUNK_DATA {
- union {
- UINT32 Function;
- UINT32 Ordinal;
- PIMAGE_IMPORT_BY_NAME AddressOfData;
- } u1;
-} IMAGE_THUNK_DATA, *PIMAGE_THUNK_DATA;
-
-#define IMAGE_ORDINAL_FLAG 0x80000000
-#define IMAGE_SNAP_BY_ORDINAL(Ordinal) ((Ordinal & IMAGE_ORDINAL_FLAG) != 0)
-#define IMAGE_ORDINAL(Ordinal) (Ordinal & 0xffff)
-
-typedef struct _IMAGE_IMPORT_DESCRIPTOR {
- UINT32 Characteristics;
- UINT32 TimeDateStamp;
- UINT32 ForwarderChain;
- UINT32 Name;
- PIMAGE_THUNK_DATA FirstThunk;
-} IMAGE_IMPORT_DESCRIPTOR, *PIMAGE_IMPORT_DESCRIPTOR;
-
-#define IMAGE_DEBUG_TYPE_CODEVIEW 2
-
-typedef struct {
- UINT32 Characteristics;
- UINT32 TimeDateStamp;
- UINT16 MajorVersion;
- UINT16 MinorVersion;
- UINT32 Type;
- UINT32 SizeOfData;
- UINT32 RVA;
- UINT32 FileOffset;
-} IMAGE_DEBUG_DIRECTORY_ENTRY;
-
-#define CODEVIEW_SIGNATURE_NB10 0x3031424E // "NB10"
-
-typedef struct {
- UINT32 Signature; // "NB10"
- UINT32 Unknown;
- UINT32 Unknown2;
- UINT32 Unknown3;
- //
- // Filename of .PDB goes here
- //
-} EFI_IMAGE_DEBUG_CODEVIEW_NB10_ENTRY;
-
-#define CODEVIEW_SIGNATURE_RSDS 0x53445352 // "RSDS"
-
-typedef struct {
- UINT32 Signature; // "RSDS"
- UINT32 Unknown;
- UINT32 Unknown2;
- UINT32 Unknown3;
- UINT32 Unknown4;
- UINT32 Unknown5;
- //
- // Filename of .PDB goes here
- //
-} EFI_IMAGE_DEBUG_CODEVIEW_RSDS_ENTRY;
-
-#endif
diff --git a/sys/boot/ficl/ia64/sysdep.c b/sys/boot/ficl/ia64/sysdep.c
deleted file mode 100644
index 00b0d4a..0000000
--- a/sys/boot/ficl/ia64/sysdep.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************
-** s y s d e p . c
-** Forth Inspired Command Language
-** Author: John Sadler (john_sadler@alum.mit.edu)
-** Created: 16 Oct 1997
-** Implementations of FICL external interface functions...
-**
-*******************************************************************/
-
-/* $FreeBSD$ */
-
-#ifdef TESTMAIN
-#include <stdio.h>
-#include <stdlib.h>
-#else
-#include <stand.h>
-#endif
-#include "ficl.h"
-
-/*
-******************* FreeBSD P O R T B E G I N S H E R E ******************** Michael Smith
-*/
-
-#if PORTABLE_LONGMULDIV == 0
-DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y)
-{
- DPUNS q;
- u_int64_t qx;
-
- qx = (u_int64_t)x * (u_int64_t) y;
-
- q.hi = (u_int32_t)( qx >> 32 );
- q.lo = (u_int32_t)( qx & 0xFFFFFFFFL);
-
- return q;
-}
-
-UNSQR ficlLongDiv(DPUNS q, FICL_UNS y)
-{
- UNSQR result;
- u_int64_t qx, qh;
-
- qh = q.hi;
- qx = (qh << 32) | q.lo;
-
- result.quot = qx / y;
- result.rem = qx % y;
-
- return result;
-}
-#endif
-
-void ficlTextOut(FICL_VM *pVM, char *msg, int fNewline)
-{
- IGNORE(pVM);
-
- while(*msg != 0)
- putchar(*(msg++));
- if (fNewline)
- putchar('\n');
-
- return;
-}
-
-void *ficlMalloc (size_t size)
-{
- return malloc(size);
-}
-
-void *ficlRealloc (void *p, size_t size)
-{
- return realloc(p, size);
-}
-
-void ficlFree (void *p)
-{
- free(p);
-}
-
-
-/*
-** Stub function for dictionary access control - does nothing
-** by default, user can redefine to guarantee exclusive dict
-** access to a single thread for updates. All dict update code
-** is guaranteed to be bracketed as follows:
-** ficlLockDictionary(TRUE);
-** <code that updates dictionary>
-** ficlLockDictionary(FALSE);
-**
-** Returns zero if successful, nonzero if unable to acquire lock
-** befor timeout (optional - could also block forever)
-*/
-#if FICL_MULTITHREAD
-int ficlLockDictionary(short fLock)
-{
- IGNORE(fLock);
- return 0;
-}
-#endif /* FICL_MULTITHREAD */
-
-
diff --git a/sys/boot/ficl/ia64/sysdep.h b/sys/boot/ficl/ia64/sysdep.h
deleted file mode 100644
index 08bc0e1..0000000
--- a/sys/boot/ficl/ia64/sysdep.h
+++ /dev/null
@@ -1,434 +0,0 @@
-/*******************************************************************
- s y s d e p . h
-** Forth Inspired Command Language
-** Author: John Sadler (john_sadler@alum.mit.edu)
-** Created: 16 Oct 1997
-** Ficl system dependent types and prototypes...
-**
-** Note: Ficl also depends on the use of "assert" when
-** FICL_ROBUST is enabled. This may require some consideration
-** in firmware systems since assert often
-** assumes stderr/stdout.
-** $Id: sysdep.h,v 1.11 2001/12/05 07:21:34 jsadler Exp $
-*******************************************************************/
-/*
-** Copyright (c) 1997-2001 John Sadler (john_sadler@alum.mit.edu)
-** All rights reserved.
-**
-** Get the latest Ficl release at http://ficl.sourceforge.net
-**
-** I am interested in hearing from anyone who uses ficl. If you have
-** a problem, a success story, a defect, an enhancement request, or
-** if you would like to contribute to the ficl release, please
-** contact me by email at the address above.
-**
-** L I C E N S E and D I S C L A I M E R
-**
-** 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.
-**
-** $Id: sysdep.h,v 1.6 2001-04-26 21:41:55-07 jsadler Exp jsadler $
-*/
-
-/* $FreeBSD$ */
-
-#if !defined (__SYSDEP_H__)
-#define __SYSDEP_H__
-
-#include <sys/types.h>
-
-#include <stddef.h> /* size_t, NULL */
-#include <setjmp.h>
-#include <assert.h>
-
-#if !defined IGNORE /* Macro to silence unused param warnings */
-#define IGNORE(x) &x
-#endif
-
-/*
-** TRUE and FALSE for C boolean operations, and
-** portable 32 bit types for CELLs
-**
-*/
-#if !defined TRUE
-#define TRUE 1
-#endif
-#if !defined FALSE
-#define FALSE 0
-#endif
-
-/*
-** System dependent data type declarations...
-*/
-#if !defined INT32
-#define INT32 int
-#endif
-
-#if !defined UNS32
-#define UNS32 unsigned int
-#endif
-
-#if !defined UNS16
-#define UNS16 unsigned short
-#endif
-
-#if !defined UNS8
-#define UNS8 unsigned char
-#endif
-
-#if !defined NULL
-#define NULL ((void *)0)
-#endif
-
-/*
-** FICL_UNS and FICL_INT must have the same size as a void* on
-** the target system. A CELL is a union of void*, FICL_UNS, and
-** FICL_INT.
-** (11/2000: same for FICL_FLOAT)
-*/
-#if !defined FICL_INT
-#define FICL_INT long
-#endif
-
-#if !defined FICL_UNS
-#define FICL_UNS unsigned long
-#endif
-
-#if !defined FICL_FLOAT
-#define FICL_FLOAT float
-#endif
-
-/*
-** Ficl presently supports values of 32 and 64 for BITS_PER_CELL
-*/
-#if !defined BITS_PER_CELL
-#define BITS_PER_CELL 64
-#endif
-
-#if ((BITS_PER_CELL != 32) && (BITS_PER_CELL != 64))
- Error!
-#endif
-
-typedef struct
-{
- FICL_UNS hi;
- FICL_UNS lo;
-} DPUNS;
-
-typedef struct
-{
- FICL_UNS quot;
- FICL_UNS rem;
-} UNSQR;
-
-typedef struct
-{
- FICL_INT hi;
- FICL_INT lo;
-} DPINT;
-
-typedef struct
-{
- FICL_INT quot;
- FICL_INT rem;
-} INTQR;
-
-
-/*
-** B U I L D C O N T R O L S
-*/
-
-#if !defined (FICL_MINIMAL)
-#define FICL_MINIMAL 0
-#endif
-#if (FICL_MINIMAL)
-#define FICL_WANT_SOFTWORDS 0
-#define FICL_WANT_FILE 0
-#define FICL_WANT_FLOAT 0
-#define FICL_WANT_USER 0
-#define FICL_WANT_LOCALS 0
-#define FICL_WANT_DEBUGGER 0
-#define FICL_WANT_OOP 0
-#define FICL_PLATFORM_EXTEND 0
-#define FICL_MULTITHREAD 0
-#define FICL_ROBUST 0
-#define FICL_EXTENDED_PREFIX 0
-#endif
-
-/*
-** FICL_PLATFORM_EXTEND
-** Includes words defined in ficlCompilePlatform
-*/
-#if !defined (FICL_PLATFORM_EXTEND)
-#define FICL_PLATFORM_EXTEND 1
-#endif
-
-
-/*
-** FICL_WANT_FILE
-** Includes the FILE and FILE-EXT wordset and associated code. Turn this off if you do not
-** have a filesystem!
-** Contributed by Larry Hastings
-*/
-#if !defined (FICL_WANT_FILE)
-#define FICL_WANT_FILE 0
-#endif
-
-/*
-** FICL_WANT_FLOAT
-** Includes a floating point stack for the VM, and words to do float operations.
-** Contributed by Guy Carver
-*/
-#if !defined (FICL_WANT_FLOAT)
-#define FICL_WANT_FLOAT 0
-#endif
-
-/*
-** FICL_WANT_DEBUGGER
-** Inludes a simple source level debugger
-*/
-#if !defined (FICL_WANT_DEBUGGER)
-#define FICL_WANT_DEBUGGER 1
-#endif
-
-/*
-** FICL_EXTENDED_PREFIX enables a bunch of extra prefixes in prefix.c and prefix.fr (if
-** included as part of softcore.c)
-*/
-#if !defined FICL_EXTENDED_PREFIX
-#define FICL_EXTENDED_PREFIX 0
-#endif
-
-/*
-** User variables: per-instance variables bound to the VM.
-** Kinda like thread-local storage. Could be implemented in a
-** VM private dictionary, but I've chosen the lower overhead
-** approach of an array of CELLs instead.
-*/
-#if !defined FICL_WANT_USER
-#define FICL_WANT_USER 1
-#endif
-
-#if !defined FICL_USER_CELLS
-#define FICL_USER_CELLS 16
-#endif
-
-/*
-** FICL_WANT_LOCALS controls the creation of the LOCALS wordset and
-** a private dictionary for local variable compilation.
-*/
-#if !defined FICL_WANT_LOCALS
-#define FICL_WANT_LOCALS 1
-#endif
-
-/* Max number of local variables per definition */
-#if !defined FICL_MAX_LOCALS
-#define FICL_MAX_LOCALS 16
-#endif
-
-/*
-** FICL_WANT_OOP
-** Inludes object oriented programming support (in softwords)
-** OOP support requires locals and user variables!
-*/
-#if !(FICL_WANT_LOCALS) || !(FICL_WANT_USER)
-#if !defined (FICL_WANT_OOP)
-#define FICL_WANT_OOP 0
-#endif
-#endif
-
-#if !defined (FICL_WANT_OOP)
-#define FICL_WANT_OOP 1
-#endif
-
-/*
-** FICL_WANT_SOFTWORDS
-** Controls inclusion of all softwords in softcore.c
-*/
-#if !defined (FICL_WANT_SOFTWORDS)
-#define FICL_WANT_SOFTWORDS 1
-#endif
-
-/*
-** FICL_MULTITHREAD enables dictionary mutual exclusion
-** wia the ficlLockDictionary system dependent function.
-** Note: this implementation is experimental and poorly
-** tested. Further, it's unnecessary unless you really
-** intend to have multiple SESSIONS (poor choice of name
-** on my part) - that is, threads that modify the dictionary
-** at the same time.
-*/
-#if !defined FICL_MULTITHREAD
-#define FICL_MULTITHREAD 0
-#endif
-
-/*
-** PORTABLE_LONGMULDIV causes ficlLongMul and ficlLongDiv to be
-** defined in C in sysdep.c. Use this if you cannot easily
-** generate an inline asm definition
-*/
-#if !defined (PORTABLE_LONGMULDIV)
-#define PORTABLE_LONGMULDIV 0
-#endif
-
-/*
-** INLINE_INNER_LOOP causes the inner interpreter to be inline code
-** instead of a function call. This is mainly because MS VC++ 5
-** chokes with an internal compiler error on the function version.
-** in release mode. Sheesh.
-*/
-#if !defined INLINE_INNER_LOOP
-#if defined _DEBUG
-#define INLINE_INNER_LOOP 0
-#else
-#define INLINE_INNER_LOOP 1
-#endif
-#endif
-
-/*
-** FICL_ROBUST enables bounds checking of stacks and the dictionary.
-** This will detect stack over and underflows and dictionary overflows.
-** Any exceptional condition will result in an assertion failure.
-** (As generated by the ANSI assert macro)
-** FICL_ROBUST == 1 --> stack checking in the outer interpreter
-** FICL_ROBUST == 2 also enables checking in many primitives
-*/
-
-#if !defined FICL_ROBUST
-#define FICL_ROBUST 2
-#endif
-
-/*
-** FICL_DEFAULT_STACK Specifies the default size (in CELLs) of
-** a new virtual machine's stacks, unless overridden at
-** create time.
-*/
-#if !defined FICL_DEFAULT_STACK
-#define FICL_DEFAULT_STACK 128
-#endif
-
-/*
-** FICL_DEFAULT_DICT specifies the number of CELLs to allocate
-** for the system dictionary by default. The value
-** can be overridden at startup time as well.
-** FICL_DEFAULT_ENV specifies the number of cells to allot
-** for the environment-query dictionary.
-*/
-#if !defined FICL_DEFAULT_DICT
-#define FICL_DEFAULT_DICT 12288
-#endif
-
-#if !defined FICL_DEFAULT_ENV
-#define FICL_DEFAULT_ENV 260
-#endif
-
-/*
-** FICL_DEFAULT_VOCS specifies the maximum number of wordlists in
-** the dictionary search order. See Forth DPANS sec 16.3.3
-** (file://dpans16.htm#16.3.3)
-*/
-#if !defined FICL_DEFAULT_VOCS
-#define FICL_DEFAULT_VOCS 16
-#endif
-
-/*
-** FICL_MAX_PARSE_STEPS controls the size of an array in the FICL_SYSTEM structure
-** that stores pointers to parser extension functions. I would never expect to have
-** more than 8 of these, so that's the default limit. Too many of these functions
-** will probably exact a nasty performance penalty.
-*/
-#if !defined FICL_MAX_PARSE_STEPS
-#define FICL_MAX_PARSE_STEPS 8
-#endif
-
-/*
-** FICL_ALIGN is the power of two to which the dictionary
-** pointer address must be aligned. This value is usually
-** either 1 or 2, depending on the memory architecture
-** of the target system; 2 is safe on any 16 or 32 bit
-** machine. 3 would be appropriate for a 64 bit machine.
-*/
-#if !defined FICL_ALIGN
-#define FICL_ALIGN 3
-#define FICL_ALIGN_ADD ((1 << FICL_ALIGN) - 1)
-#endif
-
-/*
-** System dependent routines --
-** edit the implementations in sysdep.c to be compatible
-** with your runtime environment...
-** ficlTextOut sends a NULL terminated string to the
-** default output device - used for system error messages
-** ficlMalloc and ficlFree have the same semantics as malloc and free
-** in standard C
-** ficlLongMul multiplies two UNS32s and returns a 64 bit unsigned
-** product
-** ficlLongDiv divides an UNS64 by an UNS32 and returns UNS32 quotient
-** and remainder
-*/
-struct vm;
-void ficlTextOut(struct vm *pVM, char *msg, int fNewline);
-void *ficlMalloc (size_t size);
-void ficlFree (void *p);
-void *ficlRealloc(void *p, size_t size);
-/*
-** Stub function for dictionary access control - does nothing
-** by default, user can redefine to guarantee exclusive dict
-** access to a single thread for updates. All dict update code
-** must be bracketed as follows:
-** ficlLockDictionary(TRUE);
-** <code that updates dictionary>
-** ficlLockDictionary(FALSE);
-**
-** Returns zero if successful, nonzero if unable to acquire lock
-** before timeout (optional - could also block forever)
-**
-** NOTE: this function must be implemented with lock counting
-** semantics: nested calls must behave properly.
-*/
-#if FICL_MULTITHREAD
-int ficlLockDictionary(short fLock);
-#else
-#define ficlLockDictionary(x) 0 /* ignore */
-#endif
-
-/*
-** 64 bit integer math support routines: multiply two UNS32s
-** to get a 64 bit product, & divide the product by an UNS32
-** to get an UNS32 quotient and remainder. Much easier in asm
-** on a 32 bit CPU than in C, which usually doesn't support
-** the double length result (but it should).
-*/
-DPUNS ficlLongMul(FICL_UNS x, FICL_UNS y);
-UNSQR ficlLongDiv(DPUNS q, FICL_UNS y);
-
-
-/*
-** FICL_HAVE_FTRUNCATE indicates whether the current OS supports
-** the ftruncate() function (available on most UNIXes). This
-** function is necessary to provide the complete File-Access wordset.
-*/
-#if !defined (FICL_HAVE_FTRUNCATE)
-#define FICL_HAVE_FTRUNCATE 0
-#endif
-
-
-#endif /*__SYSDEP_H__*/
diff --git a/sys/boot/ficl/loader.c b/sys/boot/ficl/loader.c
index f39b1eb..349a7c6 100644
--- a/sys/boot/ficl/loader.c
+++ b/sys/boot/ficl/loader.c
@@ -800,15 +800,9 @@ void ficlCompilePlatform(FICL_SYSTEM *pSys)
ficlSetEnv(pSys, "arch-pc98", FICL_TRUE);
#elif defined(__i386__)
ficlSetEnv(pSys, "arch-i386", FICL_TRUE);
- ficlSetEnv(pSys, "arch-ia64", FICL_FALSE);
- ficlSetEnv(pSys, "arch-powerpc", FICL_FALSE);
-#elif defined(__ia64__)
- ficlSetEnv(pSys, "arch-i386", FICL_FALSE);
- ficlSetEnv(pSys, "arch-ia64", FICL_TRUE);
ficlSetEnv(pSys, "arch-powerpc", FICL_FALSE);
#elif defined(__powerpc__)
ficlSetEnv(pSys, "arch-i386", FICL_FALSE);
- ficlSetEnv(pSys, "arch-ia64", FICL_FALSE);
ficlSetEnv(pSys, "arch-powerpc", FICL_TRUE);
#endif
diff --git a/sys/boot/ia64/Makefile b/sys/boot/ia64/Makefile
deleted file mode 100644
index 5f24fb2..0000000
--- a/sys/boot/ia64/Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-# $FreeBSD$
-
-SUBDIR= common efi
-
-# In the ski sub-directory, one can build a loader for use under Ski.
-# Ski is an Itanium simulator, originally developed by HP. It's not
-# supported anymore in FreeBSD, but left for reference and education.
-# SUBDIR += ski
-
-.include <bsd.subdir.mk>
diff --git a/sys/boot/ia64/Makefile.inc b/sys/boot/ia64/Makefile.inc
deleted file mode 100644
index e63fb54..0000000
--- a/sys/boot/ia64/Makefile.inc
+++ /dev/null
@@ -1,9 +0,0 @@
-# $FreeBSD$
-
-BINDIR?= /boot
-
-# Options used when building standalone components
-CFLAGS+= -ffreestanding -fshort-wchar -Wformat
-LDFLAGS+= -nostdlib
-
-.include "../Makefile.inc"
diff --git a/sys/boot/ia64/common/Makefile b/sys/boot/ia64/common/Makefile
deleted file mode 100644
index ef2737f..0000000
--- a/sys/boot/ia64/common/Makefile
+++ /dev/null
@@ -1,47 +0,0 @@
-# $FreeBSD$
-
-.include <src.opts.mk>
-MK_SSP= no
-
-LIB= ia64
-INTERNALLIB=
-
-SRCS= autoload.c bootinfo.c copy.c devicename.c exec.c icache.c
-
-CFLAGS+= -I${.CURDIR}/../../efi/include
-CFLAGS+= -I${.CURDIR}/../../efi/include/${MACHINE_CPUARCH}
-CFLAGS+= -I${.CURDIR}/../../..
-CFLAGS+= -I${.CURDIR}/../../../../lib/libstand
-
-.if ${MK_FORTH} != "no"
-BOOT_FORTH= yes
-CFLAGS+= -DBOOT_FORTH
-CFLAGS+= -I${.CURDIR}/../../ficl
-CFLAGS+= -I${.CURDIR}/../../ficl/${MACHINE_CPUARCH}
-.endif
-
-.PATH: ${.CURDIR}/../../common
-.include "${.CURDIR}/../../common/Makefile.inc"
-
-CFLAGS+= -I${.CURDIR}/../../common
-
-FILES+= loader.help
-CLEANFILES+= loader.help
-loader.help: help.common
- cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk \
- > ${.TARGET}
-
-.PATH: ${.CURDIR}/../../forth
-FILES+= loader.4th support.4th loader.conf
-FILES+= screen.4th frames.4th
-FILES+= beastie.4th brand.4th check-password.4th color.4th delay.4th
-FILES+= menu.4th menu-commands.4th menusets.4th shortcuts.4th version.4th
-.if !exists(${DESTDIR}/boot/loader.rc)
-FILES+= loader.rc
-.endif
-.if !exists(${DESTDIR}/boot/menu.rc)
-FILES+= menu.rc
-.endif
-FILESDIR_loader.conf= /boot/defaults
-
-.include <bsd.lib.mk>
diff --git a/sys/boot/ia64/common/autoload.c b/sys/boot/ia64/common/autoload.c
deleted file mode 100644
index ea334b9..0000000
--- a/sys/boot/ia64/common/autoload.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/*-
- * Copyright (c) 2006 Marcel Moolenaar
- * 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 ``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 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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-int
-ia64_autoload(void)
-{
-
- return (0);
-}
diff --git a/sys/boot/ia64/common/bootinfo.c b/sys/boot/ia64/common/bootinfo.c
deleted file mode 100644
index 04e8ba2..0000000
--- a/sys/boot/ia64/common/bootinfo.c
+++ /dev/null
@@ -1,296 +0,0 @@
-/*-
- * Copyright (c) 1998 Michael Smith <msmith@freebsd.org>
- * Copyright (c) 2006 Marcel Moolenaar
- * 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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <stand.h>
-#include <string.h>
-#include <sys/param.h>
-#include <sys/reboot.h>
-#include <sys/linker.h>
-#include <sys/boot.h>
-
-#include <efi.h>
-#include <efilib.h>
-
-#include "libia64.h"
-
-static const char howto_switches[] = "aCdrgDmphsv";
-static int howto_masks[] = {
- RB_ASKNAME, RB_CDROM, RB_KDB, RB_DFLTROOT, RB_GDB, RB_MULTIPLE,
- RB_MUTE, RB_PAUSE, RB_SERIAL, RB_SINGLE, RB_VERBOSE
-};
-
-int
-bi_getboothowto(char *kargs)
-{
- const char *sw;
- char *opts;
- int howto, i;
-
- howto = 0;
-
- /* Get the boot options from the environment first. */
- for (i = 0; howto_names[i].ev != NULL; i++) {
- if (getenv(howto_names[i].ev) != NULL)
- howto |= howto_names[i].mask;
- }
-
- /* Parse kargs */
- if (kargs == NULL)
- return (howto);
-
- opts = strchr(kargs, '-');
- while (opts != NULL) {
- while (*(++opts) != '\0') {
- sw = strchr(howto_switches, *opts);
- if (sw == NULL)
- break;
- howto |= howto_masks[sw - howto_switches];
- }
- opts = strchr(opts, '-');
- }
-
- return (howto);
-}
-
-/*
- * Copy the environment into the load area starting at (addr).
- * Each variable is formatted as <name>=<value>, with a single nul
- * separating each variable, and a double nul terminating the environment.
- */
-vm_offset_t
-bi_copyenv(vm_offset_t start)
-{
- struct env_var *ep;
- vm_offset_t addr, last;
- size_t len;
-
- addr = last = start;
-
- /* Traverse the environment. */
- for (ep = environ; ep != NULL; ep = ep->ev_next) {
- len = strlen(ep->ev_name);
- if (ia64_copyin(ep->ev_name, addr, len) != len)
- break;
- addr += len;
- if (ia64_copyin("=", addr, 1) != 1)
- break;
- addr++;
- if (ep->ev_value != NULL) {
- len = strlen(ep->ev_value);
- if (ia64_copyin(ep->ev_value, addr, len) != len)
- break;
- addr += len;
- }
- if (ia64_copyin("", addr, 1) != 1)
- break;
- last = ++addr;
- }
-
- if (ia64_copyin("", last++, 1) != 1)
- last = start;
- return(last);
-}
-
-/*
- * Copy module-related data into the load area, where it can be
- * used as a directory for loaded modules.
- *
- * Module data is presented in a self-describing format. Each datum
- * is preceded by a 32-bit identifier and a 32-bit size field.
- *
- * Currently, the following data are saved:
- *
- * MOD_NAME (variable) module name (string)
- * MOD_TYPE (variable) module type (string)
- * MOD_ARGS (variable) module parameters (string)
- * MOD_ADDR sizeof(vm_offset_t) module load address
- * MOD_SIZE sizeof(size_t) module size
- * MOD_METADATA (variable) type-specific metadata
- */
-#define COPY32(v, a) { \
- u_int32_t x = (v); \
- ia64_copyin(&x, a, sizeof(x)); \
- a += sizeof(x); \
-}
-
-#define MOD_STR(t, a, s) { \
- COPY32(t, a); \
- COPY32(strlen(s) + 1, a); \
- ia64_copyin(s, a, strlen(s) + 1); \
- a += roundup(strlen(s) + 1, sizeof(u_int64_t));\
-}
-
-#define MOD_NAME(a, s) MOD_STR(MODINFO_NAME, a, s)
-#define MOD_TYPE(a, s) MOD_STR(MODINFO_TYPE, a, s)
-#define MOD_ARGS(a, s) MOD_STR(MODINFO_ARGS, a, s)
-
-#define MOD_VAR(t, a, s) { \
- COPY32(t, a); \
- COPY32(sizeof(s), a); \
- ia64_copyin(&s, a, sizeof(s)); \
- a += roundup(sizeof(s), sizeof(u_int64_t)); \
-}
-
-#define MOD_ADDR(a, s) MOD_VAR(MODINFO_ADDR, a, s)
-#define MOD_SIZE(a, s) MOD_VAR(MODINFO_SIZE, a, s)
-
-#define MOD_METADATA(a, mm) { \
- COPY32(MODINFO_METADATA | mm->md_type, a); \
- COPY32(mm->md_size, a); \
- ia64_copyin(mm->md_data, a, mm->md_size); \
- a += roundup(mm->md_size, sizeof(u_int64_t));\
-}
-
-#define MOD_END(a) { \
- COPY32(MODINFO_END, a); \
- COPY32(0, a); \
-}
-
-vm_offset_t
-bi_copymodules(vm_offset_t addr)
-{
- struct preloaded_file *fp;
- struct file_metadata *md;
-
- /* Start with the first module on the list, should be the kernel. */
- for (fp = file_findfile(NULL, NULL); fp != NULL; fp = fp->f_next) {
- /* The name field must come first. */
- MOD_NAME(addr, fp->f_name);
- MOD_TYPE(addr, fp->f_type);
- if (fp->f_args)
- MOD_ARGS(addr, fp->f_args);
- MOD_ADDR(addr, fp->f_addr);
- MOD_SIZE(addr, fp->f_size);
- for (md = fp->f_metadata; md != NULL; md = md->md_next) {
- if (!(md->md_type & MODINFOMD_NOCOPY))
- MOD_METADATA(addr, md);
- }
- }
- MOD_END(addr);
- return(addr);
-}
-
-/*
- * Load the information expected by the kernel.
- *
- * - The kernel environment is copied into kernel space.
- * - Module metadata are formatted and placed in kernel space.
- */
-int
-ia64_bootinfo(struct preloaded_file *fp, struct bootinfo **res)
-{
- struct bootinfo bi;
- struct preloaded_file *xp;
- struct file_metadata *md;
- struct devdesc *rootdev;
- char *rootdevname;
- vm_offset_t addr, ssym, esym;
- int error;
-
- *res = NULL;
- bzero(&bi, sizeof(struct bootinfo));
- bi.bi_magic = BOOTINFO_MAGIC;
- bi.bi_version = 1;
- bi.bi_boothowto = bi_getboothowto(fp->f_args);
-
- /*
- * Allow the environment variable 'rootdev' to override the supplied
- * device. This should perhaps go to MI code and/or have $rootdev
- * tested/set by MI code before launching the kernel.
- */
- rootdevname = getenv("rootdev");
- ia64_getdev((void**)&rootdev, rootdevname, NULL);
- if (rootdev != NULL) {
- /* Try reading /etc/fstab to select the root device. */
- getrootmount(ia64_fmtdev(rootdev));
- free(rootdev);
- }
-
- md = file_findmetadata(fp, MODINFOMD_SSYM);
- ssym = (md != NULL) ? *((vm_offset_t *)&(md->md_data)) : 0;
- md = file_findmetadata(fp, MODINFOMD_ESYM);
- esym = (md != NULL) ? *((vm_offset_t *)&(md->md_data)) : 0;
- if (ssym != 0 && esym != 0) {
- bi.bi_symtab = ssym;
- bi.bi_esymtab = esym;
- }
-
- /* Find the last module in the chain. */
- addr = 0;
- for (xp = file_findfile(NULL, NULL); xp != NULL; xp = xp->f_next) {
- if (addr < (xp->f_addr + xp->f_size))
- addr = xp->f_addr + xp->f_size;
- }
-
- addr = (addr + 15) & ~15;
-
- /* Copy module list and metadata. */
- bi.bi_modulep = addr;
- addr = bi_copymodules(addr);
- if (addr <= bi.bi_modulep) {
- addr = bi.bi_modulep;
- bi.bi_modulep = 0;
- }
-
- addr = (addr + 15) & ~15;
-
- /* Copy our environment. */
- bi.bi_envp = addr;
- addr = bi_copyenv(addr);
- if (addr <= bi.bi_envp) {
- addr = bi.bi_envp;
- bi.bi_envp = 0;
- }
-
- addr = (addr + 15) & ~15;
- bi.bi_kernend = addr;
-
- error = ia64_platform_bootinfo(&bi, res);
- if (error)
- return (error);
-
- if (IS_LEGACY_KERNEL()) {
- if (*res == NULL)
- return (EDOOFUS);
-
- bcopy(&bi, *res, sizeof(bi));
- return (0);
- }
-
- bi.bi_pbvm_pgtbl = (uintptr_t)ia64_pgtbl;
- bi.bi_pbvm_pgtblsz = ia64_pgtblsz;
- ia64_copyin((void *)bi.bi_memmap, addr, bi.bi_memmap_size);
- bi.bi_memmap = addr;
- addr = (addr + bi.bi_memmap_size + 15) & ~15;
- bi.bi_kernend = addr + sizeof(bi);
- ia64_copyin(&bi, addr, sizeof(bi));
- *res = (void *)addr;
- return (0);
-}
diff --git a/sys/boot/ia64/common/copy.c b/sys/boot/ia64/common/copy.c
deleted file mode 100644
index b14386e..0000000
--- a/sys/boot/ia64/common/copy.c
+++ /dev/null
@@ -1,217 +0,0 @@
-/*-
- * Copyright (c) 2006 Marcel Moolenaar
- * 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 ``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 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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <stand.h>
-#include <machine/param.h>
-#include <machine/pte.h>
-
-#include "libia64.h"
-
-u_int ia64_legacy_kernel;
-
-uint64_t *ia64_pgtbl;
-uint32_t ia64_pgtblsz;
-
-static int
-pgtbl_extend(u_int idx)
-{
- vm_paddr_t pa;
- uint64_t *pgtbl;
- uint32_t pgtblsz;
- u_int pot;
-
- pgtblsz = (idx + 1) << 3;
-
- /* The minimum size is 4KB. */
- if (pgtblsz < 4096)
- pgtblsz = 4096;
-
- /* Find the next higher power of 2. */
- pgtblsz--;
- for (pot = 1; pot < 32; pot <<= 1)
- pgtblsz = pgtblsz | (pgtblsz >> pot);
- pgtblsz++;
-
- /* The maximum size is 1MB. */
- if (pgtblsz > 1048576)
- return (ENOMEM);
-
- /* Make sure the size is a valid (mappable) page size. */
- if (pgtblsz == 32*1024 || pgtblsz == 128*1024 || pgtblsz == 512*1024)
- pgtblsz <<= 1;
-
- /* Allocate naturally aligned memory. */
- pa = ia64_platform_alloc(0, pgtblsz);
- if (pa == ~0UL)
- return (ENOMEM);
- pgtbl = (void *)pa;
-
- /* Initialize new page table. */
- if (ia64_pgtbl != NULL && ia64_pgtbl != pgtbl)
- bcopy(ia64_pgtbl, pgtbl, ia64_pgtblsz);
- bzero(pgtbl + (ia64_pgtblsz >> 3), pgtblsz - ia64_pgtblsz);
-
- if (ia64_pgtbl != NULL && ia64_pgtbl != pgtbl)
- ia64_platform_free(0, (uintptr_t)ia64_pgtbl, ia64_pgtblsz);
-
- ia64_pgtbl = pgtbl;
- ia64_pgtblsz = pgtblsz;
- return (0);
-}
-
-void *
-ia64_va2pa(vm_offset_t va, size_t *len)
-{
- uint64_t pa, pte;
- u_int idx, ofs;
- int error;
-
- /* Backward compatibility. */
- if (va >= IA64_RR_BASE(7)) {
- ia64_legacy_kernel = 1;
- pa = IA64_RR_MASK(va);
- return ((void *)pa);
- }
-
- if (va < IA64_PBVM_BASE) {
- error = EINVAL;
- goto fail;
- }
-
- ia64_legacy_kernel = 0;
-
- idx = (va - IA64_PBVM_BASE) >> IA64_PBVM_PAGE_SHIFT;
- if (idx >= (ia64_pgtblsz >> 3)) {
- error = pgtbl_extend(idx);
- if (error)
- goto fail;
- }
-
- ofs = va & IA64_PBVM_PAGE_MASK;
- pte = ia64_pgtbl[idx];
- if ((pte & PTE_PRESENT) == 0) {
- pa = ia64_platform_alloc(va - ofs, IA64_PBVM_PAGE_SIZE);
- if (pa == ~0UL) {
- error = ENOMEM;
- goto fail;
- }
- pte = PTE_AR_RWX | PTE_DIRTY | PTE_ACCESSED | PTE_PRESENT;
- pte |= (pa & PTE_PPN_MASK);
- ia64_pgtbl[idx] = pte;
- }
- pa = (pte & PTE_PPN_MASK) + ofs;
-
- /* We can not cross page boundaries (in general). */
- if (*len + ofs > IA64_PBVM_PAGE_SIZE)
- *len = IA64_PBVM_PAGE_SIZE - ofs;
-
- return ((void *)pa);
-
- fail:
- *len = 0;
- return (NULL);
-}
-
-ssize_t
-ia64_copyin(const void *src, vm_offset_t va, size_t len)
-{
- void *pa;
- ssize_t res;
- size_t sz;
-
- res = 0;
- while (len > 0) {
- sz = len;
- pa = ia64_va2pa(va, &sz);
- if (sz == 0)
- break;
- bcopy(src, pa, sz);
- len -= sz;
- res += sz;
- va += sz;
- }
- return (res);
-}
-
-ssize_t
-ia64_copyout(vm_offset_t va, void *dst, size_t len)
-{
- void *pa;
- ssize_t res;
- size_t sz;
-
- res = 0;
- while (len > 0) {
- sz = len;
- pa = ia64_va2pa(va, &sz);
- if (sz == 0)
- break;
- bcopy(pa, dst, sz);
- len -= sz;
- res += sz;
- va += sz;
- }
- return (res);
-}
-
-uint64_t
-ia64_loadaddr(u_int type, void *data, uint64_t addr)
-{
- uint64_t align;
-
- /*
- * Align ELF objects at PBVM page boundaries. Align all other
- * objects at cache line boundaries for good measure.
- */
- align = (type == LOAD_ELF) ? IA64_PBVM_PAGE_SIZE : CACHE_LINE_SIZE;
- return ((addr + align - 1) & ~(align - 1));
-}
-
-ssize_t
-ia64_readin(int fd, vm_offset_t va, size_t len)
-{
- void *pa;
- ssize_t res, s;
- size_t sz;
-
- res = 0;
- while (len > 0) {
- sz = len;
- pa = ia64_va2pa(va, &sz);
- if (sz == 0)
- break;
- s = read(fd, pa, sz);
- if (s <= 0)
- break;
- len -= s;
- res += s;
- va += s;
- }
- return (res);
-}
diff --git a/sys/boot/ia64/common/devicename.c b/sys/boot/ia64/common/devicename.c
deleted file mode 100644
index 08d9b54..0000000
--- a/sys/boot/ia64/common/devicename.c
+++ /dev/null
@@ -1,169 +0,0 @@
-/*-
- * Copyright (c) 1998 Michael Smith <msmith@freebsd.org>
- * Copyright (c) 2006 Marcel Moolenaar
- * 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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <stand.h>
-#include <string.h>
-#include <sys/disklabel.h>
-#include "bootstrap.h"
-
-#include <efi.h>
-#include <efilib.h>
-
-static int ia64_parsedev(struct devdesc **, const char *, const char **);
-
-/*
- * Point (dev) at an allocated device specifier for the device matching the
- * path in (devspec). If it contains an explicit device specification,
- * use that. If not, use the default device.
- */
-int
-ia64_getdev(void **vdev, const char *devspec, const char **path)
-{
- struct devdesc **dev = (struct devdesc **)vdev;
- int rv;
-
- /*
- * If it looks like this is just a path and no device, then
- * use the current device instead.
- */
- if (devspec == NULL || *devspec == '/' || !strchr(devspec, ':')) {
- rv = ia64_parsedev(dev, getenv("currdev"), NULL);
- if (rv == 0 && path != NULL)
- *path = devspec;
- return (rv);
- }
-
- /* Parse the device name off the beginning of the devspec. */
- return (ia64_parsedev(dev, devspec, path));
-}
-
-/*
- * Point (dev) at an allocated device specifier matching the string version
- * at the beginning of (devspec). Return a pointer to the remaining
- * text in (path).
- *
- * In all cases, the beginning of (devspec) is compared to the names
- * of known devices in the device switch, and then any following text
- * is parsed according to the rules applied to the device type.
- *
- * For disk-type devices, the syntax is:
- *
- * fs<unit>:
- */
-static int
-ia64_parsedev(struct devdesc **dev, const char *devspec, const char **path)
-{
- struct devdesc *idev;
- struct devsw *dv;
- char *cp;
- const char *np;
- int i, err;
-
- /* minimum length check */
- if (strlen(devspec) < 2)
- return (EINVAL);
-
- /* look for a device that matches */
- for (i = 0; devsw[i] != NULL; i++) {
- dv = devsw[i];
- if (!strncmp(devspec, dv->dv_name, strlen(dv->dv_name)))
- break;
- }
- if (devsw[i] == NULL)
- return (ENOENT);
-
- idev = malloc(sizeof(struct devdesc));
- if (idev == NULL)
- return (ENOMEM);
-
- idev->d_dev = dv;
- idev->d_type = dv->dv_type;
- idev->d_unit = -1;
-
- err = 0;
- np = devspec + strlen(dv->dv_name);
- if (*np != '\0' && *np != ':') {
- idev->d_unit = strtol(np, &cp, 0);
- if (cp == np) {
- idev->d_unit = -1;
- free(idev);
- return (EUNIT);
- }
- }
- if (*cp != '\0' && *cp != ':') {
- free(idev);
- return (EINVAL);
- }
-
- if (path != NULL)
- *path = (*cp == 0) ? cp : cp + 1;
- if (dev != NULL)
- *dev = idev;
- else
- free(idev);
- return (0);
-}
-
-char *
-ia64_fmtdev(void *vdev)
-{
- struct devdesc *dev = (struct devdesc *)vdev;
- static char buf[32]; /* XXX device length constant? */
-
- switch(dev->d_type) {
- case DEVT_NONE:
- strcpy(buf, "(no device)");
- break;
-
- default:
- sprintf(buf, "%s%d:", dev->d_dev->dv_name, dev->d_unit);
- break;
- }
-
- return(buf);
-}
-
-/*
- * Set currdev to suit the value being supplied in (value)
- */
-int
-ia64_setcurrdev(struct env_var *ev, int flags, const void *value)
-{
- struct devdesc *ncurr;
- int rv;
-
- rv = ia64_parsedev(&ncurr, value, NULL);
- if (rv != 0)
- return(rv);
-
- free(ncurr);
- env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL);
- return (0);
-}
diff --git a/sys/boot/ia64/common/exec.c b/sys/boot/ia64/common/exec.c
deleted file mode 100644
index b721f97..0000000
--- a/sys/boot/ia64/common/exec.c
+++ /dev/null
@@ -1,268 +0,0 @@
-/*-
- * Copyright (c) 2006 Marcel Moolenaar
- * 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 ``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 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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <stand.h>
-#include <string.h>
-
-#include <sys/param.h>
-#include <sys/linker.h>
-#include <machine/elf.h>
-#include <machine/ia64_cpu.h>
-#include <machine/pte.h>
-
-#include <efi.h>
-#include <efilib.h>
-
-#include "libia64.h"
-
-static u_int itr_idx = 0;
-static u_int dtr_idx = 0;
-
-static vm_offset_t ia64_text_start;
-static size_t ia64_text_size;
-
-static vm_offset_t ia64_data_start;
-static size_t ia64_data_size;
-
-static int elf64_exec(struct preloaded_file *amp);
-static int elf64_obj_exec(struct preloaded_file *amp);
-
-static struct file_format ia64_elf = {
- elf64_loadfile,
- elf64_exec
-};
-static struct file_format ia64_elf_obj = {
- elf64_obj_loadfile,
- elf64_obj_exec
-};
-
-struct file_format *file_formats[] = {
- &ia64_elf,
- &ia64_elf_obj,
- NULL
-};
-
-static u_int
-sz2shft(vm_offset_t ofs, vm_size_t sz)
-{
- vm_size_t s;
- u_int shft;
-
- shft = 12; /* Start with 4K */
- s = 1 << shft;
- while (s <= sz) {
- shft++;
- s <<= 1;
- }
- do {
- shft--;
- s >>= 1;
- } while (ofs & (s - 1));
-
- return (shft);
-}
-
-/*
- * Entered with psr.ic and psr.i both zero.
- */
-static void
-enter_kernel(uint64_t start, struct bootinfo *bi)
-{
-
- __asm __volatile("srlz.i;;");
- __asm __volatile("mov cr.ipsr=%0"
- :: "r"(IA64_PSR_IC
- | IA64_PSR_DT
- | IA64_PSR_RT
- | IA64_PSR_IT
- | IA64_PSR_BN));
- __asm __volatile("mov cr.iip=%0" :: "r"(start));
- __asm __volatile("mov cr.ifs=r0;;");
- __asm __volatile("mov ar.rsc=0;; flushrs;;");
- __asm __volatile("mov r8=%0" :: "r" (bi));
- __asm __volatile("rfi;;");
-
- /* NOTREACHED */
-}
-
-static u_int
-mmu_wire(vm_offset_t va, vm_paddr_t pa, u_int pgshft, u_int acc)
-{
- pt_entry_t pte;
-
- /* Round up to the smallest possible page size. */
- if (pgshft < 12)
- pgshft = 12;
- /* Truncate to the largest possible page size (256MB). */
- if (pgshft > 28)
- pgshft = 28;
- /* Round down to a valid (mappable) page size. */
- if (pgshft > 14 && (pgshft & 1) != 0)
- pgshft--;
-
- pte = PTE_PRESENT | PTE_MA_WB | PTE_ACCESSED | PTE_DIRTY |
- PTE_PL_KERN | (acc & PTE_AR_MASK) | (pa & PTE_PPN_MASK);
-
- __asm __volatile("mov cr.ifa=%0" :: "r"(va));
- __asm __volatile("mov cr.itir=%0" :: "r"(pgshft << 2));
- __asm __volatile("srlz.d;;");
-
- __asm __volatile("ptr.d %0,%1" :: "r"(va), "r"(pgshft << 2));
- __asm __volatile("srlz.d;;");
- __asm __volatile("itr.d dtr[%0]=%1" :: "r"(dtr_idx), "r"(pte));
- __asm __volatile("srlz.d;;");
- dtr_idx++;
-
- if (acc == PTE_AR_RWX || acc == PTE_AR_RX) {
- __asm __volatile("ptr.i %0,%1;;" :: "r"(va), "r"(pgshft << 2));
- __asm __volatile("srlz.i;;");
- __asm __volatile("itr.i itr[%0]=%1;;" :: "r"(itr_idx), "r"(pte));
- __asm __volatile("srlz.i;;");
- itr_idx++;
- }
-
- return (pgshft);
-}
-
-static void
-mmu_setup_legacy(uint64_t entry)
-{
-
- /*
- * Region 6 is direct mapped UC and region 7 is direct mapped
- * WC. The details of this is controlled by the Alt {I,D}TLB
- * handlers. Here we just make sure that they have the largest
- * possible page size to minimise TLB usage.
- */
- ia64_set_rr(IA64_RR_BASE(6), (6 << 8) | (28 << 2));
- ia64_set_rr(IA64_RR_BASE(7), (7 << 8) | (28 << 2));
- __asm __volatile("srlz.i;;");
-
- mmu_wire(entry, IA64_RR_MASK(entry), 28, PTE_AR_RWX);
-}
-
-static void
-mmu_setup_paged(struct bootinfo *bi)
-{
- void *pa;
- size_t sz;
- u_int shft;
-
- ia64_set_rr(IA64_RR_BASE(IA64_PBVM_RR),
- (IA64_PBVM_RR << 8) | (IA64_PBVM_PAGE_SHIFT << 2));
- __asm __volatile("srlz.i;;");
-
- /* Wire the PBVM page table. */
- mmu_wire(IA64_PBVM_PGTBL, (uintptr_t)ia64_pgtbl,
- sz2shft(IA64_PBVM_PGTBL, ia64_pgtblsz), PTE_AR_RW);
-
- /* Wire as much of the text segment as we can. */
- sz = ia64_text_size; /* XXX */
- pa = ia64_va2pa(ia64_text_start, &ia64_text_size);
- ia64_text_size = sz; /* XXX */
- shft = sz2shft(ia64_text_start, ia64_text_size);
- shft = mmu_wire(ia64_text_start, (uintptr_t)pa, shft, PTE_AR_RWX);
- ia64_copyin(&shft, (uintptr_t)&bi->bi_text_mapped, 4);
-
- /* Wire as much of the data segment as well. */
- sz = ia64_data_size; /* XXX */
- pa = ia64_va2pa(ia64_data_start, &ia64_data_size);
- ia64_data_size = sz; /* XXX */
- shft = sz2shft(ia64_data_start, ia64_data_size);
- shft = mmu_wire(ia64_data_start, (uintptr_t)pa, shft, PTE_AR_RW);
- ia64_copyin(&shft, (uintptr_t)&bi->bi_data_mapped, 4);
-
- /* Update the bootinfo with the number of TRs used. */
- ia64_copyin(&itr_idx, (uintptr_t)&bi->bi_itr_used, 4);
- ia64_copyin(&dtr_idx, (uintptr_t)&bi->bi_dtr_used, 4);
-}
-
-static int
-elf64_exec(struct preloaded_file *fp)
-{
- struct bootinfo *bi;
- struct file_metadata *md;
- Elf_Ehdr *hdr;
- int error;
-
- md = file_findmetadata(fp, MODINFOMD_ELFHDR);
- if (md == NULL)
- return (EINVAL);
-
- error = ia64_bootinfo(fp, &bi);
- if (error)
- return (error);
-
- hdr = (Elf_Ehdr *)&(md->md_data);
- printf("Entering %s at 0x%lx...\n", fp->f_name, hdr->e_entry);
-
- error = ia64_platform_enter(fp->f_name);
- if (error)
- return (error);
-
- __asm __volatile("rsm psr.ic|psr.i;;");
- __asm __volatile("srlz.i;;");
-
- if (IS_LEGACY_KERNEL())
- mmu_setup_legacy(hdr->e_entry);
- else
- mmu_setup_paged(bi);
-
- enter_kernel(hdr->e_entry, bi);
- /* NOTREACHED */
- return (EDOOFUS);
-}
-
-static int
-elf64_obj_exec(struct preloaded_file *fp)
-{
-
- printf("%s called for preloaded file %p (=%s):\n", __func__, fp,
- fp->f_name);
- return (ENOSYS);
-}
-
-void
-ia64_loadseg(Elf_Ehdr *eh, Elf_Phdr *ph, uint64_t delta)
-{
-
- if (eh->e_type != ET_EXEC)
- return;
-
- if (ph->p_flags & PF_X) {
- ia64_text_start = ph->p_vaddr + delta;
- ia64_text_size = ph->p_memsz;
-
- ia64_sync_icache(ia64_text_start, ia64_text_size);
- } else {
- ia64_data_start = ph->p_vaddr + delta;
- ia64_data_size = ph->p_memsz;
- }
-}
-
diff --git a/sys/boot/ia64/common/icache.c b/sys/boot/ia64/common/icache.c
deleted file mode 100644
index 77a35d7..0000000
--- a/sys/boot/ia64/common/icache.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/*-
- * Copyright (c) 2011 Marcel Moolenaar
- * 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 ``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 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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <stand.h>
-#include <machine/ia64_cpu.h>
-
-#include "libia64.h"
-
-void
-ia64_sync_icache(vm_offset_t va, size_t sz)
-{
- uintptr_t pa;
- size_t cnt, max;
-
- while (sz > 0) {
- max = sz;
- pa = (uintptr_t)ia64_va2pa(va, &max);
- for (cnt = 0; cnt < max; cnt += 32)
- ia64_fc_i(pa + cnt);
- ia64_sync_i();
- va += max;
- sz -= max;
- }
- ia64_srlz_i();
-}
diff --git a/sys/boot/ia64/common/libia64.h b/sys/boot/ia64/common/libia64.h
deleted file mode 100644
index 4bc7638..0000000
--- a/sys/boot/ia64/common/libia64.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*-
- * Copyright (c) 2006 Marcel Moolenaar
- * 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 ``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 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$
- */
-
-#ifndef _LIBIA64_H_
-#define _LIBIA64_H_
-
-#include <bootstrap.h>
-#include <ia64/include/bootinfo.h>
-#include <machine/vmparam.h>
-
-#define IS_LEGACY_KERNEL() (ia64_legacy_kernel)
-
-/*
- * Portability functions provided by the loader
- * implementation specific to the platform.
- */
-vm_paddr_t ia64_platform_alloc(vm_offset_t, vm_size_t);
-void ia64_platform_free(vm_offset_t, vm_paddr_t, vm_size_t);
-int ia64_platform_bootinfo(struct bootinfo *, struct bootinfo **);
-int ia64_platform_enter(const char *);
-
-/*
- * Functions and variables provided by the ia64 common code
- * and shared by all loader implementations.
- */
-extern u_int ia64_legacy_kernel;
-
-extern uint64_t *ia64_pgtbl;
-extern uint32_t ia64_pgtblsz;
-
-int ia64_autoload(void);
-int ia64_bootinfo(struct preloaded_file *, struct bootinfo **);
-uint64_t ia64_loadaddr(u_int, void *, uint64_t);
-#ifdef __elfN
-void ia64_loadseg(Elf_Ehdr *, Elf_Phdr *, uint64_t);
-#else
-void ia64_loadseg(void *, void *, uint64_t);
-#endif
-
-ssize_t ia64_copyin(const void *, vm_offset_t, size_t);
-ssize_t ia64_copyout(vm_offset_t, void *, size_t);
-void ia64_sync_icache(vm_offset_t, size_t);
-ssize_t ia64_readin(int, vm_offset_t, size_t);
-void *ia64_va2pa(vm_offset_t, size_t *);
-
-char *ia64_fmtdev(struct devdesc *);
-int ia64_getdev(void **, const char *, const char **);
-int ia64_setcurrdev(struct env_var *, int, const void *);
-
-#endif /* !_LIBIA64_H_ */
diff --git a/sys/boot/ia64/efi/Makefile b/sys/boot/ia64/efi/Makefile
deleted file mode 100644
index fc11d6e..0000000
--- a/sys/boot/ia64/efi/Makefile
+++ /dev/null
@@ -1,59 +0,0 @@
-# $FreeBSD$
-
-MAN=
-
-.include <src.opts.mk>
-MK_SSP= no
-
-PROG= loader.sym
-INTERNALPROG=
-SRCS= conf.c efimd.c main.c pal.S start.S vers.c
-
-.PATH: ${.CURDIR}/../../../${MACHINE_CPUARCH}/${MACHINE_CPUARCH}
-
-CFLAGS+= -I${.CURDIR}/../common
-CFLAGS+= -I${.CURDIR}/../../common
-CFLAGS+= -I${.CURDIR}/../../efi/include
-CFLAGS+= -I${.CURDIR}/../../efi/include/${MACHINE_CPUARCH}
-CFLAGS+= -I${.CURDIR}/../../..
-CFLAGS+= -I${.CURDIR}/../../../../lib/libstand
-
-LDSCRIPT= ${.CURDIR}/ldscript.${MACHINE_CPUARCH}
-LDFLAGS= -Wl,-T${LDSCRIPT} -shared -symbolic
-
-${PROG}: ${LDSCRIPT}
-
-NEWVERSWHAT= "EFI boot" ${MACHINE_CPUARCH}
-
-vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
- sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
-
-OBJCOPY?= objcopy
-OBJDUMP?= objdump
-
-FILES= loader.efi
-FILESMODE_loader.efi= ${BINMODE}
-
-loader.efi: loader.sym
- if [ `${OBJDUMP} -t ${.ALLSRC} | fgrep '*UND*' | wc -l` != 0 ]; then \
- ${OBJDUMP} -t ${.ALLSRC} | fgrep '*UND*'; \
- rm ${.ALLSRC}; \
- exit 1; \
- fi
- ${OBJCOPY} -j .data -j .dynamic -j .dynstr -j .dynsym -j .hash \
- -j .rela.dyn -j .reloc -j .sdata -j .text \
- --target=efi-app-${MACHINE_CPUARCH} ${.ALLSRC} ${.TARGET}
-
-CLEANFILES= vers.c loader.efi
-
-LIBIA64= ${.OBJDIR}/../common/libia64.a
-LIBEFI= ${.OBJDIR}/../../efi/libefi/libefi.a
-.if ${MK_FORTH} != "no"
-LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
-.endif
-
-DPADD= ${LIBIA64} ${LIBFICL} ${LIBEFI} ${LIBSTAND}
-LDADD= -Wl,--whole-archive ${LIBIA64} -Wl,--no-whole-archive \
- ${LIBFICL} ${LIBEFI} -lstand
-
-.include <bsd.prog.mk>
diff --git a/sys/boot/ia64/efi/conf.c b/sys/boot/ia64/efi/conf.c
deleted file mode 100644
index 0e0d129..0000000
--- a/sys/boot/ia64/efi/conf.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/*-
- * Copyright (c) 1997
- * Matthias Drochner. 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.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed for the NetBSD Project
- * by Matthias Drochner.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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.
- *
- * $NetBSD: conf.c,v 1.2 1997/03/22 09:03:29 thorpej Exp $
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <stand.h>
-#include <efi.h>
-#include <efilib.h>
-
-/*
- * We could use linker sets for some or all of these, but
- * then we would have to control what ended up linked into
- * the bootstrap. So it's easier to conditionalise things
- * here.
- *
- * XXX rename these arrays to be consistent and less namespace-hostile
- */
-
-/* Exported for libstand */
-struct devsw *devsw[] = {
- &efipart_dev,
- &efinet_dev,
- NULL
-};
-
-struct fs_ops *file_system[] = {
- &dosfs_fsops,
- &ufs_fsops,
- &cd9660_fsops,
- &nfs_fsops,
- &gzipfs_fsops,
- NULL
-};
-
-struct netif_driver *netif_drivers[] = {
- &efinetif,
- NULL
-};
-
-/*
- * Consoles
- *
- * We don't prototype these in efiboot.h because they require
- * data structures from bootstrap.h as well.
- */
-extern struct console efi_console;
-
-struct console *consoles[] = {
- &efi_console,
- NULL
-};
diff --git a/sys/boot/ia64/efi/efimd.c b/sys/boot/ia64/efi/efimd.c
deleted file mode 100644
index 0b29e12..0000000
--- a/sys/boot/ia64/efi/efimd.c
+++ /dev/null
@@ -1,264 +0,0 @@
-/*-
- * Copyright (c) 2004, 2006 Marcel Moolenaar
- * 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 ``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 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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <stand.h>
-
-#include <efi.h>
-#include <efilib.h>
-
-#include <libia64.h>
-
-#define EFI_INTEL_FPSWA \
- {0xc41b6531,0x97b9,0x11d3,{0x9a,0x29,0x00,0x90,0x27,0x3f,0xc1,0x4d}}
-
-static EFI_GUID fpswa_guid = EFI_INTEL_FPSWA;
-
-/* DIG64 Headless Console & Debug Port Table. */
-#define HCDP_TABLE_GUID \
- {0xf951938d,0x620b,0x42ef,{0x82,0x79,0xa8,0x4b,0x79,0x61,0x78,0x98}}
-
-static EFI_GUID hcdp_guid = HCDP_TABLE_GUID;
-
-static EFI_MEMORY_DESCRIPTOR *memmap;
-static UINTN memmapsz;
-static UINTN mapkey;
-static UINTN descsz;
-static UINT32 descver;
-
-#define IA64_EFI_CHUNK_SIZE (32 * 1048576)
-static vm_paddr_t ia64_efi_chunk;
-
-#define IA64_EFI_PGTBLSZ_MAX 1048576
-static vm_paddr_t ia64_efi_pgtbl;
-static vm_size_t ia64_efi_pgtblsz;
-
-/* Don't allocate memory below the boundary */
-#define IA64_EFI_ALLOC_BOUNDARY 1048576
-
-static int
-ia64_efi_memmap_update(void)
-{
- EFI_STATUS status;
-
- if (memmap != NULL) {
- free(memmap);
- memmap = NULL;
- }
-
- memmapsz = 0;
- BS->GetMemoryMap(&memmapsz, NULL, &mapkey, &descsz, &descver);
- if (memmapsz == 0)
- return (FALSE);
- memmap = malloc(memmapsz);
- if (memmap == NULL)
- return (FALSE);
-
- status = BS->GetMemoryMap(&memmapsz, memmap, &mapkey, &descsz,
- &descver);
- if (EFI_ERROR(status)) {
- free(memmap);
- memmap = NULL;
- return (FALSE);
- }
-
- return (TRUE);
-}
-
-/*
- * Returns 0 on failure. Successful allocations return an address
- * larger or equal to IA64_EFI_ALLOC_BOUNDARY.
- */
-static vm_paddr_t
-ia64_efi_alloc(vm_size_t sz)
-{
- EFI_PHYSICAL_ADDRESS pa;
- EFI_MEMORY_DESCRIPTOR *mm;
- uint8_t *mmiter, *mmiterend;
- vm_size_t memsz;
- UINTN npgs;
- EFI_STATUS status;
-
- /* We can't allocate less than a page */
- if (sz < EFI_PAGE_SIZE)
- return (0);
-
- /* The size must be a power of 2. */
- if (sz & (sz - 1))
- return (0);
-
- if (!ia64_efi_memmap_update())
- return (0);
-
- mmiter = (void *)memmap;
- mmiterend = mmiter + memmapsz;
- for (; mmiter < mmiterend; mmiter += descsz) {
- mm = (void *)mmiter;
- if (mm->Type != EfiConventionalMemory)
- continue;
- memsz = mm->NumberOfPages * EFI_PAGE_SIZE;
- if (mm->PhysicalStart + memsz <= IA64_EFI_ALLOC_BOUNDARY)
- continue;
- /*
- * XXX We really should make sure the memory is local to the
- * BSP.
- */
- pa = (mm->PhysicalStart < IA64_EFI_ALLOC_BOUNDARY) ?
- IA64_EFI_ALLOC_BOUNDARY : mm->PhysicalStart;
- pa = (pa + sz - 1) & ~(sz - 1);
- if (pa + sz > mm->PhysicalStart + memsz)
- continue;
-
- npgs = EFI_SIZE_TO_PAGES(sz);
- status = BS->AllocatePages(AllocateAddress, EfiLoaderData,
- npgs, &pa);
- if (!EFI_ERROR(status))
- return (pa);
- }
-
- printf("%s: unable to allocate %lx bytes\n", __func__, sz);
- return (0);
-}
-
-vm_paddr_t
-ia64_platform_alloc(vm_offset_t va, vm_size_t sz)
-{
- vm_paddr_t pa;
-
- if (va == 0) {
- /* Page table itself. */
- if (sz > IA64_EFI_PGTBLSZ_MAX)
- return (~0UL);
- if (ia64_efi_pgtbl == 0)
- ia64_efi_pgtbl = ia64_efi_alloc(IA64_EFI_PGTBLSZ_MAX);
- if (ia64_efi_pgtbl != 0)
- ia64_efi_pgtblsz = sz;
- return (ia64_efi_pgtbl);
- } else if (va < IA64_PBVM_BASE) {
- /* Should not happen. */
- return (~0UL);
- }
-
- /* Loader virtual memory page. */
- va -= IA64_PBVM_BASE;
-
- /* Allocate a big chunk that can be wired with a single PTE. */
- if (ia64_efi_chunk == 0)
- ia64_efi_chunk = ia64_efi_alloc(IA64_EFI_CHUNK_SIZE);
- if (va < IA64_EFI_CHUNK_SIZE)
- return (ia64_efi_chunk + va);
-
- /* Allocate a page at a time when we go beyond the chunk. */
- pa = ia64_efi_alloc(sz);
- return ((pa == 0) ? ~0UL : pa);
-}
-
-void
-ia64_platform_free(vm_offset_t va, vm_paddr_t pa, vm_size_t sz)
-{
-
- BS->FreePages(pa, sz >> EFI_PAGE_SHIFT);
-}
-
-int
-ia64_platform_bootinfo(struct bootinfo *bi, struct bootinfo **res)
-{
- VOID *fpswa;
- EFI_HANDLE handle;
- EFI_STATUS status;
- UINTN sz;
-
- bi->bi_systab = (uint64_t)ST;
- bi->bi_hcdp = (uint64_t)efi_get_table(&hcdp_guid);
-
- sz = sizeof(EFI_HANDLE);
- status = BS->LocateHandle(ByProtocol, &fpswa_guid, 0, &sz, &handle);
- if (status == 0)
- status = BS->HandleProtocol(handle, &fpswa_guid, &fpswa);
- bi->bi_fpswa = (status == 0) ? (uint64_t)fpswa : 0;
-
- if (!ia64_efi_memmap_update())
- return (ENOMEM);
-
- bi->bi_memmap = (uint64_t)memmap;
- bi->bi_memmap_size = memmapsz;
- bi->bi_memdesc_size = descsz;
- bi->bi_memdesc_version = descver;
-
- if (IS_LEGACY_KERNEL())
- *res = malloc(sizeof(**res));
-
- return (0);
-}
-
-int
-ia64_platform_enter(const char *kernel)
-{
- EFI_STATUS status;
-
- status = BS->ExitBootServices(IH, mapkey);
- if (EFI_ERROR(status)) {
- printf("%s: ExitBootServices() returned 0x%lx\n", __func__,
- (long)status);
- return (EINVAL);
- }
-
- return (0);
-}
-
-COMMAND_SET(pbvm, "pbvm", "show PBVM details", command_pbvm);
-
-static int
-command_pbvm(int argc, char *argv[])
-{
- uint64_t limit, pg, start;
- u_int idx;
-
- printf("Page table @ %p, size %x\n", ia64_pgtbl, ia64_pgtblsz);
-
- if (ia64_pgtbl == NULL)
- return (0);
-
- limit = ~0;
- start = ~0;
- idx = 0;
- while (ia64_pgtbl[idx] != 0) {
- pg = ia64_pgtbl[idx];
- if (pg != limit) {
- if (start != ~0)
- printf("%#lx-%#lx\n", start, limit);
- start = pg;
- }
- limit = pg + IA64_PBVM_PAGE_SIZE;
- idx++;
- }
- if (start != ~0)
- printf("%#lx-%#lx\n", start, limit);
-
- return (0);
-}
diff --git a/sys/boot/ia64/efi/ldscript.ia64 b/sys/boot/ia64/efi/ldscript.ia64
deleted file mode 100644
index 0d7901f..0000000
--- a/sys/boot/ia64/efi/ldscript.ia64
+++ /dev/null
@@ -1,73 +0,0 @@
-/* $FreeBSD$ */
-OUTPUT_FORMAT("elf64-ia64-freebsd", "elf64-ia64-freebsd", "elf64-ia64-freebsd")
-OUTPUT_ARCH(ia64)
-ENTRY(_start_plabel)
-SECTIONS
-{
- /* Read-only sections, merged into text segment: */
- . = 0;
- ImageBase = .;
- . = SIZEOF_HEADERS;
- . = ALIGN(4096);
- .text : {
- *(.text .stub .text.* .gnu.linkonce.t.*)
- /* .gnu.warning sections are handled specially by elf32.em. */
- *(.gnu.warning)
- *(.plt)
- } =0x00300000010070000002000001000400
- . = ALIGN(4096);
- __start_set_Xcommand_set = .;
- set_Xcommand_set : { *(set_Xcommand_set) }
- __stop_set_Xcommand_set = .;
- .data : {
- *(.rodata .rodata.* .gnu.linkonce.r.*)
- *(.rodata1)
- *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
- *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
- *(.opd)
- *(.data .data.* .gnu.linkonce.d.*)
- *(.data1)
- *(.plabel)
- *(.dynbss)
- *(.bss .bss.* .gnu.linkonce.b.*)
- *(COMMON)
- }
- .IA_64.unwind_info : { *(.IA_64.unwind_info* .gnu.linkonce.ia64unwi.*) }
- .IA_64.unwind : { *(.IA_64.unwind* .gnu.linkonce.ia64unw.*) }
- . = ALIGN(4096);
- __gp = .;
- .sdata : {
- *(.got.plt .got)
- *(.IA_64.pltoff)
- *(.sdata .sdata.* .gnu.linkonce.s.*)
- *(dynsbss)
- *(.sbss .sbss.* .gnu.linkonce.sb.*)
- *(.scommon)
- }
- . = ALIGN(4096);
- .dynamic : { *(.dynamic) }
- . = ALIGN(4096);
- .rela.dyn : {
- *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
- *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
- *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
- *(.rela.got)
- *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
- *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
- *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
- *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
- *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
- *(.rela.plt)
- *(.rela.IA_64.pltoff)
- *(.relaset_*)
- *(.rela.dyn .rela.dyn.*)
- }
- . = ALIGN(4096);
- .reloc : { *(.reloc) }
- . = ALIGN(4096);
- .hash : { *(.hash) }
- . = ALIGN(4096);
- .dynsym : { *(.dynsym) }
- . = ALIGN(4096);
- .dynstr : { *(.dynstr) }
-}
diff --git a/sys/boot/ia64/efi/main.c b/sys/boot/ia64/efi/main.c
deleted file mode 100644
index ec12b42..0000000
--- a/sys/boot/ia64/efi/main.c
+++ /dev/null
@@ -1,618 +0,0 @@
-/*-
- * Copyright (c) 1998 Michael Smith <msmith@freebsd.org>
- * Copyright (c) 1998,2000 Doug Rabson <dfr@freebsd.org>
- * 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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <stand.h>
-#include <string.h>
-#include <setjmp.h>
-#include <machine/sal.h>
-#include <machine/pal.h>
-#include <machine/pte.h>
-#include <machine/dig64.h>
-
-#include <efi.h>
-#include <efilib.h>
-
-#include <libia64.h>
-
-/* DIG64 Headless Console & Debug Port Table. */
-#define HCDP_TABLE_GUID \
- {0xf951938d,0x620b,0x42ef,{0x82,0x79,0xa8,0x4b,0x79,0x61,0x78,0x98}}
-
-extern char bootprog_name[];
-extern char bootprog_rev[];
-extern char bootprog_date[];
-extern char bootprog_maker[];
-
-struct arch_switch archsw; /* MI/MD interface boundary */
-
-extern u_int64_t ia64_pal_entry;
-
-EFI_GUID acpi = ACPI_TABLE_GUID;
-EFI_GUID acpi20 = ACPI_20_TABLE_GUID;
-EFI_GUID devid = DEVICE_PATH_PROTOCOL;
-EFI_GUID hcdp = HCDP_TABLE_GUID;
-EFI_GUID imgid = LOADED_IMAGE_PROTOCOL;
-EFI_GUID mps = MPS_TABLE_GUID;
-EFI_GUID netid = EFI_SIMPLE_NETWORK_PROTOCOL;
-EFI_GUID sal = SAL_SYSTEM_TABLE_GUID;
-EFI_GUID smbios = SMBIOS_TABLE_GUID;
-
-static void
-find_pal_proc(void)
-{
- int i;
- struct sal_system_table *saltab = 0;
- static int sizes[6] = {
- 48, 32, 16, 32, 16, 16
- };
- u_int8_t *p;
-
- saltab = efi_get_table(&sal);
- if (saltab == NULL) {
- printf("Can't find SAL System Table\n");
- return;
- }
-
- if (memcmp(saltab->sal_signature, "SST_", 4)) {
- printf("Bad signature for SAL System Table\n");
- return;
- }
-
- p = (u_int8_t *) (saltab + 1);
- for (i = 0; i < saltab->sal_entry_count; i++) {
- if (*p == 0) {
- struct sal_entrypoint_descriptor *dp;
- dp = (struct sal_entrypoint_descriptor *) p;
- ia64_pal_entry = dp->sale_pal_proc;
- return;
- }
- p += sizes[*p];
- }
-
- printf("Can't find PAL proc\n");
- return;
-}
-
-static int
-usc2cmp(CHAR16 *s1, CHAR16 *s2)
-{
-
- while (*s1 == *s2++) {
- if (*s1++ == 0)
- return (0);
- }
- return (*s1 - *(s2 - 1));
-}
-
-static char *
-get_dev_option(int argc, CHAR16 *argv[])
-{
- static char dev[32];
- CHAR16 *arg;
- char *devp;
- int i, j;
-
- devp = NULL;
- for (i = 0; i < argc; i++) {
- if (usc2cmp(argv[i], L"-dev") == 0 && i < argc - 1) {
- arg = argv[i + 1];
- j = 0;
- while (j < sizeof(dev) && *arg != 0)
- dev[j++] = *arg++;
- if (j == sizeof(dev))
- j--;
- dev[j] = '\0';
- devp = dev;
- break;
- }
- }
-
- return (devp);
-}
-
-EFI_STATUS
-main(int argc, CHAR16 *argv[])
-{
- struct devdesc currdev;
- EFI_LOADED_IMAGE *img;
- char *dev;
- int i;
-
- /*
- * XXX Chicken-and-egg problem; we want to have console output
- * early, but some console attributes may depend on reading from
- * eg. the boot device, which we can't do yet. We can use
- * printf() etc. once this is done.
- */
- cons_probe();
-
- printf("\n%s, Revision %s\n", bootprog_name, bootprog_rev);
-
- find_pal_proc();
-
- /*
- * March through the device switch probing for things.
- */
- for (i = 0; devsw[i] != NULL; i++)
- if (devsw[i]->dv_init != NULL)
- (devsw[i]->dv_init)();
-
- /*
- * Disable the watchdog timer. By default the boot manager sets
- * the timer to 5 minutes before invoking a boot option. If we
- * want to return to the boot manager, we have to disable the
- * watchdog timer and since we're an interactive program, we don't
- * want to wait until the user types "quit". The timer may have
- * fired by then. We don't care if this fails. It does not prevent
- * normal functioning in any way...
- */
- BS->SetWatchdogTimer(0, 0, 0, NULL);
-
- /* Get our loaded image protocol interface structure. */
- BS->HandleProtocol(IH, &imgid, (VOID**)&img);
-
- bzero(&currdev, sizeof(currdev));
- efi_handle_lookup(img->DeviceHandle, &currdev.d_dev, &currdev.d_unit);
- currdev.d_type = currdev.d_dev->dv_type;
-
- env_setenv("loaddev", EV_VOLATILE, ia64_fmtdev(&currdev), env_noset,
- env_nounset);
-
- dev = get_dev_option(argc, argv);
- if (dev == NULL)
- dev = ia64_fmtdev(&currdev);
-
- env_setenv("currdev", EV_VOLATILE, dev, ia64_setcurrdev, env_nounset);
-
- setenv("LINES", "24", 1); /* optional */
-
- archsw.arch_autoload = ia64_autoload;
- archsw.arch_copyin = ia64_copyin;
- archsw.arch_copyout = ia64_copyout;
- archsw.arch_getdev = ia64_getdev;
- archsw.arch_loadaddr = ia64_loadaddr;
- archsw.arch_loadseg = ia64_loadseg;
- archsw.arch_readin = ia64_readin;
-
- interact(); /* doesn't return */
-
- return (EFI_SUCCESS); /* keep compiler happy */
-}
-
-COMMAND_SET(quit, "quit", "exit the loader", command_quit);
-
-static int
-command_quit(int argc, char *argv[])
-{
- exit(0);
- /* NOTREACHED */
- return (CMD_OK);
-}
-
-COMMAND_SET(reboot, "reboot", "reboot the system", command_reboot);
-
-static int
-command_reboot(int argc, char *argv[])
-{
-
- RS->ResetSystem(EfiResetWarm, EFI_SUCCESS, 0, NULL);
- /* NOTREACHED */
- return (CMD_OK);
-}
-
-COMMAND_SET(memmap, "memmap", "print memory map", command_memmap);
-
-static int
-command_memmap(int argc, char *argv[])
-{
- UINTN sz;
- EFI_MEMORY_DESCRIPTOR *map, *p;
- UINTN key, dsz;
- UINT32 dver;
- EFI_STATUS status;
- int i, ndesc;
- static char *types[] = {
- "Reserved",
- "LoaderCode",
- "LoaderData",
- "BootServicesCode",
- "BootServicesData",
- "RuntimeServicesCode",
- "RuntimeServicesData",
- "ConventionalMemory",
- "UnusableMemory",
- "ACPIReclaimMemory",
- "ACPIMemoryNVS",
- "MemoryMappedIO",
- "MemoryMappedIOPortSpace",
- "PalCode"
- };
-
- sz = 0;
- status = BS->GetMemoryMap(&sz, 0, &key, &dsz, &dver);
- if (status != EFI_BUFFER_TOO_SMALL) {
- printf("Can't determine memory map size\n");
- return CMD_ERROR;
- }
- map = malloc(sz);
- status = BS->GetMemoryMap(&sz, map, &key, &dsz, &dver);
- if (EFI_ERROR(status)) {
- printf("Can't read memory map\n");
- return CMD_ERROR;
- }
-
- ndesc = sz / dsz;
- printf("%23s %12s %12s %8s %4s\n",
- "Type", "Physical", "Virtual", "#Pages", "Attr");
-
- for (i = 0, p = map; i < ndesc;
- i++, p = NextMemoryDescriptor(p, dsz)) {
- printf("%23s %012lx %012lx %08lx ",
- types[p->Type],
- p->PhysicalStart,
- p->VirtualStart,
- p->NumberOfPages);
- if (p->Attribute & EFI_MEMORY_UC)
- printf("UC ");
- if (p->Attribute & EFI_MEMORY_WC)
- printf("WC ");
- if (p->Attribute & EFI_MEMORY_WT)
- printf("WT ");
- if (p->Attribute & EFI_MEMORY_WB)
- printf("WB ");
- if (p->Attribute & EFI_MEMORY_UCE)
- printf("UCE ");
- if (p->Attribute & EFI_MEMORY_WP)
- printf("WP ");
- if (p->Attribute & EFI_MEMORY_RP)
- printf("RP ");
- if (p->Attribute & EFI_MEMORY_XP)
- printf("XP ");
- if (p->Attribute & EFI_MEMORY_RUNTIME)
- printf("RUNTIME");
- printf("\n");
- }
-
- return CMD_OK;
-}
-
-COMMAND_SET(configuration, "configuration",
- "print configuration tables", command_configuration);
-
-static const char *
-guid_to_string(EFI_GUID *guid)
-{
- static char buf[40];
-
- sprintf(buf, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
- guid->Data1, guid->Data2, guid->Data3, guid->Data4[0],
- guid->Data4[1], guid->Data4[2], guid->Data4[3], guid->Data4[4],
- guid->Data4[5], guid->Data4[6], guid->Data4[7]);
- return (buf);
-}
-
-static int
-command_configuration(int argc, char *argv[])
-{
- int i;
-
- printf("NumberOfTableEntries=%ld\n", ST->NumberOfTableEntries);
- for (i = 0; i < ST->NumberOfTableEntries; i++) {
- EFI_GUID *guid;
-
- printf(" ");
- guid = &ST->ConfigurationTable[i].VendorGuid;
- if (!memcmp(guid, &mps, sizeof(EFI_GUID)))
- printf("MPS Table");
- else if (!memcmp(guid, &acpi, sizeof(EFI_GUID)))
- printf("ACPI Table");
- else if (!memcmp(guid, &acpi20, sizeof(EFI_GUID)))
- printf("ACPI 2.0 Table");
- else if (!memcmp(guid, &smbios, sizeof(EFI_GUID)))
- printf("SMBIOS Table");
- else if (!memcmp(guid, &sal, sizeof(EFI_GUID)))
- printf("SAL System Table");
- else if (!memcmp(guid, &hcdp, sizeof(EFI_GUID)))
- printf("DIG64 HCDP Table");
- else
- printf("Unknown Table (%s)", guid_to_string(guid));
- printf(" at %p\n", ST->ConfigurationTable[i].VendorTable);
- }
-
- return CMD_OK;
-}
-
-COMMAND_SET(sal, "sal", "print SAL System Table", command_sal);
-
-static int
-command_sal(int argc, char *argv[])
-{
- int i;
- struct sal_system_table *saltab = 0;
- static int sizes[6] = {
- 48, 32, 16, 32, 16, 16
- };
- u_int8_t *p;
-
- saltab = efi_get_table(&sal);
- if (saltab == NULL) {
- printf("Can't find SAL System Table\n");
- return CMD_ERROR;
- }
-
- if (memcmp(saltab->sal_signature, "SST_", 4)) {
- printf("Bad signature for SAL System Table\n");
- return CMD_ERROR;
- }
-
- printf("SAL Revision %x.%02x\n",
- saltab->sal_rev[1],
- saltab->sal_rev[0]);
- printf("SAL A Version %x.%02x\n",
- saltab->sal_a_version[1],
- saltab->sal_a_version[0]);
- printf("SAL B Version %x.%02x\n",
- saltab->sal_b_version[1],
- saltab->sal_b_version[0]);
-
- p = (u_int8_t *) (saltab + 1);
- for (i = 0; i < saltab->sal_entry_count; i++) {
- printf(" Desc %d", *p);
- if (*p == 0) {
- struct sal_entrypoint_descriptor *dp;
- dp = (struct sal_entrypoint_descriptor *) p;
- printf("\n");
- printf(" PAL Proc at 0x%lx\n",
- dp->sale_pal_proc);
- printf(" SAL Proc at 0x%lx\n",
- dp->sale_sal_proc);
- printf(" SAL GP at 0x%lx\n",
- dp->sale_sal_gp);
- } else if (*p == 1) {
- struct sal_memory_descriptor *dp;
- dp = (struct sal_memory_descriptor *) p;
- printf(" Type %d.%d, ",
- dp->sale_memory_type[0],
- dp->sale_memory_type[1]);
- printf("Address 0x%lx, ",
- dp->sale_physical_address);
- printf("Length 0x%x\n",
- dp->sale_length);
- } else if (*p == 5) {
- struct sal_ap_wakeup_descriptor *dp;
- dp = (struct sal_ap_wakeup_descriptor *) p;
- printf("\n");
- printf(" Mechanism %d\n", dp->sale_mechanism);
- printf(" Vector 0x%lx\n", dp->sale_vector);
- } else
- printf("\n");
-
- p += sizes[*p];
- }
-
- return CMD_OK;
-}
-
-int
-print_trs(int type)
-{
- struct ia64_pal_result res;
- int i, maxtr;
- struct {
- pt_entry_t pte;
- uint64_t itir;
- uint64_t ifa;
- struct ia64_rr rr;
- } buf;
- static const char *psnames[] = {
- "1B", "2B", "4B", "8B",
- "16B", "32B", "64B", "128B",
- "256B", "512B", "1K", "2K",
- "4K", "8K", "16K", "32K",
- "64K", "128K", "256K", "512K",
- "1M", "2M", "4M", "8M",
- "16M", "32M", "64M", "128M",
- "256M", "512M", "1G", "2G"
- };
- static const char *manames[] = {
- "WB", "bad", "bad", "bad",
- "UC", "UCE", "WC", "NaT",
- };
-
- res = ia64_call_pal_static(PAL_VM_SUMMARY, 0, 0, 0);
- if (res.pal_status != 0) {
- printf("Can't get VM summary\n");
- return CMD_ERROR;
- }
-
- if (type == 0)
- maxtr = (res.pal_result[0] >> 40) & 0xff;
- else
- maxtr = (res.pal_result[0] >> 32) & 0xff;
-
- printf("%d translation registers\n", maxtr);
-
- pager_open();
- pager_output("TR# RID Virtual Page Physical Page PgSz ED AR PL D A MA P KEY\n");
- for (i = 0; i <= maxtr; i++) {
- char lbuf[128];
-
- bzero(&buf, sizeof(buf));
- res = ia64_call_pal_stacked(PAL_VM_TR_READ, i, type,
- (u_int64_t) &buf);
- if (res.pal_status != 0)
- break;
-
- /* Only display valid translations */
- if ((buf.ifa & 1) == 0)
- continue;
-
- if (!(res.pal_result[0] & 1))
- buf.pte &= ~PTE_AR_MASK;
- if (!(res.pal_result[0] & 2))
- buf.pte &= ~PTE_PL_MASK;
- if (!(res.pal_result[0] & 4))
- buf.pte &= ~PTE_DIRTY;
- if (!(res.pal_result[0] & 8))
- buf.pte &= ~PTE_MA_MASK;
- sprintf(lbuf, "%03d %06x %013lx %013lx %4s %d %d %d %d %d "
- "%-3s %d %06x\n", i, buf.rr.rr_rid, buf.ifa >> 12,
- (buf.pte & PTE_PPN_MASK) >> 12,
- psnames[(buf.itir & ITIR_PS_MASK) >> 2],
- (buf.pte & PTE_ED) ? 1 : 0,
- (int)(buf.pte & PTE_AR_MASK) >> 9,
- (int)(buf.pte & PTE_PL_MASK) >> 7,
- (buf.pte & PTE_DIRTY) ? 1 : 0,
- (buf.pte & PTE_ACCESSED) ? 1 : 0,
- manames[(buf.pte & PTE_MA_MASK) >> 2],
- (buf.pte & PTE_PRESENT) ? 1 : 0,
- (int)((buf.itir & ITIR_KEY_MASK) >> 8));
- pager_output(lbuf);
- }
- pager_close();
-
- if (res.pal_status != 0) {
- printf("Error while getting TR contents\n");
- return CMD_ERROR;
- }
- return CMD_OK;
-}
-
-COMMAND_SET(itr, "itr", "print instruction TRs", command_itr);
-
-static int
-command_itr(int argc, char *argv[])
-{
- return print_trs(0);
-}
-
-COMMAND_SET(dtr, "dtr", "print data TRs", command_dtr);
-
-static int
-command_dtr(int argc, char *argv[])
-{
- return print_trs(1);
-}
-
-COMMAND_SET(hcdp, "hcdp", "Dump HCDP info", command_hcdp);
-
-static char *
-hcdp_string(char *s, u_int len)
-{
- static char buffer[256];
-
- memcpy(buffer, s, len);
- buffer[len] = 0;
- return (buffer);
-}
-
-static int
-command_hcdp(int argc, char *argv[])
-{
- struct dig64_hcdp_table *tbl;
- struct dig64_hcdp_entry *ent;
- struct dig64_gas *gas;
- int i;
-
- tbl = efi_get_table(&hcdp);
- if (tbl == NULL) {
- printf("No HCDP table present\n");
- return (CMD_OK);
- }
- if (memcmp(tbl->signature, HCDP_SIGNATURE, sizeof(tbl->signature))) {
- printf("HCDP table has invalid signature\n");
- return (CMD_OK);
- }
- if (tbl->length < sizeof(*tbl) - sizeof(*tbl->entry)) {
- printf("HCDP table too short\n");
- return (CMD_OK);
- }
- printf("HCDP table at 0x%016lx\n", (u_long)tbl);
- printf("Signature = %s\n", hcdp_string(tbl->signature, 4));
- printf("Length = %u\n", tbl->length);
- printf("Revision = %u\n", tbl->revision);
- printf("Checksum = %u\n", tbl->checksum);
- printf("OEM Id = %s\n", hcdp_string(tbl->oem_id, 6));
- printf("Table Id = %s\n", hcdp_string(tbl->oem_tbl_id, 8));
- printf("OEM rev = %u\n", tbl->oem_rev);
- printf("Creator Id = %s\n", hcdp_string(tbl->creator_id, 4));
- printf("Creator rev= %u\n", tbl->creator_rev);
- printf("Entries = %u\n", tbl->entries);
- for (i = 0; i < tbl->entries; i++) {
- ent = tbl->entry + i;
- printf("Entry #%d:\n", i + 1);
- printf(" Type = %u\n", ent->type);
- printf(" Databits = %u\n", ent->databits);
- printf(" Parity = %u\n", ent->parity);
- printf(" Stopbits = %u\n", ent->stopbits);
- printf(" PCI seg = %u\n", ent->pci_segment);
- printf(" PCI bus = %u\n", ent->pci_bus);
- printf(" PCI dev = %u\n", ent->pci_device);
- printf(" PCI func = %u\n", ent->pci_function);
- printf(" Interrupt = %u\n", ent->interrupt);
- printf(" PCI flag = %u\n", ent->pci_flag);
- printf(" Baudrate = %lu\n",
- ((u_long)ent->baud_high << 32) + (u_long)ent->baud_low);
- gas = &ent->address;
- printf(" Addr space= %u\n", gas->addr_space);
- printf(" Bit width = %u\n", gas->bit_width);
- printf(" Bit offset= %u\n", gas->bit_offset);
- printf(" Address = 0x%016lx\n",
- ((u_long)gas->addr_high << 32) + (u_long)gas->addr_low);
- printf(" PCI type = %u\n", ent->pci_devid);
- printf(" PCI vndr = %u\n", ent->pci_vendor);
- printf(" IRQ = %u\n", ent->irq);
- printf(" PClock = %u\n", ent->pclock);
- printf(" PCI iface = %u\n", ent->pci_interface);
- }
- printf("<EOT>\n");
- return (CMD_OK);
-}
-
-COMMAND_SET(about, "about", "about the loader", command_about);
-
-extern uint64_t _start_plabel[];
-
-static int
-command_about(int argc, char *argv[])
-{
- EFI_LOADED_IMAGE *img;
-
- printf("%s\n", bootprog_name);
- printf("revision %s\n", bootprog_rev);
- printf("built by %s\n", bootprog_maker);
- printf("built on %s\n", bootprog_date);
-
- printf("\n");
-
- BS->HandleProtocol(IH, &imgid, (VOID**)&img);
- printf("image loaded at %p\n", img->ImageBase);
- printf("entry at %#lx (%#lx)\n", _start_plabel[0], _start_plabel[1]);
-}
diff --git a/sys/boot/ia64/efi/start.S b/sys/boot/ia64/efi/start.S
deleted file mode 100644
index 9d28a96..0000000
--- a/sys/boot/ia64/efi/start.S
+++ /dev/null
@@ -1,290 +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$
- */
-
- .text
-
-#include <machine/asm.h>
-
-#define EFI_SUCCESS 0
-#define EFI_LOAD_ERROR 1
-#define EFI_BUFFER_TOO_SMALL 5
-
-#define DT_NULL 0 /* Terminating entry. */
-#define DT_PLTRELSZ 2 /* Total size in bytes of PLT relocations. */
-#define DT_SYMTAB 6 /* Address of symbol table. */
-#define DT_RELA 7 /* Address of ElfNN_Rela relocations. */
-#define DT_RELASZ 8 /* Total size of ElfNN_Rela relocations. */
-#define DT_RELAENT 9 /* Size of each ElfNN_Rela relocation entry. */
-#define DT_SYMENT 11 /* Size of each symbol table entry. */
-#define DT_JMPREL 23 /* Address of PLT relocations. */
-
-#define R_IA_64_NONE 0 /* None */
-#define R_IA_64_DIR64LSB 0x27 /* word64 LSB S + A */
-#define R_IA_64_FPTR64LSB 0x47 /* word64 LSB @fptr(S + A) */
-#define R_IA_64_REL32LSB 0x6d /* word32 LSB BD + A */
-#define R_IA_64_REL64LSB 0x6f /* word64 LSB BD + A */
-#define R_IA_64_IPLTLSB 0x81 /* function descriptor LSB speciaal */
-
-ENTRY(_start, 2)
- alloc loc0=ar.pfs,2,3,3,0
- mov loc1=rp
- movl loc2=@gprel(ImageBase)
- ;;
- add loc2=gp,loc2
- ;;
- mov out0=loc2
- mov out1=in1
- ;;
- br.call.sptk.few rp=_reloc // relocate image
-
- cmp.ne p6,p0=EFI_SUCCESS,r8 // did it work?
-(p6) br.cond.dpnt.few 9f
-
- mov out0=in0 // image_handle
- mov out1=in1 // system_table
- br.call.sptk.few rp=efi_main
-9:
- mov ar.pfs=loc0
- mov rp=loc1
- ;;
- br.ret.sptk.few rp
-END(_start)
-
- // PLABEL for PE32+
- .section .plabel, "a"
- .align 16
- .global _start_plabel
-_start_plabel:
- data16 @iplt(_start)
- .previous
-
- // A PE32+ relocation entry for the plabel
- .section .reloc, "a"
- data4 _start_plabel
- data4 12
- data2 (10 << 12) + 0
- data2 (10 << 12) + 8
- .previous
-
-// in0: image base
-// in1: system table
-//
-// XXX Assumes PLT relocations are of type Elf_Rela
-//
-// r2 = address of fptr_storage
-// r3 = address of fptr_storage_end
-// r4 = address of first free fptr
-//
-// r15 = r_offset
-// r16 = r_info -OR- d_tag
-// r17 = r_addend -OR- d_val (=d_ptr)
-// r18 = address of .rela dynamic section
-// r19 = size of .rela section
-// r20 = size of .rela element (Elf_Rela)
-// r21 = address of first PLT relocation
-// r22 = size of PLT relocations
-// r23 = relocation type
-// r24 = address of symbol
-// r28 = R_IA_64_IPLTLSB
-// f8 = address of symbol table
-// f9 = size of symtab element
-
-STATIC_ENTRY(_reloc, 2)
- alloc loc0=ar.pfs,2,2,0,0
- ;;
- mov loc1=rp
- movl r29=@gprel(_DYNAMIC) // find _DYNAMIC etc.
- ;;
- add r15=r29,gp
- movl r29=@gprel(fptr_storage)
- ;;
- add r2=r29,gp
- movl r29=@gprel(fptr_storage_end)
- ;;
- add r3=r29,gp
- mov r4=r2
- mov r19=0
- mov r22=0
- mov r20=24
- mov r28=R_IA_64_IPLTLSB
- ;;
-1:
- ld8 r16=[r15],8 // read r15->d_tag
- ;;
- ld8 r17=[r15],8 // and r15->d_val
- ;;
- cmp.eq p6,p0=DT_NULL,r16 // done?
-(p6) br.cond.dpnt.few 2f
- ;;
- cmp.eq p6,p0=DT_RELA,r16 // rela section?
- ;;
-(p6) add r18=r17,in0
- cmp.eq p6,p0=DT_RELASZ,r16 // rela section size?
- ;;
-(p6) mov r19=r17
- cmp.eq p6,p0=DT_RELAENT,r16 // rela entry size?
- ;;
-(p6) mov r20=r17
- cmp.eq p6,p0=DT_JMPREL,r16 // PLT relocs?
- ;;
-(p6) add r21=r17,in0
- cmp.eq p6,p0=DT_PLTRELSZ,r16 // PLT relocs size?
- ;;
-(p6) mov r22=r17
- cmp.eq p6,p0=DT_SYMTAB,r16 // symbol table?
- ;;
-(p6) add r29=r17,in0
- ;;
-(p6) setf.sig f8=r29
- cmp.eq p6,p0=DT_SYMENT,r16 // symbol entry size?
- ;;
-(p6) setf.sig f9=r17
- br.dptk 1b
-
-2:
- cmp.lt p6,p0=0,r19
-(p6) br.cond.dptk 3f
- ;;
- mov r19=r22
- mov r18=r21
- mov r21=0
- mov r22=0
- ;;
- cmp.lt p6,p0=0,r19
-(p6) br.cond.dptk 3f
- ;;
- mov r8=EFI_SUCCESS
- br.dptk 9f
-3:
- ld8 r29=[r18],8 // read r_offset
- ;;
- ld8 r16=[r18],8 // read r_info
- add r15=r29,in0 // relocate r_offset
- ;;
- ld8 r17=[r18],8 // read r_addend
- sub r19=r19,r20 // update relasz
- extr.u r23=r16,0,32 // ELF64_R_TYPE(r16)
- ;;
- cmp.eq p6,p0=R_IA_64_NONE,r23
-(p6) br.cond.dpnt.few 2b
- ;;
- cmp.eq p6,p0=R_IA_64_REL32LSB,r23
-(p6) br.cond.dptk.few 3f
- ;;
- cmp.eq p6,p0=R_IA_64_REL64LSB,r23
-(p6) br.cond.dptk.few 4f
- ;;
- extr.u r29=r16,32,32 // ELF64_R_SYM(r16)
- ;;
- setf.sig f10=r29 // so we can multiply
- ;;
- xma.lu f10=f10,f9,f8 // f10=symtab + r_sym*syment
- ;;
- getf.sig r29=f10
- ;;
- add r29=8,r29 // address of st_value
- ;;
- ld8 r29=[r29] // read symbol value
- ;;
- add r24=r29,in0 // relocate symbol value
- ;;
- cmp.eq p6,p0=R_IA_64_DIR64LSB,r23
-(p6) br.cond.dptk.few 5f
- ;;
- cmp.eq p6,p0=R_IA_64_FPTR64LSB,r23
-(p6) br.cond.dptk.few 6f
- ;;
- cmp.ne p6,p0=r28,r23 // IPLTLSB
-(p6) br.cond.dptk.few 2b
-
- // IPLTLSB
- add r29=r24,r17 // S + A
- ;;
- st8 [r15]=r29,8 // fdesc:FP
- ;;
- st8 [r15]=gp // fdesc:GP
- br.cond.sptk.few 2b
-
- // REL32LSB
-3:
- add r29=in0,r17
- ;;
- st4 [r15]=r29
- br.cond.sptk.few 2b
-
- // REL64LSB
-4:
- add r29=in0,r17 // BD + A
- ;;
- st8 [r15]=r29 // word64
- br.cond.sptk.few 2b
-
- // DIR64LSB
-5:
- add r29=r24,r17 // S + A
- ;;
- st8 [r15]=r29 // word64
- br.cond.sptk.few 2b
-
-6:
- mov r29=r2 // FPTR64LSB
- ;;
-7:
- cmp.geu p6,p0=r29,r4 // end of fptrs?
-(p6) br.cond.dpnt.few 8f // can't find existing fptr
- ld8 r17=[r29] // read function from fptr
- ;;
- cmp.eq p6,p0=r24,r17 // same function?
- ;;
-(p6) st8 [r15]=r29 // reuse fptr
-(p6) br.cond.sptk.few 2b // done
- add r29=16,r29 // next fptr
- br.sptk.few 7b
-8:
- mov r8=EFI_BUFFER_TOO_SMALL // failure return value
- cmp.geu p6,p0=r4,r3 // space left?
-(p6) br.cond.dpnt.few 9f // bail out
- st8 [r15]=r4 // install fptr
- ;;
- st8 [r4]=r24,8 // write fptr address
- ;;
- st8 [r4]=gp,8 // write fptr gp
- br.cond.sptk.few 2b
-
-9:
- mov ar.pfs=loc0
- mov rp=loc1
- ;;
- br.ret.sptk.few rp
-END(_reloc)
-
- .data
- .align 16
-fptr_storage:
- .space 1024*16 // XXX
-fptr_storage_end:
diff --git a/sys/boot/ia64/efi/version b/sys/boot/ia64/efi/version
deleted file mode 100644
index 4f4203a..0000000
--- a/sys/boot/ia64/efi/version
+++ /dev/null
@@ -1,27 +0,0 @@
-$FreeBSD$
-
-NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this
-file is important. Make sure the current version number is on line 6.
-
-3.2: Various fixes to libstand, in particular dosfs.
-3.1: Add the about, reboot and pbvm commands.
- I-cache coherency is maintained.
-3.0: Add support for PBVM.
-2.2: Create direct mapping based on start address instead of mapping
- first 256M.
-2.1: Add support for "-dev <part>" argument parsing.
-2.0: Provide devices based on the block I/O protocol, rather than the
- simple file services protocol. Use the FreeBSD file system code
- on top of those devices to access files.
-1.2: Restructured. Has some user visible differences.
-1.1: Pass the HCDP table address to the kernel via bootinfo if one
- is present in the EFI system table.
-1.0: Don't map the I/O port range. We expect the kernel to do it. It
- was done in the loader as a debugging aid and not intended as a
- service/feature.
-0.3: Pass the physical address of the bootinfo block in register r8
- to the kernel. Continue to put it at the fixed address for now.
-0.2: Much improved version. Significant is the support for passing
- the FPSWA interface pointer to the kernel.
-0.1: Initial EFI version, germinated from the NetBSD i386
- standalone, but enormously modified.
diff --git a/sys/boot/ia64/ski/Makefile b/sys/boot/ia64/ski/Makefile
deleted file mode 100644
index 0620126..0000000
--- a/sys/boot/ia64/ski/Makefile
+++ /dev/null
@@ -1,39 +0,0 @@
-# $FreeBSD$
-
-MAN=
-
-.include <src.opts.mk>
-MK_SSP= no
-
-PROG= skiload
-STRIP= # We must not strip skiload at install time.
-
-SRCS= acpi_stub.c conf.c delay.c efi_stub.c exit.c main.c \
- pal_stub.S sal_stub.c skiconsole.c skifs.c skimd.c \
- ssc.c start.S time.c vers.c
-
-CFLAGS+= -I${.CURDIR}/../common
-CFLAGS+= -I${.CURDIR}/../../common
-CFLAGS+= -I${.CURDIR}/../../..
-CFLAGS+= -I${.CURDIR}/../../../../lib/libstand
-
-LDSCRIPT= ${.CURDIR}/ldscript.${MACHINE_CPUARCH}
-LDFLAGS= -Wl,-T${LDSCRIPT}
-
-NEWVERSWHAT= "SKI boot" ${MACHINE_CPUARCH}
-
-vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
- sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
-
-CLEANFILES= vers.c
-
-LIBIA64= ${.OBJDIR}/../common/libia64.a
-.if ${MK_FORTH} != "no"
-LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
-.endif
-
-DPADD= ${LIBIA64} ${LIBFICL} ${LIBSTAND}
-LDADD= -Wl,--whole-archive ${LIBIA64} -Wl,--no-whole-archive \
- ${LIBFICL} -lstand
-
-.include <bsd.prog.mk>
diff --git a/sys/boot/ia64/ski/acpi_stub.c b/sys/boot/ia64/ski/acpi_stub.c
deleted file mode 100644
index b16bb0a..0000000
--- a/sys/boot/ia64/ski/acpi_stub.c
+++ /dev/null
@@ -1,183 +0,0 @@
-/*-
- * Copyright (c) 2003 Marcel Moolenaar
- * 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 ``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 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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <contrib/dev/acpica/include/acpi.h>
-
-#define APIC_IO_SAPIC 6
-#define APIC_LOCAL_SAPIC 7
-
-#pragma pack(1)
-
-typedef struct /* LOCAL SAPIC */
-{
- ACPI_SUBTABLE_HEADER Header;
- UINT8 ProcessorId; /* ACPI processor id */
- UINT8 LocalSapicId; /* Processor local SAPIC id */
- UINT8 LocalSapicEid; /* Processor local SAPIC eid */
- UINT8 Reserved[3];
- UINT32 ProcessorEnabled: 1;
- UINT32 FlagsReserved: 31;
-} LOCAL_SAPIC;
-
-typedef struct /* IO SAPIC */
-{
- ACPI_SUBTABLE_HEADER Header;
- UINT8 IoSapicId; /* I/O SAPIC ID */
- UINT8 Reserved; /* reserved - must be zero */
- UINT32 Vector; /* interrupt base */
- UINT64 IoSapicAddress; /* SAPIC's physical address */
-} IO_SAPIC;
-
-/*
- */
-
-struct {
- ACPI_TABLE_MADT MADT;
- ACPI_MADT_LOCAL_SAPIC cpu0;
- ACPI_MADT_LOCAL_SAPIC cpu1;
- ACPI_MADT_LOCAL_SAPIC cpu2;
- ACPI_MADT_LOCAL_SAPIC cpu3;
- ACPI_MADT_IO_SAPIC sapic;
-} apic = {
- /* Header. */
- {
- ACPI_SIG_MADT, /* Signature. */
- sizeof(apic), /* Length of table. */
- 0, /* ACPI minor revision. */
- 0, /* Checksum. */
- "FBSD", /* OEM Id. */
- "SKI", /* OEM table Id. */
- 0, /* OEM revision. */
- "FBSD", /* ASL compiler Id. */
- 0, /* ASL revision. */
- 0xfee00000,
- },
- /* cpu0. */
- {
- APIC_LOCAL_SAPIC, /* Type. */
- sizeof(apic.cpu0), /* Length. */
- 0, /* ACPI processor id */
- 0, /* Processor local SAPIC id */
- 0, /* Processor local SAPIC eid */
- { 0, 0, 0 },
- 1, /* FL: Enabled. */
- },
- /* cpu1. */
- {
- APIC_LOCAL_SAPIC, /* Type. */
- sizeof(apic.cpu1), /* Length. */
- 1, /* ACPI processor id */
- 0, /* Processor local SAPIC id */
- 1, /* Processor local SAPIC eid */
- { 0, 0, 0 },
- 1, /* FL: Enabled. */
- },
- /* cpu2. */
- {
- APIC_LOCAL_SAPIC, /* Type. */
- sizeof(apic.cpu2), /* Length. */
- 2, /* ACPI processor id */
- 1, /* Processor local SAPIC id */
- 0, /* Processor local SAPIC eid */
- { 0, 0, 0 },
- 0, /* FL: Enabled. */
- },
- /* cpu3. */
- {
- APIC_LOCAL_SAPIC, /* Type. */
- sizeof(apic.cpu3), /* Length. */
- 3, /* ACPI processor id */
- 1, /* Processor local SAPIC id */
- 1, /* Processor local SAPIC eid */
- { 0, 0, 0 },
- 0, /* FL: Enabled. */
- },
- /* sapic. */
- {
- APIC_IO_SAPIC, /* Type. */
- sizeof(apic.sapic), /* Length. */
- 4, /* IO SAPIC id. */
- 0,
- 16, /* Interrupt base. */
- 0xfec00000 /* IO SAPIC address. */
- }
-};
-
-struct {
- ACPI_TABLE_HEADER Header;
- UINT64 apic_tbl;
-} xsdt = {
- {
- ACPI_SIG_XSDT, /* Signature. */
- sizeof(xsdt), /* Length of table. */
- 0, /* ACPI minor revision. */
- 0, /* XXX checksum. */
- "FBSD", /* OEM Id. */
- "SKI", /* OEM table Id. */
- 0, /* OEM revision. */
- "FBSD", /* ASL compiler Id. */
- 0 /* ASL revision. */
- },
- 0UL /* XXX APIC table address. */
-};
-
-ACPI_TABLE_RSDP acpi_root = {
- ACPI_SIG_RSDP,
- 0, /* XXX checksum. */
- "FBSD",
- 2, /* ACPI Rev 2.0. */
- 0UL,
- sizeof(xsdt), /* XSDT length. */
- 0UL, /* XXX PA of XSDT. */
- 0, /* XXX Extended checksum. */
-};
-
-static void
-cksum(void *addr, int sz, UINT8 *sum)
-{
- UINT8 *p, s;
-
- p = addr;
- s = 0;
- while (sz--)
- s += *p++;
- *sum = -s;
-}
-
-void
-acpi_stub_init(void)
-{
- acpi_root.XsdtPhysicalAddress = (UINT64)&xsdt;
- cksum(&acpi_root, 20, &acpi_root.Checksum);
- cksum(&acpi_root, sizeof(acpi_root), &acpi_root.ExtendedChecksum);
-
- cksum(&apic, sizeof(apic), &apic.MADT.Header.Checksum);
- xsdt.apic_tbl = (UINT32)&apic;
- cksum(&xsdt, sizeof(xsdt), &xsdt.Header.Checksum);
-}
diff --git a/sys/boot/ia64/ski/conf.c b/sys/boot/ia64/ski/conf.c
deleted file mode 100644
index 3ee3b33..0000000
--- a/sys/boot/ia64/ski/conf.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/*-
- * Copyright (c) 1997
- * Matthias Drochner. 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.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed for the NetBSD Project
- * by Matthias Drochner.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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.
- *
- * $NetBSD: conf.c,v 1.2 1997/03/22 09:03:29 thorpej Exp $
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <stand.h>
-
-#include "libski.h"
-
-/*
- * We could use linker sets for some or all of these, but
- * then we would have to control what ended up linked into
- * the bootstrap. So it's easier to conditionalise things
- * here.
- *
- * XXX rename these arrays to be consistent and less namespace-hostile
- */
-
-/* Exported for libstand */
-struct devsw *devsw[] = {
- &skifs_dev,
- NULL
-};
-
-struct fs_ops *file_system[] = {
- &ski_fsops,
- &ufs_fsops,
- &gzipfs_fsops,
- NULL
-};
-
-/*
- * Consoles
- *
- * We don't prototype these in libski.h because they require
- * data structures from bootstrap.h as well.
- */
-extern struct console ski_console;
-
-struct console *consoles[] = {
- &ski_console,
- NULL
-};
diff --git a/sys/boot/ia64/ski/delay.c b/sys/boot/ia64/ski/delay.c
deleted file mode 100644
index 2389603..0000000
--- a/sys/boot/ia64/ski/delay.c
+++ /dev/null
@@ -1,34 +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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-void
-delay(int usecs)
-{
- return;
-}
diff --git a/sys/boot/ia64/ski/efi_stub.c b/sys/boot/ia64/ski/efi_stub.c
deleted file mode 100644
index 7236c69..0000000
--- a/sys/boot/ia64/ski/efi_stub.c
+++ /dev/null
@@ -1,259 +0,0 @@
-/*-
- * Copyright (c) 2003,2004 Marcel Moolenaar
- * 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 ``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 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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <machine/bootinfo.h>
-#include <machine/efi.h>
-#include <stand.h>
-#include "libski.h"
-
-extern void acpi_root;
-extern void sal_systab;
-
-struct efi_cfgtbl efi_cfgtab[] = {
- { EFI_TABLE_ACPI20, (intptr_t)&acpi_root },
- { EFI_TABLE_SAL, (intptr_t)&sal_systab }
-};
-
-static efi_status GetTime(struct efi_tm *, struct efi_tmcap *);
-static efi_status SetTime(struct efi_tm *);
-static efi_status GetWakeupTime(uint8_t *, uint8_t *, struct efi_tm *);
-static efi_status SetWakeupTime(uint8_t, struct efi_tm *);
-
-static efi_status SetVirtualAddressMap(u_long, u_long, uint32_t,
- struct efi_md*);
-static efi_status ConvertPointer(u_long, void **);
-
-static efi_status GetVariable(efi_char *, struct uuid *, uint32_t *, u_long *,
- void *);
-static efi_status GetNextVariableName(u_long *, efi_char *, struct uuid *);
-static efi_status SetVariable(efi_char *, struct uuid *, uint32_t, u_long,
- void *);
-
-static efi_status GetNextHighMonotonicCount(uint32_t *);
-static efi_status ResetSystem(enum efi_reset, efi_status, u_long, efi_char *);
-
-struct efi_rt efi_rttab = {
- /* Header. */
- { 0, /* XXX Signature */
- 0, /* XXX Revision */
- 0, /* XXX HeaderSize */
- 0, /* XXX CRC32 */
- },
-
- /* Time services */
- GetTime,
- SetTime,
- GetWakeupTime,
- SetWakeupTime,
-
- /* Virtual memory services */
- SetVirtualAddressMap,
- ConvertPointer,
-
- /* Variable services */
- GetVariable,
- GetNextVariableName,
- SetVariable,
-
- /* Misc */
- GetNextHighMonotonicCount,
- ResetSystem
-};
-
-struct efi_systbl efi_systab = {
- /* Header. */
- { EFI_SYSTBL_SIG,
- 0, /* XXX Revision */
- 0, /* XXX HeaderSize */
- 0, /* XXX CRC32 */
- },
-
- /* Firmware info. */
- L"FreeBSD", 0, 0,
-
- /* Console stuff. */
- NULL, NULL,
- NULL, NULL,
- NULL, NULL,
-
- /* Services (runtime first). */
- (intptr_t)&efi_rttab,
- NULL,
-
- /* Configuration tables. */
- sizeof(efi_cfgtab)/sizeof(struct efi_cfgtbl),
- (intptr_t)efi_cfgtab
-};
-
-static efi_status
-unsupported(const char *func)
-{
- printf("EFI: %s not supported\n", func);
- return ((1UL << 63) + 3);
-}
-
-static efi_status
-GetTime(struct efi_tm *time, struct efi_tmcap *caps)
-{
- uint32_t comps[8];
-
- ssc((uint64_t)comps, 0, 0, 0, SSC_GET_RTC);
- time->tm_year = comps[0] + 1900;
- time->tm_mon = comps[1] + 1;
- time->tm_mday = comps[2];
- time->tm_hour = comps[3];
- time->tm_min = comps[4];
- time->tm_sec = comps[5];
- time->__pad1 = time->__pad2 = 0;
- time->tm_nsec = 0;
- time->tm_tz = 0;
- time->tm_dst = 0;
- return (0);
-}
-
-static efi_status
-SetTime(struct efi_tm *time)
-{
- return (0);
-}
-
-static efi_status
-GetWakeupTime(uint8_t *enabled, uint8_t *pending, struct efi_tm *time)
-{
- return (unsupported(__func__));
-}
-
-static efi_status
-SetWakeupTime(uint8_t enable, struct efi_tm *time)
-{
- return (unsupported(__func__));
-}
-
-static void
-Reloc(void *addr, uint64_t delta)
-{
- uint64_t **fpp = addr;
-
- *fpp[0] += delta;
- *fpp[1] += delta;
- *fpp += delta >> 3;
-}
-
-static efi_status
-SetVirtualAddressMap(u_long mapsz, u_long descsz, uint32_t version,
- struct efi_md *memmap)
-{
- uint64_t delta;
-
- delta = (uintptr_t)memmap->md_virt - memmap->md_phys;
- Reloc(&efi_rttab.rt_gettime, delta);
- Reloc(&efi_rttab.rt_settime, delta);
- return (0); /* Hah... */
-}
-
-static efi_status
-ConvertPointer(u_long debug, void **addr)
-{
- return (unsupported(__func__));
-}
-
-static efi_status
-GetVariable(efi_char *name, struct uuid *vendor, uint32_t *attrs,
- u_long *datasz, void *data)
-{
- return (unsupported(__func__));
-}
-
-static efi_status
-GetNextVariableName(u_long *namesz, efi_char *name, struct uuid *vendor)
-{
- return (unsupported(__func__));
-}
-
-static efi_status
-SetVariable(efi_char *name, struct uuid *vendor, uint32_t attrs, u_long datasz,
- void *data)
-{
- return (unsupported(__func__));
-}
-
-static efi_status
-GetNextHighMonotonicCount(uint32_t *high)
-{
- static uint32_t counter = 0;
-
- *high = counter++;
- return (0);
-}
-
-static efi_status
-ResetSystem(enum efi_reset type, efi_status status, u_long datasz,
- efi_char *data)
-{
- return (unsupported(__func__));
-}
-
-void
-efi_stub_init(struct bootinfo *bi)
-{
- static struct efi_md memmap[4];
-
- /* Describe the SKI memory map. */
- bi->bi_memmap = (uintptr_t)(void *)memmap;
- bi->bi_memmap_size = sizeof(memmap);
- bi->bi_memdesc_size = sizeof(struct efi_md);
- bi->bi_memdesc_version = 1;
-
- memmap[0].md_type = EFI_MD_TYPE_PALCODE;
- memmap[0].md_phys = 0x100000;
- memmap[0].md_virt = NULL;
- memmap[0].md_pages = (1L*1024*1024)>>12;
- memmap[0].md_attr = EFI_MD_ATTR_WB | EFI_MD_ATTR_RT;
-
- memmap[1].md_type = EFI_MD_TYPE_FREE;
- memmap[1].md_phys = 4L*1024*1024;
- memmap[1].md_virt = NULL;
- memmap[1].md_pages = (128L*1024*1024)>>12;
- memmap[1].md_attr = EFI_MD_ATTR_WB;
-
- memmap[2].md_type = EFI_MD_TYPE_FREE;
- memmap[2].md_phys = 4L*1024*1024*1024;
- memmap[2].md_virt = NULL;
- memmap[2].md_pages = (64L*1024*1024)>>12;
- memmap[2].md_attr = EFI_MD_ATTR_WB;
-
- memmap[3].md_type = EFI_MD_TYPE_IOPORT;
- memmap[3].md_phys = 0xffffc000000;
- memmap[3].md_virt = NULL;
- memmap[3].md_pages = (64L*1024*1024)>>12;
- memmap[3].md_attr = EFI_MD_ATTR_UC;
-
- bi->bi_systab = (u_int64_t)&efi_systab;
-}
diff --git a/sys/boot/ia64/ski/exit.c b/sys/boot/ia64/ski/exit.c
deleted file mode 100644
index aeac67c..0000000
--- a/sys/boot/ia64/ski/exit.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/*-
- * Copyright (c) 2000 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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/time.h>
-#include <stddef.h>
-#include <stand.h>
-#include <stdarg.h>
-
-#include "libski.h"
-
-void
-exit(int code)
-{
- ssc(code, 0, 0, 0, SSC_EXIT);
-}
diff --git a/sys/boot/ia64/ski/ldscript.ia64 b/sys/boot/ia64/ski/ldscript.ia64
deleted file mode 100644
index e7a303f..0000000
--- a/sys/boot/ia64/ski/ldscript.ia64
+++ /dev/null
@@ -1,61 +0,0 @@
-/* $FreeBSD$ */
-OUTPUT_FORMAT("elf64-ia64-freebsd", "elf64-ia64-freebsd", "elf64-ia64-freebsd")
-OUTPUT_ARCH(ia64)
-ENTRY(_start)
-SECTIONS
-{
- /* Read-only sections, merged into text segment: */
- . = 0x100000;
- .text : {
- *(.text .stub .text.* .gnu.linkonce.t.*)
- /* .gnu.warning sections are handled specially by elf32.em. */
- *(.gnu.warning)
- *(.plt)
- } =0x00300000010070000002000001000400
- __start_set_Xcommand_set = .;
- set_Xcommand_set : { *(set_Xcommand_set) }
- __stop_set_Xcommand_set = .;
- .data : {
- *(.rodata .rodata.* .gnu.linkonce.r.*)
- *(.rodata1)
- *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
- *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
- *(.opd)
- *(.data .data.* .gnu.linkonce.d.*)
- *(.data1)
- *(.plabel)
- *(.dynbss)
- *(.bss .bss.* .gnu.linkonce.b.*)
- *(COMMON)
- }
- .IA_64.unwind_info : { *(.IA_64.unwind_info* .gnu.linkonce.ia64unwi.*) }
- .IA_64.unwind : { *(.IA_64.unwind* .gnu.linkonce.ia64unw.*) }
- __gp = .;
- .sdata : {
- *(.got.plt .got)
- *(.IA_64.pltoff)
- *(.sdata .sdata.* .gnu.linkonce.s.*)
- *(dynsbss)
- *(.sbss .sbss.* .gnu.linkonce.sb.*)
- *(.scommon)
- }
- .dynamic : { *(.dynamic) }
- .rela : {
- *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
- *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
- *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
- *(.rela.got)
- *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
- *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
- *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
- *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
- *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
- *(.rela.plt)
- *(.rela.IA_64.pltoff)
- *(.relaset_*)
- *(.rela.dyn .rela.dyn.*)
- }
- .hash : { *(.hash) }
- .dynsym : { *(.dynsym) }
- .dynstr : { *(.dynstr) }
-}
diff --git a/sys/boot/ia64/ski/libski.h b/sys/boot/ia64/ski/libski.h
deleted file mode 100644
index 0e7fbc6..0000000
--- a/sys/boot/ia64/ski/libski.h
+++ /dev/null
@@ -1,65 +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$
- */
-
-#define MAXDEV 31 /* maximum number of distinct devices */
-
-typedef unsigned long physaddr_t;
-
-/* exported devices XXX rename? */
-extern struct devsw skifs_dev;
-extern struct devsw ski_disk;
-extern struct netif_driver ski_net;
-
-/* Wrapper over SKI filesystems. */
-extern struct fs_ops ski_fsops;
-
-/* this is in startup code */
-extern void delay(int);
-extern void reboot(void);
-
-extern int ski_boot(void);
-
-struct bootinfo;
-struct preloaded_file;
-
-#define SSC_CONSOLE_INIT 20
-#define SSC_GETCHAR 21
-#define SSC_PUTCHAR 31
-#define SSC_OPEN 50
-#define SSC_CLOSE 51
-#define SSC_READ 52
-#define SSC_WRITE 53
-#define SSC_GET_COMPLETION 54
-#define SSC_WAIT_COMPLETION 55
-#define SSC_GET_RTC 65
-#define SSC_EXIT 66
-#define SSC_LOAD_SYMBOLS 69
-#define SSC_SAL_SET_VECTORS 120
-
-u_int64_t ssc(u_int64_t in0, u_int64_t in1, u_int64_t in2, u_int64_t in3,
- int which);
diff --git a/sys/boot/ia64/ski/main.c b/sys/boot/ia64/ski/main.c
deleted file mode 100644
index 5a00d1c..0000000
--- a/sys/boot/ia64/ski/main.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/*-
- * Copyright (c) 1998 Michael Smith <msmith@freebsd.org>
- * Copyright (c) 1998,2000 Doug Rabson <dfr@freebsd.org>
- * 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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <stand.h>
-#include <string.h>
-#include <setjmp.h>
-#include <machine/fpu.h>
-
-#include <libia64.h>
-#include "libski.h"
-
-extern char bootprog_name[];
-extern char bootprog_rev[];
-extern char bootprog_date[];
-extern char bootprog_maker[];
-
-struct devdesc currdev; /* our current device */
-struct arch_switch archsw; /* MI/MD interface boundary */
-
-void
-ski_main(void)
-{
- static char malloc[512*1024];
- int i;
-
- /*
- * initialise the heap as early as possible. Once this is done,
- * alloc() is usable. The stack is buried inside us, so this is
- * safe.
- */
- setheap((void *)malloc, (void *)(malloc + 512*1024));
-
- /*
- * XXX Chicken-and-egg problem; we want to have console output
- * early, but some console attributes may depend on reading from
- * eg. the boot device, which we can't do yet. We can use
- * printf() etc. once this is done.
- */
- cons_probe();
-
- /*
- * March through the device switch probing for things.
- */
- for (i = 0; devsw[i] != NULL; i++)
- if (devsw[i]->dv_init != NULL)
- (devsw[i]->dv_init)();
-
- printf("\n");
- printf("%s, Revision %s\n", bootprog_name, bootprog_rev);
- printf("(%s, %s)\n", bootprog_maker, bootprog_date);
-#if 0
- printf("Memory: %ld k\n", memsize() / 1024);
-#endif
-
- /* XXX presumes that biosdisk is first in devsw */
- currdev.d_dev = devsw[0];
- currdev.d_type = currdev.d_dev->dv_type;
- currdev.d_unit = 0;
-
-#if 0
- /* Create arc-specific variables */
- bootfile = GetEnvironmentVariable(ARCENV_BOOTFILE);
- if (bootfile)
- setenv("bootfile", bootfile, 1);
-#endif
-
- env_setenv("currdev", EV_VOLATILE, ia64_fmtdev(&currdev),
- ia64_setcurrdev, env_nounset);
- env_setenv("loaddev", EV_VOLATILE, ia64_fmtdev(&currdev), env_noset,
- env_nounset);
-
- setenv("LINES", "24", 1); /* optional */
-
- archsw.arch_autoload = ia64_autoload;
- archsw.arch_copyin = ia64_copyin;
- archsw.arch_copyout = ia64_copyout;
- archsw.arch_getdev = ia64_getdev;
- archsw.arch_loadaddr = ia64_loadaddr;
- archsw.arch_loadseg = ia64_loadseg;
- archsw.arch_readin = ia64_readin;
-
- interact(); /* doesn't return */
-
- exit(0);
-}
-
-COMMAND_SET(quit, "quit", "exit the loader", command_quit);
-
-static int
-command_quit(int argc, char *argv[])
-{
- exit(0);
- return (CMD_OK);
-}
diff --git a/sys/boot/ia64/ski/pal_stub.S b/sys/boot/ia64/ski/pal_stub.S
deleted file mode 100644
index 81fbd08..0000000
--- a/sys/boot/ia64/ski/pal_stub.S
+++ /dev/null
@@ -1,74 +0,0 @@
-/*-
- * Copyright (c) 2003 Marcel Moolenaar
- * 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>
-
- .text
-ENTRY(PalProc, 0)
- cmp.eq p6,p0=6,r28 // PAL_PTCE_INFO
-(p6) br.cond.dptk pal_ptce_info
- ;;
- cmp.eq p6,p0=8,r28 // PAL_VM_SUMMARY
-(p6) br.cond.dptk pal_vm_summary
- ;;
- cmp.eq p6,p0=14,r28 // PAL_FREQ_RATIOS
-(p6) br.cond.dptk pal_freq_ratios
- ;;
- cmp.eq p6,p0=29,r28 // PAL_HALT_LIGHT
-(p6) br.cond.dptk pal_halt_light
- ;;
- mov r15=66 // EXIT
- break.i 0x80000 // SSC
- ;;
-pal_ptce_info:
- mov r8=0
- mov r9=0 // base
- movl r10=0x0000000100000001 // loop counts (outer|inner)
- mov r11=0x0000000000000000 // loop strides (outer|inner)
- br.sptk b0
-pal_vm_summary:
- mov r8=0
- movl r9=(8<<40)|(8<<32) // VM info 1
- mov r10=(18<<8)|(41<<0) // VM info 2
- mov r11=0
- br.sptk b0
-pal_freq_ratios:
- mov r8=0
- movl r9=0x0000000B00000002 // processor ratio 11/2
- movl r10=0x0000000100000001 // bus ratio 1/1
- movl r11=0x0000000B00000002 // ITC ratio 11/2
- br.sptk b0
-pal_halt_light:
- mov r8=0
- mov r9=0
- mov r10=0
- mov r11=0
- br.sptk b0
-END(PalProc)
diff --git a/sys/boot/ia64/ski/sal_stub.c b/sys/boot/ia64/ski/sal_stub.c
deleted file mode 100644
index 1ebbb4c..0000000
--- a/sys/boot/ia64/ski/sal_stub.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/*-
- * Copyright (c) 2003 Marcel Moolenaar
- * 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 ``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 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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/types.h>
-#include <machine/md_var.h>
-#include <machine/sal.h>
-#include <stand.h>
-#include "libski.h"
-
-extern void PalProc(void);
-static sal_entry_t SalProc;
-
-struct {
- struct sal_system_table header;
- struct sal_entrypoint_descriptor entry;
- struct sal_ap_wakeup_descriptor wakeup;
-} sal_systab = {
- /* Header. */
- {
- SAL_SIGNATURE,
- sizeof(sal_systab),
- { 00, 03 }, /* Revision 3.0. */
- 2, /* Number of decsriptors. */
- 0, /* XXX checksum. */
- { 0 },
- { 00, 00 }, /* XXX SAL_A version. */
- { 00, 00 }, /* XXX SAL_B version. */
- "FreeBSD",
- "Ski loader",
- { 0 }
- },
- /* Entrypoint. */
- {
- 0, /* Type=entrypoint descr. */
- { 0 },
- 0, /* XXX PalProc. */
- 0, /* XXX SalProc. */
- 0, /* XXX SalProc GP. */
- { 0 }
- },
- /* AP wakeup. */
- {
- 5, /* Type=AP wakeup descr. */
- 0, /* External interrupt. */
- { 0 },
- 255 /* Wakeup vector. */
- }
-};
-
-static inline void
-puts(const char *s)
-{
- s = (const char *)((7UL << 61) | (u_long)s);
- while (*s)
- ski_cons_putchar(*s++);
-}
-
-static struct ia64_sal_result
-SalProc(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;
-
- res.sal_status = -3;
- res.sal_result[0] = 0;
- res.sal_result[1] = 0;
- res.sal_result[2] = 0;
-
- if (a1 == SAL_FREQ_BASE) {
- res.sal_status = 0;
- res.sal_result[0] = 133338184;
- } else if (a1 == SAL_SET_VECTORS) {
- /* XXX unofficial SSC function. */
- ssc(a2, a3, a4, a5, SSC_SAL_SET_VECTORS);
- } else if (a1 != SAL_GET_STATE_INFO_SIZE) {
- puts("SAL: unimplemented function called\n");
- }
-
- return (res);
-}
-
-void
-sal_stub_init(void)
-{
- struct ia64_fdesc *fd;
-
- fd = (void*)PalProc;
- sal_systab.entry.sale_pal_proc = fd->func;
- fd = (void*)SalProc;
- sal_systab.entry.sale_sal_proc = fd->func;
- sal_systab.entry.sale_sal_gp = fd->gp;
-}
diff --git a/sys/boot/ia64/ski/skiconsole.c b/sys/boot/ia64/ski/skiconsole.c
deleted file mode 100644
index e5cea3d..0000000
--- a/sys/boot/ia64/ski/skiconsole.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/*-
- * Copyright (c) 2000 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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <stand.h>
-
-#include "bootstrap.h"
-#include "libski.h"
-
-static void
-ski_cons_probe(struct console *cp)
-{
- cp->c_flags |= C_PRESENTIN | C_PRESENTOUT;
-}
-
-static int
-ski_cons_init(int arg)
-{
- ssc(0, 0, 0, 0, SSC_CONSOLE_INIT);
- return 0;
-}
-
-void
-ski_cons_putchar(int c)
-{
- ssc(c, 0, 0, 0, SSC_PUTCHAR);
-}
-
-static int pollchar = -1;
-
-int
-ski_cons_getchar()
-{
- int c;
-
- if (pollchar > 0) {
- c = pollchar;
- pollchar = -1;
- return c;
- }
-
- do {
- c = ssc(0, 0, 0, 0, SSC_GETCHAR);
- } while (c == 0);
-
- return c;
-}
-
-int
-ski_cons_poll()
-{
- int c;
- if (pollchar > 0)
- return 1;
- c = ssc(0, 0, 0, 0, SSC_GETCHAR);
- if (!c)
- return 0;
- pollchar = c;
- return 1;
-}
-
-struct console ski_console = {
- "ski",
- "ia64 SKI console",
- 0,
- ski_cons_probe,
- ski_cons_init,
- ski_cons_putchar,
- ski_cons_getchar,
- ski_cons_poll
-};
diff --git a/sys/boot/ia64/ski/skifs.c b/sys/boot/ia64/ski/skifs.c
deleted file mode 100644
index 72276fe..0000000
--- a/sys/boot/ia64/ski/skifs.c
+++ /dev/null
@@ -1,194 +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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <sys/param.h>
-#include <sys/time.h>
-#include <stddef.h>
-#include <stand.h>
-#include <stdarg.h>
-
-#include <bootstrap.h>
-#include "libski.h"
-
-struct disk_req {
- unsigned long addr;
- unsigned len;
-};
-
-struct disk_stat {
- int fd;
- unsigned count;
-};
-
-static int
-skifs_open(const char *path, struct open_file *f)
-{
- int fd;
-
- /*
- * Skip leading '/' so that our pretend filesystem starts in
- * the current working directory.
- */
- while (*path == '/')
- path++;
-
- fd = ssc((u_int64_t) path, 1, 0, 0, SSC_OPEN);
- if (fd > 0) {
- f->f_fsdata = (void*)(u_int64_t) fd;
- return 0;
- }
- return ENOENT;
-}
-
-static int
-skifs_close(struct open_file *f)
-{
- ssc((u_int64_t) f->f_fsdata, 0, 0, 0, SSC_CLOSE);
- return 0;
-}
-
-static int
-skifs_read(struct open_file *f, void *buf, size_t size, size_t *resid)
-{
- struct disk_req req;
- struct disk_stat stat;
-
- req.len = size;
- req.addr = (u_int64_t) buf;
- ssc((u_int64_t) f->f_fsdata, 1, (u_int64_t) &req, f->f_offset, SSC_READ);
- stat.fd = (u_int64_t) f->f_fsdata;
- ssc((u_int64_t)&stat, 0, 0, 0, SSC_WAIT_COMPLETION);
-
- *resid = size - stat.count;
- f->f_offset += stat.count;
- return 0;
-}
-
-static off_t
-skifs_seek(struct open_file *f, off_t offset, int where)
-{
- u_int64_t base;
-
- switch (where) {
- case SEEK_SET:
- base = 0;
- break;
-
- case SEEK_CUR:
- base = f->f_offset;
- break;
-
- case SEEK_END:
- printf("can't find end of file in SKI\n");
- base = f->f_offset;
- break;
- }
-
- f->f_offset = base + offset;
- return base;
-}
-
-static int
-skifs_stat(struct open_file *f, struct stat *sb)
-{
- bzero(sb, sizeof(*sb));
- sb->st_mode = S_IFREG | S_IRUSR;
- return 0;
-}
-
-static int
-skifs_readdir(struct open_file *f, struct dirent *d)
-{
- return ENOENT;
-}
-
-struct fs_ops ski_fsops = {
- "fs",
- skifs_open,
- skifs_close,
- skifs_read,
- null_write,
- skifs_seek,
- skifs_stat,
- skifs_readdir
-};
-
-static int
-skifs_dev_init(void)
-{
- return 0;
-}
-
-/*
- * Print information about disks
- */
-static void
-skifs_dev_print(int verbose)
-{
-}
-
-/*
- * Attempt to open the disk described by (dev) for use by (f).
- *
- * Note that the philosophy here is "give them exactly what
- * they ask for". This is necessary because being too "smart"
- * about what the user might want leads to complications.
- * (eg. given no slice or partition value, with a disk that is
- * sliced - are they after the first BSD slice, or the DOS
- * slice before it?)
- */
-static int
-skifs_dev_open(struct open_file *f, ...)
-{
- return 0;
-}
-
-static int
-skifs_dev_close(struct open_file *f)
-{
-
- return 0;
-}
-
-static int
-skifs_dev_strategy(void *devdata, int rw, daddr_t dblk, size_t size, char *buf, size_t *rsize)
-{
- return 0;
-}
-
-struct devsw skifs_dev = {
- "fs",
- DEVT_DISK,
- skifs_dev_init,
- skifs_dev_strategy,
- skifs_dev_open,
- skifs_dev_close,
- noioctl,
- skifs_dev_print
-};
diff --git a/sys/boot/ia64/ski/skiload.cmd b/sys/boot/ia64/ski/skiload.cmd
deleted file mode 100644
index 48b77e1..0000000
--- a/sys/boot/ia64/ski/skiload.cmd
+++ /dev/null
@@ -1,16 +0,0 @@
-# $FreeBSD$
-iar
-fr
-pa
-b enter_kernel
-c
-b printf
-c
-b rp
-c
-b ssc
-c
-b rp
-c
-bD
-s 11
diff --git a/sys/boot/ia64/ski/skimd.c b/sys/boot/ia64/ski/skimd.c
deleted file mode 100644
index baa3138..0000000
--- a/sys/boot/ia64/ski/skimd.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/*-
- * Copyright (c) 2006 Marcel Moolenaar
- * 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 ``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 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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <stand.h>
-
-#include <libia64.h>
-
-#include "libski.h"
-
-extern void acpi_stub_init(void);
-extern void efi_stub_init(struct bootinfo *);
-extern void sal_stub_init(void);
-
-vm_paddr_t
-ia64_platform_alloc(vm_offset_t va, vm_size_t sz __unused)
-{
- vm_paddr_t pa;
-
- if (va == 0)
- pa = 2 * 1024 * 1024;
- else
- pa = (va - IA64_PBVM_BASE) + (32 * 1024 * 1024);
-
- return (pa);
-}
-
-void
-ia64_platform_free(vm_offset_t va __unused, vm_paddr_t pa __unused,
- vm_size_t sz __unused)
-{
-}
-
-int
-ia64_platform_bootinfo(struct bootinfo *bi, struct bootinfo **res)
-{
- static struct bootinfo bootinfo;
-
- efi_stub_init(bi);
- sal_stub_init();
- acpi_stub_init();
-
- if (IS_LEGACY_KERNEL())
- *res = &bootinfo;
-
- return (0);
-}
-
-int
-ia64_platform_enter(const char *kernel)
-{
-
- while (*kernel == '/')
- kernel++;
- ssc(0, (uint64_t)kernel, 0, 0, SSC_LOAD_SYMBOLS);
- return (0);
-}
diff --git a/sys/boot/ia64/ski/ssc.c b/sys/boot/ia64/ski/ssc.c
deleted file mode 100644
index e1f871c..0000000
--- a/sys/boot/ia64/ski/ssc.c
+++ /dev/null
@@ -1,53 +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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <stand.h>
-#include "libski.h"
-
-/*
- * 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 preserve
- * PSR.dt across the SSC call. We do this by saving and restoring psr.l
- * completely.
- */
-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 psr;
- register u_int64_t ret0 __asm("r8");
-
- __asm __volatile("mov %0=psr;;" : "=r"(psr));
- __asm __volatile("mov r15=%1\n\t"
- "break 0x80000;;"
- : "=r"(ret0)
- : "r"(which), "r"(in0), "r"(in1), "r"(in2), "r"(in3));
- __asm __volatile("mov psr.l=%0;; srlz.d" :: "r"(psr));
- return ret0;
-}
diff --git a/sys/boot/ia64/ski/start.S b/sys/boot/ia64/ski/start.S
deleted file mode 100644
index 0bd10e9..0000000
--- a/sys/boot/ia64/ski/start.S
+++ /dev/null
@@ -1,62 +0,0 @@
-/*-
- * Copyright (c) 2003 Marcel Moolenaar
- * 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 ``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 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$
- */
-
-#define STACKSIZE 16384
-#define FPSR_DEFAULT 0x0009804c0270033f
-
- .text
- .global _start
- .proc _start
-_start:
-{ .mlx
- mov ar.rsc=0
- movl gp=__gp
- ;;
-}
-{ .mlx
- add r2=@gprel(stack),gp
- movl r14=FPSR_DEFAULT
- ;;
-}
-{ .mib
- mov ar.bspstore=r2
- add r12=STACKSIZE-16,r2
- bsw.1
- ;;
-}
-{ .mmb
- mov ar.rsc=3
- mov ar.fpsr=r14
- br.sptk ski_main
- ;;
-}
- .endp _start
-
- .data
- .align 16
-stack: .skip STACKSIZE
diff --git a/sys/boot/ia64/ski/time.c b/sys/boot/ia64/ski/time.c
deleted file mode 100644
index 7aa7120..0000000
--- a/sys/boot/ia64/ski/time.c
+++ /dev/null
@@ -1,174 +0,0 @@
-/*-
- * Copyright (c) 1999, 2000
- * Intel Corporation.
- * 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.
- *
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- *
- * This product includes software developed by Intel Corporation and
- * its contributors.
- *
- * 4. Neither the name of Intel Corporation or its contributors may be
- * used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION 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 INTEL CORPORATION 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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
-#include <time.h>
-#include <sys/time.h>
-#include <stand.h>
-
-#include "libski.h"
-
-/*
-// Accurate only for the past couple of centuries;
-// that will probably do.
-//
-// (#defines From FreeBSD 3.2 lib/libc/stdtime/tzfile.h)
-*/
-
-#define isleap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0))
-#define SECSPERHOUR ( 60*60 )
-#define SECSPERDAY (24 * SECSPERHOUR)
-
-struct ssc_time {
- int Year;
- int Month;
- int Day;
- int Hour;
- int Minute;
- int Second;
- int Msec;
- int Wday;
-};
-
-time_t
-EfiTimeToUnixTime(struct ssc_time *ETime)
-{
- /*
- // These arrays give the cumulative number of days up to the first of the
- // month number used as the index (1 -> 12) for regular and leap years.
- // The value at index 13 is for the whole year.
- */
- static time_t CumulativeDays[2][14] = {
- {0,
- 0,
- 31,
- 31 + 28,
- 31 + 28 + 31,
- 31 + 28 + 31 + 30,
- 31 + 28 + 31 + 30 + 31,
- 31 + 28 + 31 + 30 + 31 + 30,
- 31 + 28 + 31 + 30 + 31 + 30 + 31,
- 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31,
- 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30,
- 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31,
- 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30,
- 31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31 },
- {0,
- 0,
- 31,
- 31 + 29,
- 31 + 29 + 31,
- 31 + 29 + 31 + 30,
- 31 + 29 + 31 + 30 + 31,
- 31 + 29 + 31 + 30 + 31 + 30,
- 31 + 29 + 31 + 30 + 31 + 30 + 31,
- 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31,
- 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30,
- 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31,
- 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30,
- 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30 + 31 }};
-
- time_t UTime;
- int Year;
-
- ETime->Year += 1900;
-
- /*
- // Do a santity check
- */
- if ( ETime->Year < 1998 || ETime->Year > 2099 ||
- ETime->Month == 0 || ETime->Month > 12 ||
- ETime->Day == 0 || ETime->Month > 31 ||
- ETime->Hour > 23 ||
- ETime->Minute > 59 ||
- ETime->Second > 59 ) {
- return (0);
- }
-
- /*
- // Years
- */
- UTime = 0;
- for (Year = 1970; Year != ETime->Year; ++Year) {
- UTime += (CumulativeDays[isleap(Year)][13] * SECSPERDAY);
- }
-
- /*
- // UTime should now be set to 00:00:00 on Jan 1 of the file's year.
- //
- // Months
- */
- UTime += (CumulativeDays[isleap(ETime->Year)][ETime->Month] * SECSPERDAY);
-
- /*
- // UTime should now be set to 00:00:00 on the first of the file's month and year
- //
- // Days -- Don't count the file's day
- */
- UTime += (((ETime->Day > 0) ? ETime->Day-1:0) * SECSPERDAY);
-
- /*
- // Hours
- */
- UTime += (ETime->Hour * SECSPERHOUR);
-
- /*
- // Minutes
- */
- UTime += (ETime->Minute * 60);
-
- /*
- // Seconds
- */
- UTime += ETime->Second;
-
- return UTime;
-}
-
-time_t
-time(time_t *tloc)
-{
- struct ssc_time time;
-
- ssc((u_int64_t) &time, 0, 0, 0, SSC_GET_RTC);
-
- return *tloc = EfiTimeToUnixTime(&time);
-}
diff --git a/sys/boot/ia64/ski/version b/sys/boot/ia64/ski/version
deleted file mode 100644
index a5b40f5..0000000
--- a/sys/boot/ia64/ski/version
+++ /dev/null
@@ -1,12 +0,0 @@
-$FreeBSD$
-
-NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this
-file is important. Make sure the current version number is on line 6.
-
-2.0: Add support for PBVM.
-1.2: Restructured. Has some user visible differences. Due to code
- sharing, has been given the same version number as the EFI
- loader.
-0.2: Pass the address of the bootinfo block to the kernel in register
- r8. Keep it at the hardwired address for now.
-0.1: Initial SKI version.
diff --git a/sys/boot/libstand32/Makefile b/sys/boot/libstand32/Makefile
index 56f7d15..0325583 100644
--- a/sys/boot/libstand32/Makefile
+++ b/sys/boot/libstand32/Makefile
@@ -60,12 +60,10 @@ SRCS+= ntoh.c
# string functions from libc
.PATH: ${LIBC}/string
-.if ${MACHINE_CPUARCH} != "ia64"
SRCS+= bcmp.c bcopy.c bzero.c ffs.c memccpy.c memchr.c memcmp.c memcpy.c \
memmove.c memset.c qdivrem.c strcat.c strchr.c strcmp.c strcpy.c \
strcspn.c strlen.c strncat.c strncmp.c strncpy.c strpbrk.c \
strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c
-.endif
.if ${MACHINE_CPUARCH} == "arm"
.PATH: ${LIBC}/arm/gen
@@ -86,17 +84,6 @@ SRCS+= aeabi_memcmp.S aeabi_memcpy.S aeabi_memmove.S aeabi_memset.S
.endif
.endif
-.if ${MACHINE_CPUARCH} == "ia64"
-.PATH: ${LIBC}/ia64/string
-SRCS+= bcmp.c bcopy.S bzero.S ffs.S memccpy.c memchr.c memcmp.c memcpy.S \
- memmove.S memset.c strcat.c strchr.c strcmp.c strcpy.c strcspn.c \
- strlen.c strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strsep.c \
- strspn.c strstr.c strtok.c swab.c
-
-.PATH: ${LIBC}/ia64/gen
-SRCS+= __divdi3.S __divsi3.S __moddi3.S __modsi3.S
-SRCS+= __udivdi3.S __udivsi3.S __umoddi3.S __umodsi3.S
-.endif
.if ${MACHINE_CPUARCH} == "powerpc"
.PATH: ${LIBC}/quad
SRCS+= ashldi3.c ashrdi3.c
diff --git a/sys/boot/userboot/libstand/Makefile b/sys/boot/userboot/libstand/Makefile
index 042b6a3..692aa5a 100644
--- a/sys/boot/userboot/libstand/Makefile
+++ b/sys/boot/userboot/libstand/Makefile
@@ -69,18 +69,6 @@ SRCS+= bcmp.c bcopy.c bzero.c ffs.c memccpy.c memchr.c memcmp.c memcpy.c \
.PATH: ${LIBC}/arm/gen
SRCS+= divsi3.S
.endif
-.if ${MACHINE_CPUARCH} == "ia64"
-.PATH: ${LIBC}/ia64/string
-SRCS+= bcmp.c bcopy.S bzero.S ffs.S index.c memccpy.c memchr.c memcmp.c \
- memcpy.S memmove.S memset.c rindex.c strcat.c strchr.c \
- strcmp.c strcpy.c strcspn.c strlen.c \
- strncat.c strncmp.c strncpy.c strpbrk.c strrchr.c strsep.c \
- strspn.c strstr.c strtok.c swab.c
-
-.PATH: ${LIBC}/ia64/gen
-SRCS+= __divdi3.S __divsi3.S __moddi3.S __modsi3.S
-SRCS+= __udivdi3.S __udivsi3.S __umoddi3.S __umodsi3.S
-.endif
.if ${MACHINE_CPUARCH} == "powerpc"
.PATH: ${LIBC}/libc/quad
SRCS+= ashldi3.c ashrdi3.c
OpenPOWER on IntegriCloud