[Midnightbsd-cvs] src: sys/boot:
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sun Sep 21 11:21:35 EDT 2008
Log Message:
-----------
Modified Files:
--------------
src/sys/boot:
Makefile (r1.3 -> r1.4)
src/sys/boot/common:
Makefile.inc (r1.3 -> r1.4)
bootstrap.h (r1.1.1.2 -> r1.2)
console.c (r1.1.1.1 -> r1.2)
devopen.c (r1.1.1.1 -> r1.2)
help.common (r1.1.1.2 -> r1.2)
load_elf.c (r1.2 -> r1.3)
load_elf_obj.c (r1.1.1.2 -> r1.2)
loader.8 (r1.1.1.2 -> r1.2)
merge_help.awk (r1.1.1.1 -> r1.2)
module.c (r1.1.1.2 -> r1.2)
panic.c (r1.2 -> r1.3)
pnp.c (r1.1.1.1 -> r1.2)
reloc_elf.c (r1.1.1.2 -> r1.2)
ufsread.c (r1.1.1.1 -> r1.2)
src/sys/boot/efi/include:
efi.h (r1.1.1.1 -> r1.2)
efi_nii.h (r1.1.1.1 -> r1.2)
efiapi.h (r1.1.1.1 -> r1.2)
eficon.h (r1.1.1.1 -> r1.2)
efidebug.h (r1.1.1.1 -> r1.2)
efidef.h (r1.1.1.1 -> r1.2)
efidevp.h (r1.1.1.1 -> r1.2)
efierr.h (r1.1.1.1 -> r1.2)
efifs.h (r1.1.1.1 -> r1.2)
efilib.h (r1.1.1.1 -> r1.2)
efinet.h (r1.1.1.1 -> r1.2)
efipart.h (r1.1.1.1 -> r1.2)
efiprot.h (r1.1.1.1 -> r1.2)
efipxebc.h (r1.1.1.1 -> r1.2)
efiser.h (r1.1.1.1 -> r1.2)
efistdarg.h (r1.1.1.1 -> r1.2)
src/sys/boot/efi/include/i386:
efibind.h (r1.1.1.1 -> r1.2)
pe.h (r1.1.1.1 -> r1.2)
src/sys/boot/efi/include/ia64:
efibind.h (r1.1.1.1 -> r1.2)
pe.h (r1.1.1.1 -> r1.2)
src/sys/boot/ficl:
Makefile (r1.3 -> r1.4)
ficl.h (r1.1.1.2 -> r1.2)
float.c (r1.1.1.2 -> r1.2)
loader.c (r1.1.1.1 -> r1.2)
tools.c (r1.1.1.2 -> r1.2)
unix.c (r1.1.1.1 -> r1.2)
vm.c (r1.1.1.2 -> r1.2)
words.c (r1.1.1.2 -> r1.2)
src/sys/boot/ficl/softwords:
fileaccess.fr (r1.1.1.1 -> r1.2)
jhlocal.fr (r1.1.1.1 -> r1.2)
oo.fr (r1.1.1.1 -> r1.2)
prefix.fr (r1.1.1.1 -> r1.2)
softcore.awk (r1.1.1.1 -> r1.2)
src/sys/boot/forth:
beastie.4th (r1.3 -> r1.4)
frames.4th (r1.2 -> r1.3)
loader.4th (r1.2 -> r1.3)
loader.conf (r1.2 -> r1.3)
Removed Files:
-------------
src/sys/boot/arc:
Makefile
Makefile.inc
src/sys/boot/arc/include:
arcfuncs.h
arctypes.h
libarc.h
src/sys/boot/arc/lib:
Makefile
abort.c
arcconsole.c
arcdisk.c
bootinfo.c
delay.c
devicename.c
elf_freebsd.c
module.c
prom.c
setjmperr.c
time.c
src/sys/boot/arc/lib/arch/alpha:
copy.c
rpb.c
setjmp.S
start.S
src/sys/boot/arc/loader:
Makefile
conf.c
help.alpha
main.c
version
src/sys/boot/ficl/ia64:
sysdep.c
sysdep.h
src/sys/boot/ficl/powerpc:
sysdep.c
sysdep.h
-------------- next part --------------
--- sys/boot/arc/Makefile.inc
+++ /dev/null
@@ -1,7 +0,0 @@
-# $FreeBSD: src/sys/boot/arc/Makefile.inc,v 1.2 2000/05/01 20:26:21 peter Exp $
-# Options used when building app-specific libalpha components
-LOAD_ADDRESS= 0xffffffff80900000
-DPADD+= ${DESTDIR}/${LIBDIR}/libstand.a
-LIBSTANDDIR= ${.CURDIR}/../../../../lib/libstand
-LIBSTAND= -lstand
-LIBARC= ${.OBJDIR}/../lib/libarc.a
--- sys/boot/arc/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-# $FreeBSD: src/sys/boot/arc/Makefile,v 1.2 1999/08/28 00:39:33 peter Exp $
-
-SUBDIR= lib
-SUBDIR+= loader
-
-.include <bsd.subdir.mk>
--- sys/boot/arc/include/arctypes.h
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- * Copyright (c) 1999, Stefan Esser <se at 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 unmodified, 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: src/sys/boot/arc/include/arctypes.h,v 1.2 1999/08/28 00:39:34 peter Exp $
- *
- */
-
-#ifndef _ARC_TYPES_H_
-#define _ARC_TYPES_H_
-
-#define ESUCCESS 0
-
-typedef u_int8_t BOOLEAN;
-typedef u_int16_t WCHAR;
-
-typedef int64_t fpos_t;
-
-/* XXX the following types are defined in ARC but are not currently used */
-
-#if 0
-
-typedef void VOID;
-
-typedef int8_t CHAR;
-typedef int16_t SHORT;
-typedef int32_t LONG;
-typedef int64_t LONGLONG;
-
-typedef u_int8_t UCHAR;
-typedef u_int16_t USHORT;
-typedef u_int32_t ULONG;
-typedef u_int64_t ULONGLONG;
-
-/*
- * The following ARC types conflict with <sys/types.h> !
- * They are not used in the ARC wrapper functions or ARC structs
- * currently, and thus may be left alone for now. In case the
- * wrappers or structs are converted to use them, it is suggested
- * to prefix them with "arc" to avoid type clashes (if linking
- * against libstand.a which expects the FreeBSD declarations).
- */
-
-typedef u_int32_t size_t;
-typedef int64_t clock_t;
-typedef int64_t off_t;
-typedef int32_t time_t;
-
-#endif /* 0 */
-
-typedef struct {
- int32_t adr;
-} arcptr;
-
-typedef struct {
- u_int32_t SPBSignature;
- u_int32_t SPBLength;
- u_int16_t Version;
- u_int16_t Revision;
- arcptr RestartBlockP;
- arcptr DebugBlockP;
- arcptr GEVectorP;
- arcptr ULTBMissVectorP;
- u_int32_t FirmwareVectorLength;
- arcptr FirmwareVectorP;
- u_int32_t PrivateVectorLength;
- arcptr PrivateVectorP;
- u_int32_t AdapterCount;
- struct {
- u_int32_t AdapterType;
- u_int32_t AdapterVectorLength;
- arcptr AdapterVectorP;
- } Adapters[1];
-} SPB;
-
-/* ARC function specific data types */
-
-typedef enum{
- SystemClass,
- ProcessorClass,
- CacheClass,
- AdapterClass,
- ControllerClass,
- PeripheralClass,
- MemoryClass,
- MaximumClass
-} CONFIGURATION_CLASS;
-
-typedef enum {
- ArcSystem,
- CentralProcessor,
- FloatingPointProcessor,
- PrimaryIcache,
- PrimaryDcache,
- SecondaryIcache,
- SecondaryDcache,
- SecondaryCache,
- EisaAdapter,
- TcAdapter,
- ScsiAdapter,
- DtiAdapter,
- MultiFunctionAdapter,
- DiskController,
- TapeController,
- CdromController,
- WormController,
- SerialController,
- NetworkController,
- DisplayController,
- ParallelController,
- PointerController,
- KeyboardController,
- AudioController,
- OtherController,
- DiskPeripheral,
- FloppyDiskPeripheral,
- TapePeripheral,
- ModemPeripheral,
- MonitorPeripheral,
- PrinterPeripheral,
- PointerPeripheral,
- KeyboardPeripheral,
- TerminalPeripheral,
- OtherPeripheral,
- LinePeripheral,
- NetworkPeripheral,
- SystemMemory,
- MaximumType
-} CONFIGURATION_TYPE, *PCONFIGURATION_TYPE;
-
-typedef enum {
- Failed = 0x01,
- ReadOnly = 0x02,
- Removable = 0x04,
- ConsoleIn = 0x08,
- ConsoleOut = 0x10,
- Input = 0x20,
- Output = 0x40
-} IDENTIFIERFLAG;
-
-typedef struct {
- CONFIGURATION_CLASS Class;
- CONFIGURATION_TYPE Type;
- IDENTIFIERFLAG Flags;
- u_int16_t Version;
- u_int16_t Revision;
- u_int32_t Key;
- u_int32_t AffinityMask;
- u_int32_t ConfigurationDataLength;
- u_int32_t IdentifierLength;
- arcptr Identifier;
-} CONFIGURATION_COMPONENT, *PCONFIGURATION_COMPONENT;
-
-typedef struct {
- int8_t VendorId[8];
- int8_t ProductId[8];
-} SYSTEM_ID;
-
-typedef enum {
- MemoryExceptionBlock,
- MemorySystemBlock,
- MemoryFree,
- MemoryBad,
- MemoryLoadedProgram,
- MemoryFirmwareTemporary,
- MemoryFirmwarePermanent,
- MemoryFreeContiguous,
- MemorySpecialMemory,
- MemoryMaximum
-} MEMORY_TYPE;
-
-typedef struct {
- MEMORY_TYPE Type;
- u_int32_t BasePage;
- u_int32_t PageCount;
-} MEMORY_DESCRIPTOR;
-
-typedef struct _TIME_FIELDS{
- u_int16_t Year; /* 1601 .. */
- u_int16_t Month; /* 1 .. 12 */
- u_int16_t Day; /* 1 .. 31 */
- u_int16_t Hour; /* 0 .. 23 */
- u_int16_t Minute; /* 0 .. 59 */
- u_int16_t Second; /* 0 .. 59 */
- u_int16_t Milliseconds; /* 0 .. 999 */
- u_int16_t Weekday; /* 0 .. 6 = Sunday .. Saturday */
-} TIME_FIELDS, *PTIME_FIELDS;
-
-#define StandardIn 0
-#define StandardOut 1
-
-#define ReadOnlyFile 0x01
-#define HiddenFile 0x02
-#define SystemFile 0x04
-#define ArchiveFile 0x08
-#define DirectoryFile 0x10
-#define DeleteFile 0x20
-
-typedef struct {
- u_int32_t FileNameLength;
- u_int8_t FileAttribute;
- int8_t FileName[32];
-} DIRECTORY_ENTRY;
-
-typedef enum {
- OpenReadOnly,
- OpenWriteOnly,
- OpenReadWrite,
- CreateWriteOnly,
- CreateReadWrite,
- SupersedeWriteOnly,
- SupersedeReadWrite,
- OpenDirectory,
- CreateDirectory,
- OpenMaximumMode
-} OPEN_MODE;
-
-typedef enum {
- SeekAbsolute,
- SeekRelative,
- SeekMaximum
-} SEEK_MODE;
-
-typedef enum {
- MountLoadMedia,
- MountUnloadMedia,
- MountMaximum
-} MOUNT_OPERATION;
-
-typedef struct {
- fpos_t StartingAddress;
- fpos_t EndingAddress;
- fpos_t CurrentAddress;
- CONFIGURATION_TYPE Type;
- u_int32_t FileNameLength;
- u_int8_t Attributes;
- int8_t FileName[32];
-} FILE_INFORMATION;
-
-typedef struct {
- u_int16_t CursorXPosition;
- u_int16_t CursorYPosition;
- u_int16_t CursorMaxXPosition;
- u_int16_t CursorMaxYPosition;
- u_int8_t ForegroundColor;
- u_int8_t BackgroundColor;
- BOOLEAN HighIntensity;
- BOOLEAN Underscored;
- BOOLEAN ReverseVideo;
-} ARC_DISPLAY_STATUS;
-
-/* vendor function specific data types */
-
-typedef struct {
- u_int32_t ProcessorId;
- u_int32_t ProcessorRevision;
- u_int32_t ProcessorPageSize;
- u_int32_t NumberOfPhysicalAddressBits;
- u_int32_t MaximumAddressSpaceNumber;
- u_int32_t ProcessorCycleCounterPeriod;
- u_int32_t SystemRevision;
- u_int8_t SystemSerialNumber[16];
- u_int8_t FirmwareVersion[16];
- u_int8_t FirmwareBuildTimeStamp[12];
-} EXTENDED_SYSTEM_INFORMATION, *PEXTENDED_SYSTEM_INFORMATION;
-
-#endif /* _ARC_TYPES_H_ */
--- sys/boot/arc/include/libarc.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/* $FreeBSD: src/sys/boot/arc/include/libarc.h,v 1.2 1999/08/28 00:39:34 peter Exp $ */
-
-/*
- * Copyright (c) 1996
- * 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.
- *
- */
-
-/*
- * ARC fully-qualified device descriptor
- */
-struct arc_devdesc
-{
- struct devsw *d_dev;
- int d_type;
-#define DEVT_NONE 0
-#define DEVT_DISK 1
-#define DEVT_NET 2
- union
- {
- struct
- {
- int unit;
- int slice;
- int partition;
- } arcdisk;
- struct
- {
- int unit; /* XXX net layer lives over these? */
- } netif;
- } d_kind;
-};
-
-extern int arc_getdev(void **vdev, const char *devspec, const char **path);
-extern char *arc_fmtdev(void *vdev);
-extern int arc_setcurrdev(struct env_var *ev, int flags, void *value);
-
-#define MAXDEV 31 /* maximum number of distinct devices */
-
-typedef unsigned long physaddr_t;
-
-/* exported devices XXX rename? */
-extern struct devsw arcdisk;
-extern struct netif_driver arcnet;
-
-/* this is in startup code */
-extern void delay(int);
-extern void reboot(void);
-
-extern int arc_copyin(void *src, vm_offset_t dest, size_t len);
-extern int arc_copyout(vm_offset_t src, void *dest, size_t len);
-extern int arc_readin(int fd, vm_offset_t dest, size_t len);
-
-extern int arc_boot(void);
-extern int arc_autoload(void);
--- sys/boot/arc/include/arcfuncs.h
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * Copyright (c) 1999, Stefan Esser <se at 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 unmodified, 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: src/sys/boot/arc/include/arcfuncs.h,v 1.4 2005/03/02 21:33:22 joerg Exp $
- *
- */
-
-#ifndef _ARCFUNCS_H
-#define _ARCFUNCS_H
-
-#ifndef _SYS_CDEFS_H_
-#error this file needs sys/cdefs.h as a prerequisite
-#endif
-
-#ifdef __CC_SUPPORTS_INLINE
-#define INLINE inline
-#else
-#define INLINE /**/
-#endif
-
-/* System Parameter Block holding ARC and VENDOR function vector addresses */
-
-#define SPBlock ((SPB *)0xffffffff806fe000ul)
-
-/*
- * Convert between 32bit (ARC) and 64bit (Alpha) pointers
- */
-
-static INLINE void*
-ptr(arcptr p)
-{
- return (void*)(int64_t)p.adr;
-}
-
-static INLINE arcptr
-toarcptr(void *p)
-{
- arcptr p32;
- p32.adr = (int32_t)(int64_t) p;
- return (p32);
-}
-
-/*
- * Return entry point for ARC BIOS function "funcno"
- */
-
-static INLINE void *
-get_arc_vector(int funcno)
-{
- arcptr (*arc_vector)[] = ptr(SPBlock->FirmwareVectorP);
- return ptr((*arc_vector)[funcno -1]);
-}
-
-/*
- * Return entry point for VENDOR function "funcno"
- */
-
-static INLINE void *
-get_vendor_vector(int funcno)
-{
- arcptr (*arc_vector)[] = ptr(SPBlock->PrivateVectorP);
- return ptr((*arc_vector)[funcno -1]);
-}
-
-static INLINE int
-get_vendor_vector_length(void)
-{
- return SPBlock->PrivateVectorLength;
-}
-
-/*
- * Macros to create inline wrappers for ARCS BIOS functions
- *
- * Parameter:
- * num function number (starting at 1)
- * result result type
- * fn function name
- * param parameter list (types and formal args)
- * args parameter list (formal args only)
- */
-
-#define ARC_FN(num,result,fn,param,args) \
-static inline result fn param { \
- typedef result _fn_t param; \
- _fn_t *p_ ## fn = get_arc_vector(num); \
- return p_ ## fn args; \
-}
-
-#define VND_FN(num,result,fn,param,args) \
-static INLINE result fn param { \
- typedef result _fn_t param; \
- _fn_t *p_ ## fn = get_vendor_vector(num); \
- return p_ ## fn args; \
-}
-
-/* function codes as defined in ARC Specification Version 1.2 */
-
-ARC_FN(1, int32_t, Load,
- (char *Path, u_int32_t TopAddr, u_int32_t *ExecAddr, u_int32_t *LowAddr),
- (Path, TopAddr, ExecAddr, LowAddr))
-ARC_FN(2, int32_t, Invoke,
- (u_int32_t ExecAddr, u_int32_t StackAddr, u_int32_t Argc, char *Argv[], char *Envp[]),
- (ExecAddr, StackAddr, Argc, Argv, Envp))
-ARC_FN(3, int32_t, Execute,
- (char *Path, u_int32_t Argc, char *Argv[], char *Envp[]),
- (Path, Argc, Argv, Envp))
-ARC_FN(4, void, Halt, (void), ())
-ARC_FN(5, void, PowerDown, (void), ())
-ARC_FN(6, void, Restart, (void), ())
-ARC_FN(7, void, FwReboot, (void), ())
-ARC_FN(8, void, EnterInteractiveMode, (void), ())
-ARC_FN(10, CONFIGURATION_COMPONENT *, GetPeer,
- (CONFIGURATION_COMPONENT *Current),
- (Current))
-ARC_FN(11, CONFIGURATION_COMPONENT *, GetChild,
- (CONFIGURATION_COMPONENT *Current),
- (Current))
-ARC_FN(12, CONFIGURATION_COMPONENT *, GetParent,
- (CONFIGURATION_COMPONENT *Current),
- (Current))
-ARC_FN(13, CONFIGURATION_COMPONENT *, AddChild,
- (CONFIGURATION_COMPONENT *Current, CONFIGURATION_COMPONENT *Template,
- void *ConfigurationData),
- (Current, Template, ConfigurationData))
-ARC_FN(14, int32_t, DeleteComponent,
- (CONFIGURATION_COMPONENT *ComponentToDelete),
- (ComponentToDelete))
-ARC_FN(15, CONFIGURATION_COMPONENT *, GetComponent, (char *Path), (Path))
-ARC_FN(16, int32_t, GetConfigurationData,
- (void *ConfigurationData, CONFIGURATION_COMPONENT *Component),
- (ConfigurationData, Component))
-ARC_FN(17, int32_t, SaveConfiguration, (void), ())
-ARC_FN(18, SYSTEM_ID *, GetSystemId, (void), ())
-ARC_FN(19, MEMORY_DESCRIPTOR *, GetMemoryDescriptor,
- (MEMORY_DESCRIPTOR *Current),
- (Current))
-ARC_FN(21, TIME_FIELDS *, GetTime, (void), ())
-ARC_FN(22, u_int32_t, GetRelativeTime, (void), ())
-ARC_FN(23, int32_t, GetDirectoryEntry,
- (u_int32_t FileId, DIRECTORY_ENTRY *Buffer, u_int32_t Length, u_int32_t *Count),
- (FileId, Buffer, Length, Count))
-ARC_FN(24, int32_t, Open,
- (const char *Path, OPEN_MODE OpenMode, u_int32_t *FileId),
- (Path, OpenMode, FileId))
-ARC_FN(25, int32_t, Close, (u_int32_t FileId), (FileId))
-ARC_FN(26, int32_t, Read,
- (u_int32_t FileId, void *Buffer, u_int32_t N, u_int32_t *Count),
- (FileId, Buffer, N, Count))
-ARC_FN(27, int32_t, GetReadStatus, (u_int32_t FileId), (FileId))
-ARC_FN(28, int32_t, Write,
- (u_int32_t FileId, void const *Buffer, u_int32_t N, u_int32_t *Count),
- (FileId, Buffer, N, Count))
-ARC_FN(29, int32_t, Seek,
- (u_int32_t FileId, fpos_t *Position, SEEK_MODE SeekMode),
- (FileId, Position, SeekMode))
-ARC_FN(30, int32_t, Mount,
- (char *Path, MOUNT_OPERATION Operation),
- (Path, Operation))
-ARC_FN(31, char *, GetEnvironmentVariable, (char *Name), (Name))
-ARC_FN(32, int32_t, SetEnvironmentVariable,
- (char *Name, char *Value),
- (Name, Value))
-ARC_FN(33, int32_t, GetFileInformation,
- (u_int32_t FileId, FILE_INFORMATION *Information),
- (FileId, Information))
-ARC_FN(34, int32_t, SetFileInformation,
- (u_int32_t FileId, u_int32_t AttributeFlags, u_int32_t AttributeMask),
- (FileId, AttributeFlags, AttributeMask))
-ARC_FN(35, void, FlushAllCaches, (void), ())
-ARC_FN(36, int32_t, TestUnicodeCharacter,
- (u_int32_t FileId, WCHAR UnicodeCharacter),
- (FileId, UnicodeCharacter))
-ARC_FN(37, ARC_DISPLAY_STATUS *, GetDisplayStatus, (u_int32_t FileId), (FileId))
-
-/* Vendor specific function codes have not been verified beyond function 4 */
-
-VND_FN(1, void *, AllocatePool, (u_int32_t NumberOfBytes), (NumberOfBytes))
-VND_FN(2, void, StallExecution, (u_int32_t Microseconds), (Microseconds))
-VND_FN(3, u_int32_t, Print,
- (char *Format, int32_t Arg1, int32_t Arg2, int32_t Arg3),
- (Format, Arg1, Arg2, Arg3))
-VND_FN(4, void, ReturnExtendedSystemInformation,
- (EXTENDED_SYSTEM_INFORMATION *SystemInfo),
- (SystemInfo))
-
-#endif /* _ARGFUNCS_H */
-
--- sys/boot/arc/lib/devicename.c
+++ /dev/null
@@ -1,236 +0,0 @@
-/*-
- * Copyright (c) 1998 Michael Smith <msmith at 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: src/sys/boot/arc/lib/devicename.c,v 1.4 2004/01/04 23:28:01 obrien Exp $");
-
-#include <stand.h>
-#include <string.h>
-#include "bootstrap.h"
-#include "libarc.h"
-
-static int arc_parsedev(struct arc_devdesc **dev, const char *devspec, const char **path);
-
-/*
- * 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
-arc_getdev(void **vdev, const char *devspec, const char **path)
-{
- struct arc_devdesc **dev = (struct arc_devdesc **)vdev;
- int rv;
-
- /*
- * If it looks like this is just a path and no
- * device, go with the current device.
- */
- if ((devspec == NULL) ||
- (devspec[0] == '/') ||
- (strchr(devspec, ':') == NULL)) {
-
- if (((rv = arc_parsedev(dev, getenv("currdev"), NULL)) == 0) &&
- (path != NULL))
- *path = devspec;
- return(rv);
- }
-
- /*
- * Try to parse the device name off the beginning of the devspec
- */
- return(arc_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:
- *
- * disk<unit>[s<slice>][<partition>]:
- *
- */
-static int
-arc_parsedev(struct arc_devdesc **dev, const char *devspec, const char **path)
-{
- struct arc_devdesc *idev;
- struct devsw *dv;
- int i, unit, slice, partition, err;
- char *cp;
- const char *np;
-
- /* minimum length check */
- if (strlen(devspec) < 2)
- return(EINVAL);
-
- /* look for a device that matches */
- for (i = 0, dv = NULL; devsw[i] != NULL; i++) {
- if (!strncmp(devspec, devsw[i]->dv_name, strlen(devsw[i]->dv_name))) {
- dv = devsw[i];
- break;
- }
- }
-
- if (dv == NULL)
- return(ENOENT);
- idev = malloc(sizeof(struct arc_devdesc));
- err = 0;
- np = (devspec + strlen(dv->dv_name));
-
- switch(dv->dv_type) {
- case DEVT_NONE: /* XXX what to do here? Do we care? */
- break;
-
- case DEVT_DISK:
- unit = -1;
- slice = -1;
- partition = -1;
- if (*np && (*np != ':')) {
- unit = strtol(np, &cp, 10); /* next comes the unit number */
- if (cp == np) {
- err = EUNIT;
- goto fail;
- }
- if (*cp == 's') { /* got a slice number */
- np = cp + 1;
- slice = strtol(np, &cp, 10);
- if (cp == np) {
- err = ESLICE;
- goto fail;
- }
- }
- if (*cp && (*cp != ':')) {
- partition = *cp - 'a'; /* get a partition number */
- if ((partition < 0) || (partition >= MAXPARTITIONS)) {
- err = EPART;
- goto fail;
- }
- cp++;
- }
- }
- if (*cp && (*cp != ':')) {
- err = EINVAL;
- goto fail;
- }
-
- idev->d_kind.arcdisk.unit = unit;
- idev->d_kind.arcdisk.slice = slice;
- idev->d_kind.arcdisk.partition = partition;
- if (path != NULL)
- *path = (*cp == 0) ? cp : cp + 1;
- break;
-
- case DEVT_NET:
- unit = 0;
-
- if (*np && (*np != ':')) {
- unit = strtol(np, &cp, 0); /* get unit number if present */
- if (cp == np) {
- err = EUNIT;
- goto fail;
- }
- }
- if (*cp && (*cp != ':')) {
- err = EINVAL;
- goto fail;
- }
-
- idev->d_kind.netif.unit = unit;
- if (path != NULL)
- *path = (*cp == 0) ? cp : cp + 1;
- break;
-
- default:
- err = EINVAL;
- goto fail;
- }
- idev->d_dev = dv;
- idev->d_type = dv->dv_type;
- if (dev == NULL) {
- free(idev);
- } else {
- *dev = idev;
- }
- return(0);
-
- fail:
- free(idev);
- return(err);
-}
-
-
-char *
-arc_fmtdev(void *vdev)
-{
- struct arc_devdesc *dev = (struct arc_devdesc *)vdev;
- static char buf[128]; /* XXX device length constant? */
- char *cp;
-
- switch(dev->d_type) {
- case DEVT_NONE:
- strcpy(buf, "(no device)");
- break;
-
- case DEVT_DISK:
- cp = buf;
- cp += sprintf(cp, "%s%d", dev->d_dev->dv_name, dev->d_kind.arcdisk.unit);
- if (dev->d_kind.arcdisk.slice > 0)
- cp += sprintf(cp, "s%d", dev->d_kind.arcdisk.slice);
- if (dev->d_kind.arcdisk.partition >= 0)
- cp += sprintf(cp, "%c", dev->d_kind.arcdisk.partition + 'a');
- strcat(cp, ":");
- break;
-
- case DEVT_NET:
- sprintf(buf, "%s%d:", dev->d_dev->dv_name, dev->d_kind.netif.unit);
- break;
- }
- return(buf);
-}
-
-
-/*
- * Set currdev to suit the value being supplied in (value)
- */
-int
-arc_setcurrdev(struct env_var *ev, int flags, void *value)
-{
- struct arc_devdesc *ncurr;
- int rv;
-
- if ((rv = arc_parsedev(&ncurr, value, NULL)) != 0)
- return(rv);
- free(ncurr);
- env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL);
- return(0);
-}
-
--- sys/boot/arc/lib/arcconsole.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/* $NetBSD: prom.c,v 1.3 1997/09/06 14:03:58 drochner Exp $ */
-
-/*
- * Mach Operating System
- * Copyright (c) 1992 Carnegie Mellon University
- * All Rights Reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
- * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution at CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie Mellon
- * the rights to redistribute these changes.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/arc/lib/arcconsole.c,v 1.3 2004/01/04 23:28:01 obrien Exp $");
-
-#include <sys/types.h>
-
-#include "bootstrap.h"
-#include "arctypes.h"
-#include "arcfuncs.h"
-
-int console;
-
-static void arc_probe(struct console *cp);
-static int arc_init(int);
-static void arc_putchar(int);
-static int arc_getchar(void);
-static int arc_poll(void);
-
-struct console arcconsole = {
- "arc",
- "ARC firmware console",
- 0,
- arc_probe,
- arc_init,
- arc_putchar,
- arc_getchar,
- arc_poll,
-};
-
-static void
-arc_probe(struct console *cp)
-{
- cp->c_flags |= C_PRESENTIN|C_PRESENTOUT;
-}
-
-static int
-arc_init(int arg)
-{
- return 0;
-}
-
-static void
-arc_putchar(int c)
-{
- char cbuf = c;
- u_int32_t count;
-
- Write(StandardOut, &cbuf, 1, &count);
-}
-
-static int saved_char = -1;
-
-int
-arc_getchar()
-{
- char cbuf;
- u_int32_t count;
-
- arc_putchar('_');
- arc_putchar('\b');
- Read(StandardIn, &cbuf, 1, &count);
- arc_putchar(' ');
- arc_putchar('\b');
- if (count == 1)
- return cbuf;
- else
- return -1;
-}
-
-int
-arc_poll()
-{
- return GetReadStatus(StandardIn) == ESUCCESS;
-}
-
-int
-arc_open(dev, len)
- char *dev;
- int len;
-{
- return 0;
-}
--- sys/boot/arc/lib/module.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*-
- * Copyright (c) 1998 Michael Smith <msmith at 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: src/sys/boot/arc/lib/module.c,v 1.3 2004/01/04 23:28:01 obrien Exp $");
-
-/*
- * alpha-specific module functionality.
- *
- */
-
-#include <stand.h>
-#include <string.h>
-
-#include "bootstrap.h"
-#include "libarc.h"
-
-/*
- * Use voodoo to load modules required by current hardware.
- */
-int
-arc_autoload(void)
-{
- /* XXX use PnP to locate stuff here */
- return(0);
-}
--- sys/boot/arc/lib/bootinfo.c
+++ /dev/null
@@ -1,204 +0,0 @@
-/*-
- * Copyright (c) 1998 Michael Smith <msmith at 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: src/sys/boot/arc/lib/bootinfo.c,v 1.6 2004/01/04 23:28:01 obrien Exp $");
-
-#include <stand.h>
-#include <string.h>
-#include <sys/param.h>
-#include <sys/linker.h>
-#include <machine/elf.h>
-#include <machine/prom.h>
-#include <machine/rpb.h>
-#include <machine/bootinfo.h>
-#include "bootstrap.h"
-
-/*
- * 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 addr)
-{
- struct env_var *ep;
-
- /* traverse the environment */
- for (ep = environ; ep != NULL; ep = ep->ev_next) {
- alpha_copyin(ep->ev_name, addr, strlen(ep->ev_name));
- addr += strlen(ep->ev_name);
- alpha_copyin("=", addr, 1);
- addr++;
- if (ep->ev_value != NULL) {
- alpha_copyin(ep->ev_value, addr, strlen(ep->ev_value));
- addr += strlen(ep->ev_value);
- }
- alpha_copyin("", addr, 1);
- addr++;
- }
- alpha_copyin("", addr, 1);
- addr++;
- return(addr);
-}
-
-/*
- * 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_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); \
- alpha_copyin(&x, a, sizeof(x)); \
- a += sizeof(x); \
-}
-
-#define MOD_STR(t, a, s) { \
- COPY32(t, a); \
- COPY32(strlen(s) + 1, a); \
- alpha_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_VAR(t, a, s) { \
- COPY32(t, a); \
- COPY32(sizeof(s), a); \
- alpha_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); \
- alpha_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) {
-
- MOD_NAME(addr, fp->f_name); /* this field must come first */
- MOD_TYPE(addr, fp->f_type);
- 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 an alpha kernel.
- *
- * - The kernel environment is copied into kernel space.
- * - Module metadata are formatted and placed in kernel space.
- */
-int
-bi_load(struct bootinfo_v1 *bi, vm_offset_t *ffp_save,
- struct preloaded_file *fp)
-{
- struct preloaded_file *xp;
- vm_offset_t addr, bootinfo_addr;
- u_int pad;
- vm_offset_t ssym, esym;
- struct file_metadata *md;
-
- ssym = esym = 0;
- if ((md = file_findmetadata(fp, MODINFOMD_SSYM)) != NULL)
- ssym = *((vm_offset_t *)&(md->md_data));
- if ((md = file_findmetadata(fp, MODINFOMD_ESYM)) != NULL)
- esym = *((vm_offset_t *)&(md->md_data));
- if (ssym == 0 || esym == 0)
- ssym = esym = 0; /* sanity */
-
- bi->ssym = ssym;
- bi->esym = 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;
- }
- /* pad to a page boundary */
- pad = (u_int)addr & PAGE_MASK;
- if (pad != 0) {
- pad = PAGE_SIZE - pad;
- addr += pad;
- }
-
- /* copy our environment */
- bi->envp = (char *)addr;
- addr = bi_copyenv(addr);
-
- /* pad to a page boundary */
- pad = (u_int)addr & PAGE_MASK;
- if (pad != 0) {
- pad = PAGE_SIZE - pad;
- addr += pad;
- }
- /* copy module list and metadata */
- bi->modptr = addr;
- addr = bi_copymodules(addr);
-
- /* all done copying stuff in, save end of loaded object space */
- bi->kernend = addr;
-
- *ffp_save = ALPHA_K0SEG_TO_PHYS((addr + PAGE_MASK) & ~PAGE_MASK)
- >> PAGE_SHIFT;
- *ffp_save += 2; /* XXX OSF/1 does this, no idea why. */
-
- return(0);
-}
--- sys/boot/arc/lib/elf_freebsd.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/* $NetBSD: loadfile.c,v 1.10 1998/06/25 06:45:46 ross Exp $ */
-
-/*-
- * Copyright (c) 1997 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
- * NASA Ames Research Center.
- *
- * 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 the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
- */
-/*
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Ralph Campbell.
- *
- * 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.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.
- *
- * @(#)boot.c 8.1 (Berkeley) 6/10/93
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/arc/lib/elf_freebsd.c,v 1.6 2004/04/07 20:45:55 imp Exp $");
-
-#include <stand.h>
-#include <string.h>
-
-#include <sys/param.h>
-#include <sys/linker.h>
-#include <machine/elf.h>
-#include <machine/prom.h>
-#include <machine/rpb.h>
-#include <machine/bootinfo.h>
-
-#include "bootstrap.h"
-
-#define _KERNEL
-
-static int elf64_exec(struct preloaded_file *amp);
-int bi_load(struct bootinfo_v1 *, vm_offset_t *,
- struct preloaded_file *);
-
-struct file_format alpha_elf = { elf64_loadfile, elf64_exec };
-
-vm_offset_t ffp_save, ptbr_save;
-
-static int
-elf64_exec(struct preloaded_file *fp)
-{
-#if 0
- static struct bootinfo_v1 bootinfo_v1;
- struct file_metadata *md;
- Elf_Ehdr *hdr;
- int err;
-
- if ((md = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL)
- return(EFTYPE); /* XXX actually EFUCKUP */
- hdr = (Elf_Ehdr *)&(md->md_data);
-
- /* XXX ffp_save does not appear to be used in the kernel.. */
- bzero(&bootinfo_v1, sizeof(bootinfo_v1));
- err = bi_load(&bootinfo_v1, &ffp_save, fp);
- if (err)
- return(err);
-
- /*
- * Fill in the bootinfo for the kernel.
- */
- strncpy(bootinfo_v1.booted_kernel, fp->f_name,
- sizeof(bootinfo_v1.booted_kernel));
- prom_getenv(PROM_E_BOOTED_OSFLAGS, bootinfo_v1.boot_flags,
- sizeof(bootinfo_v1.boot_flags));
- bootinfo_v1.hwrpb = (void *)HWRPB_ADDR;
- bootinfo_v1.hwrpbsize = ((struct rpb *)HWRPB_ADDR)->rpb_size;
- bootinfo_v1.cngetc = NULL;
- bootinfo_v1.cnputc = NULL;
- bootinfo_v1.cnpollc = NULL;
-
- printf("Entering %s at 0x%lx...\n", fp->f_name, hdr->e_entry);
- exit(0);
- closeall();
- alpha_pal_imb();
- (*(void (*)())hdr->e_entry)(ffp_save, ptbr_save,
- BOOTINFO_MAGIC, &bootinfo_v1, 1, 0);
-#endif
-}
-
-
-
--- sys/boot/arc/lib/abort.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*-
- * Copyright (c) 1998 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: src/sys/boot/arc/lib/abort.c,v 1.3 2004/01/04 23:28:01 obrien Exp $");
-
-#include <errno.h>
-#include <sys/types.h>
-#include "arctypes.h"
-#include "arcfuncs.h"
-
-void
-abort()
-{
- FwReboot();
-}
--- sys/boot/arc/lib/time.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/*-
- * Copyright (c) 1998 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: src/sys/boot/arc/lib/time.c,v 1.3 2004/01/04 23:28:01 obrien Exp $");
-
-#include <errno.h>
-#include <sys/types.h>
-#include "arctypes.h"
-#include "arcfuncs.h"
-
-time_t
-time(time_t *tloc)
-{
- int secs = GetRelativeTime();
- if (tloc)
- *tloc = secs;
- return secs;
-}
--- sys/boot/arc/lib/setjmperr.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*-
- * Copyright (c) 1998 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: src/sys/boot/arc/lib/setjmperr.c,v 1.3 2004/01/04 23:28:01 obrien Exp $");
-
-#include <errno.h>
-#include <sys/types.h>
-#include "arctypes.h"
-#include "arcfuncs.h"
-
-void
-longjmperror()
-{
- panic("longjmp botch.\n");
-}
--- sys/boot/arc/lib/prom.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 1999, Stefan Esser <se at 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 unmodified, 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: src/sys/boot/arc/lib/prom.c,v 1.3 2004/01/04 23:28:01 obrien Exp $");
-
-#define PROM_E_BOOTED_DEV "XXX1"
-#define PROM_E_BOOTED_FILE "XXX2"
-#define PROM_E_BOOTED_OSFLAGS "XXX3"
-#define PROM_E_TTY_DEV "XXX4"
-
-u_int64_t
-prom_getenv(PROM_E_BOOTED_FILE, bootfile, sizeof(bootfile))
-{
-
-}
--- sys/boot/arc/lib/delay.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*-
- * Copyright (c) 1998 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: src/sys/boot/arc/lib/delay.c,v 1.3 2004/01/04 23:28:01 obrien Exp $");
-
-#include <errno.h>
-#include <sys/types.h>
-#include "arctypes.h"
-#include "arcfuncs.h"
-
-void
-delay(int usecs)
-{
- StallExecution(usecs);
-}
--- sys/boot/arc/lib/arcdisk.c
+++ /dev/null
@@ -1,360 +0,0 @@
-/*-
- * Copyright (c) 1998 Michael Smith <msmith at freebsd.org>
- * Copyright (c) 1998 Doug Rabson <dfr at 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: src/sys/boot/arc/lib/arcdisk.c,v 1.7 2004/01/04 23:28:01 obrien Exp $");
-
-/*
- * ARC disk device handling.
- *
- * Ideas and algorithms from:
- *
- * - NetBSD libi386/biosdisk.c
- * - FreeBSD biosboot/disk.c
- */
-
-#include <stand.h>
-
-#include <machine/stdarg.h>
-
-#include "bootstrap.h"
-#include "libarc.h"
-#include "arctypes.h"
-#include "arcfuncs.h"
-
-#define ARCDISK_SECSIZE 512
-
-#define BUFSIZE (1 * ARCDISK_SECSIZE)
-#define MAXBDDEV MAXDEV
-
-#ifdef DISK_DEBUG
-# define D(x) x
-#else
-# define D(x)
-#endif
-
-static int bd_init(void);
-static int bd_strategy(void *devdata, int flag, daddr_t dblk, size_t size, char *buf, size_t *rsize);
-static int bd_realstrategy(void *devdata, int flag, daddr_t dblk, size_t size, char *buf, size_t *rsize);
-static int bd_open(struct open_file *f, ...);
-static int bd_close(struct open_file *f);
-static void bd_print(int verbose);
-
-struct open_disk {
- int od_fd;
- int od_unit; /* our unit number */
- int od_boff; /* block offset from beginning of ARC disk */
- int od_flags;
-#define BD_FLOPPY (1<<2)
- u_char od_buf[BUFSIZE]; /* transfer buffer (do we want/need this?) */
-};
-
-struct devsw arcdisk = {
- "disk",
- DEVT_DISK,
- bd_init,
- bd_strategy,
- bd_open,
- bd_close,
- noioctl,
- bd_print
-};
-
-/*
- * List of ARC devices, translation from disk unit number to
- * ARC unit number.
- */
-static struct
-{
- char bd_name[64];
- int bd_unit; /* ARC unit number */
- int bd_namelen;
- int bd_flags;
-} bdinfo [MAXBDDEV];
-static int nbdinfo = 0;
-
-/*
- * Quiz ARC for disk devices, save a little info about them.
- */
-static int
-bd_init(void)
-{
- nbdinfo++;
-
- return (0);
-}
-
-/*
- * Print information about disks
- */
-static void
-bd_print(int verbose)
-{
- int i;
- char line[80];
-
- for (i = 0; i < nbdinfo; i++) {
- sprintf(line, " disk%d: ARC drive %s", i, bdinfo[i].bd_name);
- pager_output(line);
- /* XXX more detail? */
- pager_output("\n");
- }
-}
-
-/*
- * 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
-bd_open(struct open_file *f, ...)
-{
- struct arc_devdesc *dev;
- struct dos_partition *dptr;
- struct open_disk *od;
- struct disklabel *lp;
- int sector, slice, i;
- int error;
- int unit;
- u_int32_t fd;
- va_list ap;
-
- va_start(ap, f);
- dev = va_arg(ap, struct arc_devdesc *);
- va_end(ap);
-
- unit = dev->d_kind.arcdisk.unit;
- if (unit >= nbdinfo) {
- D(printf("attempt to open nonexistent disk\n"));
- return(ENXIO);
- }
-
- if (Open("scsi(0)disk(0)rdisk(0)partition(0)",
- OpenReadOnly, &fd) != ESUCCESS)
- if (Open("scsi(0)disk(1)rdisk(0)partition(0)",
- OpenReadOnly, &fd) != ESUCCESS)
- if (Open("multi(0)disk(0)fdisk(0)partition(0)",
- OpenReadOnly, &fd) != ESUCCESS)
- return(ENXIO);
-
- od = (struct open_disk *) malloc(sizeof(struct open_disk));
- if (!od) {
- D(printf("arcdiskopen: no memory\n"));
- return (ENOMEM);
- }
-
- /* Look up ARC unit number, intialise open_disk structure */
- od->od_fd = fd;
- od->od_unit = dev->d_kind.arcdisk.unit;
- od->od_flags = bdinfo[od->od_unit].bd_flags;
- od->od_boff = 0;
- error = 0;
-
-#if 0
- /* Get geometry for this open (removable device may have changed) */
- if (set_geometry(&od->od_ll)) {
- D(printf("bd_open: can't get geometry\n"));
- error = ENXIO;
- goto out;
- }
-#endif
-
- /*
- * Following calculations attempt to determine the correct value
- * for d->od_boff by looking for the slice and partition specified,
- * or searching for reasonable defaults.
- */
-
-#if 0
- /*
- * Find the slice in the DOS slice table.
- */
- if (readsects(&od->od_ll, 0, 1, od->od_buf, 0)) {
- D(printf("bd_open: error reading MBR\n"));
- error = EIO;
- goto out;
- }
-
- /*
- * Check the slice table magic.
- */
- if ((od->od_buf[0x1fe] != 0xff) || (od->od_buf[0x1ff] != 0xaa)) {
- /* If a slice number was explicitly supplied, this is an error */
- if (dev->d_kind.arcdisk.slice > 0) {
- D(printf("bd_open: no slice table/MBR (no magic)\n"));
- error = ENOENT;
- goto out;
- }
- sector = 0;
- goto unsliced; /* may be a floppy */
- }
- dptr = (struct dos_partition *) & od->od_buf[DOSPARTOFF];
-
- /*
- * XXX No support here for 'extended' slices
- */
- if (dev->d_kind.arcdisk.slice <= 0) {
- /*
- * Search for the first FreeBSD slice; this also works on "unsliced"
- * disks, as they contain a "historically bogus" MBR.
- */
- for (i = 0; i < NDOSPART; i++, dptr++)
- if (dptr->dp_typ == DOSPTYP_386BSD) {
- sector = dptr->dp_start;
- break;
- }
- /* Did we find something? */
- if (sector == -1) {
- error = ENOENT;
- goto out;
- }
- } else {
- /*
- * Accept the supplied slice number unequivocally (we may be looking
- * for a DOS partition) if we can handle it.
- */
- if ((dev->d_kind.arcdisk.slice > NDOSPART) || (dev->d_kind.arcdisk.slice < 1)) {
- error = ENOENT;
- goto out;
- }
- dptr += (dev->d_kind.arcdisk.slice - 1);
- sector = dptr->dp_start;
- }
- unsliced:
-
-#else
- sector = 0;
-#endif
- /*
- * Now we have the slice, look for the partition in the disklabel if we have
- * a partition to start with.
- */
- if (dev->d_kind.arcdisk.partition < 0) {
- od->od_boff = sector; /* no partition, must be after the slice */
- } else {
- if (bd_strategy(od, F_READ, sector + LABELSECTOR, 512, od->od_buf, 0)) {
- D(printf("bd_open: error reading disklabel\n"));
- error = EIO;
- goto out;
- }
- lp = (struct disklabel *) (od->od_buf + LABELOFFSET);
- if (lp->d_magic != DISKMAGIC) {
- D(printf("bd_open: no disklabel\n"));
- error = ENOENT;
- goto out;
-
- } else if (dev->d_kind.arcdisk.partition >= lp->d_npartitions) {
-
- /*
- * The partition supplied is out of bounds; this is fatal.
- */
- D(printf("partition '%c' exceeds partitions in table (a-'%c')\n",
- 'a' + dev->d_kind.arcdisk.partition, 'a' + lp->d_npartitions));
- error = EPART;
- goto out;
-
- } else {
-
- /*
- * Complain if the partition type is wrong and it shouldn't be, but
- * regardless accept this partition.
- */
- D(if ((lp->d_partitions[dev->d_kind.arcdisk.partition].p_fstype == FS_UNUSED) &&
- !(od->od_flags & BD_FLOPPY)) /* Floppies often have bogus fstype */
- printf("bd_open: warning, partition marked as unused\n"););
-
- od->od_boff = lp->d_partitions[dev->d_kind.arcdisk.partition].p_offset;
- }
- }
- /*
- * Save our context
- */
- f->f_devdata = od;
-
- out:
- if (error)
- free(od);
- return(error);
-}
-
-static int
-bd_close(struct open_file *f)
-{
- struct open_disk *od = f->f_devdata;
-
- Close(od->od_fd);
-
- free(od);
- f->f_devdata = NULL;
- return(0);
-}
-
-static int
-bd_strategy(void *devdata, int rw, daddr_t dblk, size_t size, char *buf, size_t *rsize)
-{
- struct bcache_devdata bcd;
- struct arc_devdesc *dev = (struct arc_devdesc *)devdata;
-
- bcd.dv_strategy = bd_realstrategy;
- bcd.dv_devdata = devdata;
- return(bcache_strategy(&bcd, dev->d_kind.arcdisk.unit, rw, dblk, size,
- buf, rsize));
-}
-
-static int
-bd_realstrategy(void *devdata, int flag, daddr_t dblk, size_t size, char *buf, size_t *rsize)
-{
- struct open_disk *od = (struct open_disk *)devdata;
- fpos_t seek;
- u_int32_t count;
-
- if (size % ARCDISK_SECSIZE)
- panic("bd_strategy: I/O not block multiple");
-
- if (flag != F_READ)
- return(EROFS);
-
- if (rsize)
- *rsize = 0;
-
- seek = 512 * (dblk + od->od_boff);
- Seek(od->od_fd, &seek, SeekAbsolute);
- if (Read(od->od_fd, buf, size, &count) != ESUCCESS) {
- D(printf("read error\n"));
- return (EIO);
- }
-
- if (rsize)
- *rsize = count;
- return (0);
-}
-
--- sys/boot/arc/lib/Makefile
+++ /dev/null
@@ -1,35 +0,0 @@
-# $FreeBSD: src/sys/boot/arc/lib/Makefile,v 1.10 2004/10/24 15:32:49 ru Exp $
-
-LIB= arc
-INTERNALLIB=
-
-CFLAGS+= -ffreestanding
-.PATH: ${.CURDIR}/arch/${MACHINE_ARCH}
-# XXX hack to pick up stand.h
-LIBSTANDDIR= ${.CURDIR}/../../../../lib/libstand
-CFLAGS+= -I${LIBSTANDDIR}
-CFLAGS+= -DDEBUG
-
-# Pick up the bootstrap header for some interface items
-CFLAGS+= -I${.CURDIR}/../../common -mno-fp-regs \
- -I${.CURDIR}/../../.. -I${.CURDIR}/../include
-
-#CFLAGS+= -DDISK_DEBUG
-#CPPFLAGS+= -DNO_DISKLABEL
-#CPPFLAGS+= -DSAVE_MEMORY
-
-SRCS= delay.c time.c abort.c setjmperr.c copy.c devicename.c module.c \
- arcconsole.c arcdisk.c elf_freebsd.c bootinfo.c
-
-.if ${MACHINE_ARCH} == "alpha"
-SRCS+= rpb.c
-.endif
-
-CLEANFILES+= machine
-
-machine:
- ln -sf ${.CURDIR}/../../../alpha/include machine
-
-.include <bsd.lib.mk>
-
-beforedepend ${OBJS}: machine
--- sys/boot/arc/lib/arch/alpha/setjmp.S
+++ /dev/null
@@ -1,95 +0,0 @@
-/* $FreeBSD: src/sys/boot/arc/lib/arch/alpha/setjmp.S,v 1.2 1999/08/28 00:39:40 peter Exp $ */
-/*
- * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
- * All rights reserved.
- *
- * Author: Chris G. Demetriou
- *
- * Permission to use, copy, modify and distribute this software and
- * its documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
- * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution at CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie the
- * rights to redistribute these changes.
- */
-
-#include <machine/asm.h>
-
- .text
-/*
- * Kernel setjmp and longjmp. Rather minimalist.
- *
- * longjmp(label_t *a)
- * will generate a "return (1)" from the last call to
- * setjmp(label_t *a)
- * by restoring registers from the stack,
- */
-
- .set noreorder
-
-LEAF(setjmp, 1)
- LDGP(pv)
-
- stq ra, (0 * 8)(a0) /* return address */
- stq s0, (1 * 8)(a0) /* callee-saved registers */
- stq s1, (2 * 8)(a0)
- stq s2, (3 * 8)(a0)
- stq s3, (4 * 8)(a0)
- stq s4, (5 * 8)(a0)
- stq s5, (6 * 8)(a0)
- stq s6, (7 * 8)(a0)
- stq sp, (8 * 8)(a0)
-
- ldiq t0, 0xbeeffedadeadbabe /* set magic number */
- stq t0, (9 * 8)(a0)
-
- mov zero, v0 /* return zero */
- RET
-END(setjmp)
-
-LEAF(longjmp, 1)
- LDGP(pv)
-
- ldiq t0, 0xbeeffedadeadbabe /* check magic number */
- ldq t1, (9 * 8)(a0)
- cmpeq t0, t1, t0
- beq t0, longjmp_botch /* if bad, punt */
-
- ldq ra, (0 * 8)(a0) /* return address */
- ldq s0, (1 * 8)(a0) /* callee-saved registers */
- ldq s1, (2 * 8)(a0)
- ldq s2, (3 * 8)(a0)
- ldq s3, (4 * 8)(a0)
- ldq s4, (5 * 8)(a0)
- ldq s5, (6 * 8)(a0)
- ldq s6, (7 * 8)(a0)
- ldq sp, (8 * 8)(a0)
-
- ldiq v0, 1
- RET
-
-longjmp_botch:
- lda a0, longjmp_botchmsg
- mov ra, a1
- CALL(panic)
- call_pal PAL_bugchk
-
- .data
-longjmp_botchmsg:
- .asciz "longjmp botch from %p"
- .text
-
-END(longjmp)
--- sys/boot/arc/lib/arch/alpha/copy.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/*-
- * Copyright (c) 1998 Michael Smith <msmith at 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.
- *
- * $FreeBSD: src/sys/boot/arc/lib/arch/alpha/copy.c,v 1.2 1999/08/28 00:39:40 peter Exp $
- */
-/*
- * MD primitives supporting placement of module data
- *
- * XXX should check load address/size against memory top.
- */
-#include <stand.h>
-#include <machine/alpha_cpu.h>
-
-#include "libarc.h"
-
-/*
- * Convert from a 64bit superpage address to a 32bit arc superpage address.
- */
-static void *
-convert_superpage(vm_offset_t p)
-{
- if (p < ALPHA_K0SEG_BASE || p >= ALPHA_K0SEG_END) {
- printf("stupid address %p\n", (void *)p);
- panic("broken");
- }
- return (void *) (0xffffffff80000000 + (p - ALPHA_K0SEG_BASE));
-}
-
-int
-arc_copyin(void *src, vm_offset_t dest, size_t len)
-{
- bcopy(src, convert_superpage(dest), len);
- return(len);
-}
-
-int
-arc_copyout(vm_offset_t src, void *dest, size_t len)
-{
- bcopy(convert_superpage(src), dest, len);
- return(len);
-}
-
-int
-arc_readin(int fd, vm_offset_t dest, size_t len)
-{
- return(read(fd, convert_superpage(dest), len));
-}
-
-
--- sys/boot/arc/lib/arch/alpha/rpb.c
+++ /dev/null
@@ -1,196 +0,0 @@
-/*-
- * Copyright (c) 1998 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: src/sys/boot/arc/lib/arch/alpha/rpb.c,v 1.2 1999/08/28 00:39:40 peter Exp $
- */
-
-#include <stand.h>
-#include <machine/rpb.h>
-#include "arctypes.h"
-#include "arcfuncs.h"
-
-struct rpb RPB = {
- 0, /* rpb_phys */
- {"HWRPB"}, /* rpb_magic */
- HWRPB_DSRDB_MINVERS, /* rpb_version */
- sizeof(struct rpb), /* rpb_size */
- 0, /* rpb_primary_cpu_id */
- 8192, /* rpb_page_size */
- 43, /* rpb_phys_addr_size */
- 0, /* rpb_max_asn */
- {0}, /* rpb_ssn */
- ST_EB164, /* rpb_type */
- SV_ST_ALPHAPC164LX_533, /* rpb_variation */
- {"0000"}, /* rpb_revision */
- 1024*4096, /* rpb_intr_freq */
- 533*1024*1024, /* rpb_cc_freq */
- 0, /* rpb_vptb */
- 0, /* rpb_reserved_arch */
- 0, /* rpb_tbhint_off */
- 0, /* rpb_pcs_cnt */
- 0, /* rpb_pcs_size */
- 0, /* rpb_pcs_off */
- 0, /* rpb_ctb_cnt */
- 0, /* rpb_ctb_size */
- 0, /* rpb_ctb_off */
- 0, /* rpb_crb_off */
- 0, /* rpb_memdat_off */
- 0, /* rpb_condat_off */
- 0, /* rpb_fru_off */
- 0, /* rpb_save_term */
- 0, /* rpb_save_term_val */
- 0, /* rpb_rest_term */
- 0, /* rpb_rest_term_val */
- 0, /* rpb_restart */
- 0, /* rpb_restart_val */
- 0, /* rpb_reserve_os */
- 0, /* rpb_reserve_hw */
- 0, /* rpb_checksum */
- 0, /* rpb_rxrdy */
- 0, /* rpb_txrdy */
- 0, /* rpb_dsrdb_off */
- {0}, /* rpb_rpb_tbhint */
-};
-
-#define ROUNDUP(x) (((x) + sizeof(u_int64_t) - 1) \
- & ~(sizeof(u_int64_t) - 1))
-
-u_int64_t
-checksum(void *p, size_t size)
-{
- u_int64_t sum = 0;
- u_int64_t *lp = (u_int64_t *)p;
- int i;
-
- printf("checksum(%p, %d)\n", p, size);
- size = ROUNDUP(size) / sizeof(u_int64_t);
- for (i = 0; i < size; i++)
- sum += lp[i];
-}
-
-size_t
-size_mddt()
-{
- int count = 0;
- MEMORY_DESCRIPTOR *desc;
-
- for (desc = GetMemoryDescriptor(NULL); desc;
- desc = GetMemoryDescriptor(desc)) {
- count++;
- }
-
- return ROUNDUP(sizeof(struct mddt)
- + (count - 1) * sizeof(struct mddt_cluster));
-}
-
-void
-write_mddt(struct mddt *mddt, size_t size)
-{
- int count = 0, i;
- MEMORY_DESCRIPTOR *desc;
- u_int64_t *p;
-
- memset(mddt, 0, sizeof(struct mddt));
- for (desc = GetMemoryDescriptor(NULL); desc;
- desc = GetMemoryDescriptor(desc)) {
- struct mddt_cluster *mc;
- mc = &mddt->mddt_clusters[count];
- mc->mddt_pfn = desc->BasePage;
- mc->mddt_pg_cnt = desc->PageCount;
- mc->mddt_pg_test = 0;
- mc->mddt_v_bitaddr = 0;
- mc->mddt_p_bitaddr = 0;
- mc->mddt_bit_cksum = 0;
-
- /*
- * Not sure about the FirmwareTemporary bit but my 164LX has
- * about 60Mb marked this way.
- */
- if (desc->Type == MemoryFree || desc->Type == MemoryFirmwareTemporary)
- mc->mddt_usage = MDDT_SYSTEM;
- else if (desc->Type == MemorySpecialMemory)
- mc->mddt_usage = MDDT_NONVOLATILE; /* ?? */
- else
- mc->mddt_usage = MDDT_PALCODE;
- count++;
- }
- mddt->mddt_cluster_cnt = count;
- mddt->mddt_cksum = checksum(mddt, size);
-}
-
-size_t
-size_rpb()
-{
- return sizeof(struct rpb) + size_mddt();
-}
-
-void
-write_rpb(struct rpb *rpb)
-{
- EXTENDED_SYSTEM_INFORMATION sysinfo;
- SYSTEM_ID *sysid;
-
- ReturnExtendedSystemInformation(&sysinfo);
-
- memset(rpb, 0, sizeof(struct rpb));
- rpb->rpb_phys = 0; /* XXX */
- strcpy(rpb->rpb_magic, "HWRPB");
- rpb->rpb_version = HWRPB_DSRDB_MINVERS;
- rpb->rpb_size = sizeof(struct rpb);
- rpb->rpb_primary_cpu_id = 0; /* XXX */
- rpb->rpb_page_size = sysinfo.ProcessorPageSize;
- rpb->rpb_phys_addr_size = sysinfo.NumberOfPhysicalAddressBits;
- rpb->rpb_max_asn = sysinfo.MaximumAddressSpaceNumber;
- rpb->rpb_type = ST_EB164; /* XXX */
- rpb->rpb_variation = SV_ST_ALPHAPC164LX_533; /* XXX */
- rpb->rpb_intr_freq = 1024*4096; /* XXX */
- rpb->rpb_cc_freq = 533000000; /* XXX */
- rpb->rpb_memdat_off = sizeof(struct rpb);
- write_mddt((struct mddt *)((caddr_t) rpb + rpb->rpb_memdat_off),
- size_mddt());
- rpb->rpb_checksum = checksum(rpb, 280); /* only sum first 280 bytes */
-}
-
-struct rpb *
-make_rpb()
-{
- EXTENDED_SYSTEM_INFORMATION sysinfo;
- struct rpb *rpb;
-
- ReturnExtendedSystemInformation(&sysinfo);
- printf("sysinfo.ProcessorId = %x\n", sysinfo.ProcessorId);
- printf("sysinfo.ProcessorRevision = %d\n", sysinfo.ProcessorRevision);
- printf("sysinfo.ProcessorPageSize = %d\n", sysinfo.ProcessorPageSize);
- printf("sysinfo.NumberOfPhysicalAddressBits = %d\n", sysinfo.NumberOfPhysicalAddressBits);
- printf("sysinfo.MaximumAddressSpaceNumber = %d\n", sysinfo.MaximumAddressSpaceNumber);
- printf("sysinfo.ProcessorCycleCounterPeriod = %d\n", sysinfo.ProcessorCycleCounterPeriod);
- printf("sysinfo.SystemRevision = %d\n", sysinfo.SystemRevision);
- printf("sysinfo.SystemSerialNumber = %s\n", sysinfo.SystemSerialNumber);
- printf("sysinfo.FirmwareVersion = %s\n", sysinfo.FirmwareVersion);
-
- rpb = malloc(size_rpb());
- write_rpb(rpb);
- return rpb;
-}
--- sys/boot/arc/lib/arch/alpha/start.S
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 1999, Stefan Esser <se at 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 unmodified, 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: src/sys/boot/arc/lib/arch/alpha/start.S,v 1.2 1999/08/28 00:39:41 peter Exp $
- *
- */
-
-/*
- * Based on /sys/boot/alpha/libalpha/start.S
- * Copyright (c) 1992 Carnegie Mellon University
- */
-
-#include <machine/asm.h>
-
- .text
-
-#define ENTRY_FRAME 32
-
-NESTED(_start, 1, ENTRY_FRAME, ra, 0, 0)
- br pv,Lstartgp
-Lstartgp:
- LDGP(pv)
-
- lda a0,_edata
- lda a1,_end
- subq a1,a0,a1
- CALL(bzero)
-
- lda sp, -8(sp)
- stq ra, 0(sp)
-
- CALL(main) /* transfer to C */
-
- ldq ra, 0(sp)
- lda sp, 8(sp)
- RET /* XXX */
-
-XLEAF(_rtt, 0)
-XLEAF(halt, 0)
- call_pal PAL_halt /* halt if we ever return */
-END(_start)
--- sys/boot/arc/loader/version
+++ /dev/null
@@ -1,7 +0,0 @@
-$FreeBSD: src/sys/boot/arc/loader/version,v 1.2 1999/08/28 00:39:43 peter Exp $
-
-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.
-
-0.1: Initial i386 version, germinated from the NetBSD i386
- standalone, but enormously modified.
--- sys/boot/arc/loader/Makefile
+++ /dev/null
@@ -1,71 +0,0 @@
-# $NetBSD: Makefile,v 1.12 1998/02/19 14:18:36 drochner Exp $
-# $FreeBSD: src/sys/boot/arc/loader/Makefile,v 1.8 2004/12/21 08:47:12 ru Exp $
-
-BASE= loader
-PROG= ${BASE}.exe
-NO_MAN=
-NEWVERSWHAT= "ARC disk boot" ${MACHINE_ARCH}
-
-.PATH: ${.CURDIR}/../common
-
-# i386-specific bootstrap sources
-SRCS+= main.c conf.c
-
-# Always add MI sources
-.PATH: ${.CURDIR}/../../common
-.include <${.CURDIR}/../../common/Makefile.inc>
-CFLAGS+= -ffreestanding -mno-fp-regs
-CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}
-CFLAGS+= -I${.CURDIR}/../../.. -I.
-CFLAGS+= -DLOADER
-
-CLEANFILES+= setdef0.c setdef0.o setdef1.c setdef1.o setdefs.h start.o \
- vers.c vers.o ${BASE}.exe ${BASE}.sym ${BASE}.list
-CLEANFILES+= loader.help
-CLEANFILES+= machine
-
-CFLAGS+= -Wall
-
-CFLAGS+= -I${LIBSTANDDIR}
-CFLAGS+= -I${.CURDIR}/../include
-CRT= start.o
-STRIP=
-BINDIR?= /boot
-LOAD_ADDRESS?= 0xffffffff80900000
-
-all: ${PROG}
-
-vers.o: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
- sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
- ${CC} -c vers.c
-
-${BASE}.exe: ${BASE}.sym ${BASE}.help
- elf2exe ${BASE}.sym ${BASE}.exe
-
-${BASE}.sym: ${OBJS} ${LIBSTAND} ${LIBARC} ${CRT} vers.o
- ${LD} -o ${BASE}.sym -M -N -Ttext ${LOAD_ADDRESS} \
- ${CRT} ${OBJS} vers.o -L${DESTDIR}${LIBDIR} \
- ${LIBSTAND} ${LIBARC} ${LIBSTAND} >${.OBJDIR}/${BASE}.list
-
-${BASE}.help: help.common help.alpha
- cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
-
-beforeinstall:
-.if exists(${.OBJDIR}/loader.help)
- ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
- ${.OBJDIR}/${BASE}.help ${DESTDIR}/boot
-.else
- ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 \
- ${.CURDIR}/${BASE}.help ${DESTDIR}/boot
-.endif
-
-# Other fragments still to be brought in from ../Makfile.booters?
-start.o: ${.CURDIR}/../lib/arch/${MACHINE_ARCH}/start.S
- ${CC} -c ${CFLAGS} $<
-
-machine:
- ln -sf ${.CURDIR}/../../../alpha/include machine
-
-.include <bsd.prog.mk>
-
-beforedepend ${OBJS}: machine
--- sys/boot/arc/loader/main.c
+++ /dev/null
@@ -1,405 +0,0 @@
-/*-
- * Copyright (c) 1998 Michael Smith <msmith at freebsd.org>
- * Copyright (c) 1998 Doug Rabson <dfr at 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: src/sys/boot/arc/loader/main.c,v 1.4 2004/01/04 23:28:01 obrien Exp $");
-
-#include <stand.h>
-#include <string.h>
-#include <setjmp.h>
-
-#include <sys/param.h>
-#include "bootstrap.h"
-#include "libarc.h"
-#include "arctypes.h"
-#include "arcfuncs.h"
-
-extern char bootprog_name[], bootprog_rev[], bootprog_date[], bootprog_maker[];
-
-struct arc_devdesc currdev; /* our current device */
-struct arch_switch archsw; /* MI/MD interface boundary */
-
-extern char end[];
-extern void halt(void);
-
-#define ARCENV_BOOTFILE "OSLoadFilename"
-
-static char *MemoryTypes[] = {
- "MemoryExceptionBlock",
- "MemorySystemBlock",
- "MemoryFree",
- "MemoryBad",
- "MemoryLoadedProgram",
- "MemoryFirmwareTemporary",
- "MemoryFirmwarePermanent",
- "MemoryFreeContiguous",
- "MemorySpecialMemory",
- "MemoryMaximum",
-};
-
-#ifdef __alpha__
-#define ptob(p) ((p) << 13)
-#endif
-
-unsigned long
-memsize()
-{
- unsigned long amount = 0;
- MEMORY_DESCRIPTOR *desc;
-
- for (desc = GetMemoryDescriptor(NULL); desc;
- desc = GetMemoryDescriptor(desc)) {
- printf("%s at %x-%x\n", MemoryTypes[desc->Type],
- ptob(desc->BasePage),
- ptob(desc->BasePage + desc->PageCount));
- if (desc->Type == MemoryFree
- || desc->Type == MemoryFirmwareTemporary)
- amount += (desc->PageCount << 13); /* XXX pagesize */
- }
-
- return amount;
-}
-
-static char *ConfigurationClasses[] = {
- "SystemClass",
- "ProcessorClass",
- "CacheClass",
- "AdapterClass",
- "ControllerClass",
- "PeripheralClass",
- "MemoryClass",
- "MaximumClass",
-};
-
-
-static char *ConfigurationTypes[] = {
- "ArcSystem",
- "CentralProcessor",
- "FloatingPointProcessor",
- "PrimaryIcache",
- "PrimaryDcache",
- "SecondaryIcache",
- "SecondaryDcache",
- "SecondaryCache",
- "EisaAdapter",
- "TcAdapter",
- "ScsiAdapter",
- "DtiAdapter",
- "MultiFunctionAdapter",
- "DiskController",
- "TapeController",
- "CdromController",
- "WormController",
- "SerialController",
- "NetworkController",
- "DisplayController",
- "ParallelController",
- "PointerController",
- "KeyboardController",
- "AudioController",
- "OtherController",
- "DiskPeripheral",
- "FloppyDiskPeripheral",
- "TapePeripheral",
- "ModemPeripheral",
- "MonitorPeripheral",
- "PrinterPeripheral",
- "PointerPeripheral",
- "KeyboardPeripheral",
- "TerminalPeripheral",
- "OtherPeripheral",
- "LinePeripheral",
- "NetworkPeripheral",
- "SystemMemory",
- "MaximumType",
-};
-
-static char *ConfigurationTypeCodes[] = {
- "ARC",
- "CPU",
- "FPC",
- "PrimaryIcache",
- "PrimaryDcache",
- "SecondaryIcache",
- "SecondaryDcache",
- "SecondaryCache",
- "eisa",
- "tc",
- "scsi",
- "dti",
- "multi",
- "disk",
- "tape",
- "cdrom",
- "worm",
- "serial",
- "network",
- "video",
- "par",
- "point",
- "key",
- "audio",
- "other",
- "rdisk",
- "fdisk",
- "tape",
- "modem",
- "monitor",
- "print",
- "pointer",
- "keyboard",
- "term",
- "other",
- "line",
- "network",
- "Memory",
- "MaximumType"
-};
-
-static void
-indent(int level)
-{
- while (level--)
- putchar(' ');
-}
-
-void
-printconfig(unsigned int level, CONFIGURATION_COMPONENT *component)
-{
- CONFIGURATION_COMPONENT *child;
-
- indent(level);
- printf("%s(%s,%d)",
- ConfigurationClasses[component->Class],
- ConfigurationTypes[component->Type],
- component->Key);
-#if 1
- if (component->IdentifierLength)
- printf("=%d,%s\n", component->IdentifierLength,
- ptr(component->Identifier));
- else
- putchar('\n');
-#endif
- getchar();
-
- for (child = GetChild(component); child; child = GetPeer(child)) {
- printconfig(level + 2, child);
- }
-}
-
-void
-dumpdisk(const char *name)
-{
- u_int32_t fd, count;
- unsigned char buf[512];
- int i, j;
-
- printf("dump first sector of %s\n", name);
- if (Open(name, OpenReadOnly, &fd) != ESUCCESS) {
- printf("can't open disk\n");
- return;
- }
- if (Read(fd, buf, 512, &count) != ESUCCESS) {
- printf("can't read from disk\n");
- Close(fd);
- return;
- }
- for (i = 0; i < 16; i++) {
- for (j = 0; j < 32; j++)
- printf("%02x", buf[i*32 + j]);
- putchar('\n');
- }
- Close(fd);
-}
-
-void
-listdisks(char *path, CONFIGURATION_COMPONENT *component)
-{
- CONFIGURATION_COMPONENT *child;
- char newpath[80];
- char keybuf[20];
-
- if (path == NULL) {
- printf("\nARC disk devices:\n");
- newpath[0] = '\0';
- } else {
- strcpy(newpath, path);
- strcat(newpath, ConfigurationTypeCodes[component->Type]);
- sprintf(keybuf, "(%d)", component->Key);
- strcat(newpath, keybuf);
- }
- if (!strcmp(ConfigurationTypeCodes[component->Type], "rdisk") ||
- !strcmp(ConfigurationTypeCodes[component->Type], "fdisk")) {
- printf("%s\n", newpath);
- }
- for (child = GetChild(component); child; child = GetPeer(child)) {
- listdisks(newpath, child);
- }
-}
-
-static int exit_code = 0;
-jmp_buf exit_env;
-
-void
-exit(int code)
-{
- exit_code = 0;
- longjmp(exit_env, 1);
-}
-
-int
-main(int argc, int argv[], int envp[])
-{
- int i;
- char *bootfile;
-
- if (setjmp(exit_env))
- return exit_code;
-
- /*
- * 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 *)end, (void *)(end + 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();
-
-#if 0
- printconfig(0, GetChild(NULL));
- dumpdisk("scsi(0)disk(0)rdisk(0)partition(0)");
-#endif
- listdisks(NULL, GetChild(NULL));
- printf("\n");
-
- make_rpb();
-
- /*
- * Initialise the block cache
- */
- bcache_init(32, 512); /* 16k XXX tune this */
-
- /*
- * 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);
- printf("Memory: %ld k\n", memsize() / 1024);
-
- /* We're booting from an SRM disk, try to spiff this */
- /* XXX presumes that biosdisk is first in devsw */
- currdev.d_dev = devsw[0];
- currdev.d_type = currdev.d_dev->dv_type;
- currdev.d_kind.arcdisk.unit = 0;
- /* XXX should be able to detect this, default to autoprobe */
- currdev.d_kind.arcdisk.slice = -1;
- /* default to 'a' */
- currdev.d_kind.arcdisk.partition = 0;
-
- /* Create arc-specific variables */
- bootfile = GetEnvironmentVariable(ARCENV_BOOTFILE);
- if (bootfile)
- setenv("bootfile", bootfile, 1);
-
- env_setenv("currdev", EV_VOLATILE,
- arc_fmtdev(&currdev), arc_setcurrdev, env_nounset);
- env_setenv("loaddev", EV_VOLATILE,
- arc_fmtdev(&currdev), env_noset, env_nounset);
- setenv("LINES", "24", 1); /* optional */
-
- archsw.arch_autoload = arc_autoload;
- archsw.arch_getdev = arc_getdev;
- archsw.arch_copyin = arc_copyin;
- archsw.arch_copyout = arc_copyout;
- archsw.arch_readin = arc_readin;
-
- interact(); /* doesn't return */
-
- return 0; /* keep compiler happy */
-}
-
-COMMAND_SET(reboot, "reboot", "reboot the system", command_reboot);
-
-static int
-command_reboot(int argc, char *argv[])
-{
-
- printf("Rebooting...\n");
- delay(1000000);
- FwReboot();
- /* Note: we shouldn't get to this point! */
- panic("Reboot failed!");
- exit(0);
-}
-
-COMMAND_SET(quit, "quit", "exit the loader", command_quit);
-
-static int
-command_quit(int argc, char *argv[])
-{
- exit(0);
- return(CMD_OK);
-}
-
-#if 0
-
-COMMAND_SET(stack, "stack", "show stack usage", command_stack);
-
-static int
-command_stack(int argc, char *argv[])
-{
- char *cp;
-
- for (cp = &stackbase; cp < &stacktop; cp++)
- if (*cp != 0)
- break;
-
- printf("%d bytes of stack used\n", &stacktop - cp);
- return(CMD_OK);
-}
-
-#endif
-
-COMMAND_SET(heap, "heap", "show heap usage", command_heap);
-
-static int
-command_heap(int argc, char *argv[])
-{
- printf("heap base at %p, top at %p, used %ld\n", end, sbrk(0), sbrk(0) - end);
- return(CMD_OK);
-}
--- sys/boot/arc/loader/conf.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * $NetBSD: conf.c,v 1.2 1997/03/22 09:03:29 thorpej Exp $
- */
-
-/*
- * 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.
- */
-
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/arc/loader/conf.c,v 1.5 2004/01/04 23:28:01 obrien Exp $");
-
-#include <stand.h>
-#include "libarc.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[] = {
- &arcdisk,
- NULL
-};
-
-struct fs_ops *file_system[] = {
- &ufs_fsops,
- &gzipfs_fsops,
- NULL
-};
-
-/* Exported for alpha only */
-/*
- * Sort formats so that those that can detect based on arguments
- * rather than reading the file go first.
- */
-extern struct file_format alpha_elf;
-
-struct file_format *file_formats[] = {
- &alpha_elf,
- NULL
-};
-
-/*
- * Consoles
- *
- * We don't prototype these in libalpha.h because they require
- * data structures from bootstrap.h as well.
- */
-extern struct console arcconsole;
-
-struct console *consoles[] = {
- &arcconsole,
- NULL
-};
Index: load_elf.c
===================================================================
RCS file: /home/cvs/src/sys/boot/common/load_elf.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -L sys/boot/common/load_elf.c -L sys/boot/common/load_elf.c -u -r1.2 -r1.3
--- sys/boot/common/load_elf.c
+++ sys/boot/common/load_elf.c
@@ -26,12 +26,13 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/common/load_elf.c,v 1.32.2.1 2005/12/30 22:13:58 marcel Exp $");
+__FBSDID("$FreeBSD: src/sys/boot/common/load_elf.c,v 1.37 2006/11/02 17:52:43 ru Exp $");
#include <sys/param.h>
#include <sys/exec.h>
#include <sys/linker.h>
#include <sys/module.h>
+#include <sys/stdint.h>
#include <string.h>
#include <machine/elf.h>
#include <stand.h>
@@ -400,9 +401,9 @@
lastaddr += sizeof(size);
#ifdef ELF_VERBOSE
- printf("\n%s: 0x%lx at 0x%lx -> 0x%lx-0x%lx", secname,
- shdr[i].sh_size, shdr[i].sh_offset,
- lastaddr, lastaddr + shdr[i].sh_size);
+ printf("\n%s: 0x%jx at 0x%jx -> 0x%jx-0x%jx", secname,
+ (uintmax_t)shdr[i].sh_size, (uintmax_t)shdr[i].sh_offset,
+ (uintmax_t)lastaddr, (uintmax_t)(lastaddr + shdr[i].sh_size));
#else
if (i == symstrindex)
printf("+");
Index: devopen.c
===================================================================
RCS file: /home/cvs/src/sys/boot/common/devopen.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/boot/common/devopen.c -L sys/boot/common/devopen.c -u -r1.1.1.1 -r1.2
--- sys/boot/common/devopen.c
+++ sys/boot/common/devopen.c
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/common/devopen.c,v 1.4 2003/08/25 23:30:41 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/boot/common/devopen.c,v 1.5 2006/11/02 00:02:22 marcel Exp $");
#include <stand.h>
#include <string.h>
@@ -35,20 +35,25 @@
int
devopen(struct open_file *f, const char *fname, const char **file)
{
- struct devdesc *dev;
- int result;
+ struct devdesc *dev;
+ int result;
- if ((result = archsw.arch_getdev((void *)&dev, fname, file)) == 0) { /* get the device */
- /* point to device-specific data so that device open can use it */
- f->f_devdata = dev;
- if ((result = dev->d_dev->dv_open(f, dev)) == 0) { /* try to open it */
- /* reference the devsw entry from the open_file structure */
- f->f_dev = dev->d_dev;
- } else {
- free(dev); /* release the device descriptor */
- }
+ result = archsw.arch_getdev((void **)&dev, fname, file);
+ if (result)
+ return (result);
+
+ /* point to device-specific data so that device open can use it */
+ f->f_devdata = dev;
+ result = dev->d_dev->dv_open(f, dev);
+ if (result != 0) {
+ f->f_devdata = NULL;
+ free(dev);
+ return (result);
}
- return(result);
+
+ /* reference the devsw entry from the open_file structure */
+ f->f_dev = dev->d_dev;
+ return (0);
}
int
Index: module.c
===================================================================
RCS file: /home/cvs/src/sys/boot/common/module.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -L sys/boot/common/module.c -L sys/boot/common/module.c -u -r1.1.1.2 -r1.2
--- sys/boot/common/module.c
+++ sys/boot/common/module.c
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/common/module.c,v 1.25.10.1 2006/01/23 14:33:53 marius Exp $");
+__FBSDID("$FreeBSD: src/sys/boot/common/module.c,v 1.27 2007/10/04 18:29:52 obrien Exp $");
/*
* file/module function dispatcher, support, etc.
@@ -75,6 +75,7 @@
static char *kld_ext_list[] = {
".ko",
"",
+ ".debug",
NULL
};
Index: load_elf_obj.c
===================================================================
RCS file: /home/cvs/src/sys/boot/common/load_elf_obj.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -L sys/boot/common/load_elf_obj.c -L sys/boot/common/load_elf_obj.c -u -r1.1.1.2 -r1.2
--- sys/boot/common/load_elf_obj.c
+++ sys/boot/common/load_elf_obj.c
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/common/load_elf_obj.c,v 1.1.4.1 2005/12/30 22:13:58 marcel Exp $");
+__FBSDID("$FreeBSD: src/sys/boot/common/load_elf_obj.c,v 1.2 2005/12/18 04:52:35 marcel Exp $");
#include <sys/param.h>
#include <sys/exec.h>
Index: panic.c
===================================================================
RCS file: /home/cvs/src/sys/boot/common/panic.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -L sys/boot/common/panic.c -L sys/boot/common/panic.c -u -r1.2 -r1.3
--- sys/boot/common/panic.c
+++ sys/boot/common/panic.c
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/common/panic.c,v 1.7 2003/08/25 23:30:41 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/boot/common/panic.c,v 1.8 2006/09/29 20:57:38 ru Exp $");
#include <stand.h>
#include <machine/stdarg.h>
Index: help.common
===================================================================
RCS file: /home/cvs/src/sys/boot/common/help.common,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -L sys/boot/common/help.common -L sys/boot/common/help.common -u -r1.1.1.2 -r1.2
--- sys/boot/common/help.common
+++ sys/boot/common/help.common
@@ -44,7 +44,7 @@
bcachestat
- Displays statistics about disk cache usage. For depuration only.
+ Displays statistics about disk cache usage. For debugging only.
################################################################################
# Techo DEcho arguments
@@ -294,7 +294,7 @@
Various kernel tunable parameters can be overridden by specifying new
values in the environment.
- set kern.ipc.nmbclusters=<value> NMBCLUSTERS
+ set kern.ipc.nmbclusters=<value>
Set the number of mbuf clusters to be allocated. The value
cannot be set below the default determined when the kernel
Index: bootstrap.h
===================================================================
RCS file: /home/cvs/src/sys/boot/common/bootstrap.h,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -L sys/boot/common/bootstrap.h -L sys/boot/common/bootstrap.h -u -r1.1.1.2 -r1.2
--- sys/boot/common/bootstrap.h
+++ sys/boot/common/bootstrap.h
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/boot/common/bootstrap.h,v 1.41.2.1 2005/12/30 22:13:58 marcel Exp $
+ * $FreeBSD: src/sys/boot/common/bootstrap.h,v 1.44 2006/12/18 07:35:14 kmacy Exp $
*/
#include <sys/types.h>
@@ -43,6 +43,7 @@
#define DEVT_DISK 1
#define DEVT_NET 2
#define DEVT_CD 3
+ int d_unit;
};
/* Commands and return values; nonzero return sets command_errmsg != NULL */
@@ -291,6 +292,8 @@
/* Perform ISA byte port I/O (only for systems with ISA) */
int (*arch_isainb)(int port);
void (*arch_isaoutb)(int port, int value);
+ /* Pass in initial kernel memory size */
+ void (*arch_maphint)(vm_offset_t va, size_t len);
};
extern struct arch_switch archsw;
Index: reloc_elf.c
===================================================================
RCS file: /home/cvs/src/sys/boot/common/reloc_elf.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -L sys/boot/common/reloc_elf.c -L sys/boot/common/reloc_elf.c -u -r1.1.1.2 -r1.2
--- sys/boot/common/reloc_elf.c
+++ sys/boot/common/reloc_elf.c
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/common/reloc_elf.c,v 1.1.4.1 2005/12/30 22:13:58 marcel Exp $");
+__FBSDID("$FreeBSD: src/sys/boot/common/reloc_elf.c,v 1.2 2005/12/18 04:52:35 marcel Exp $");
#include <sys/types.h>
#include <machine/elf.h>
Index: pnp.c
===================================================================
RCS file: /home/cvs/src/sys/boot/common/pnp.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/boot/common/pnp.c -L sys/boot/common/pnp.c -u -r1.1.1.1 -r1.2
--- sys/boot/common/pnp.c
+++ sys/boot/common/pnp.c
@@ -4,7 +4,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/common/pnp.c,v 1.16 2003/08/25 23:30:41 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/boot/common/pnp.c,v 1.17 2007/01/07 22:25:45 marius Exp $");
/*
* "Plug and Play" functionality.
@@ -82,52 +82,6 @@
return(CMD_OK);
}
-#if 0
-/*
- * Try to load outstanding modules (eg. after disk change)
- */
-COMMAND_SET(pnpload, "pnpload", "load modules for PnP devices", pnp_load);
-
-static int
-pnp_load(int argc, char *argv[])
-{
- struct pnpinfo *pi;
- char *modfname;
-
- /* find anything? */
- if (STAILQ_FIRST(&pnp_devices) != NULL) {
-
- /* check for kernel, assign modules handled by static drivers there */
- if (pnp_scankernel()) {
- command_errmsg = "cannot load drivers until kernel loaded";
- return(CMD_ERROR);
- }
- if (fname == NULL) {
- /* default paths */
- pnp_readconf("/boot/pnpdata.local");
- pnp_readconf("/boot/pnpdata");
- } else {
- if (pnp_readconf(fname)) {
- sprintf(command_errbuf, "can't read PnP information from '%s'", fname);
- return(CMD_ERROR);
- }
- }
-
- /* try to load any modules that have been nominated */
- STAILQ_FOREACH(pi, &pnp_devices, pi_link) {
- /* Already loaded? */
- if ((pi->pi_module != NULL) && (file_findfile(pi->pi_module, NULL) == NULL)) {
- modfname = malloc(strlen(pi->pi_module) + 4);
- sprintf(modfname, "%s.ko", pi->pi_module); /* XXX implicit knowledge of KLD module filenames */
- if (mod_load(pi->pi_module, pi->pi_argc, pi->pi_argv))
- printf("Could not load module '%s' for device '%s'\n", modfname, STAILQ_FIRST(&pi->pi_ident)->id_ident);
- free(modfname);
- }
- }
- }
- return(CMD_OK);
-}
-#endif
/*
* Throw away anything we think we know about PnP devices.
*/
@@ -142,159 +96,7 @@
pnp_freeinfo(pi);
}
}
-#if 0
-/*
- * The PnP configuration database consists of a flat text file with
- * entries one per line. Valid lines are:
- *
- * # <text>
- *
- * This line is a comment, and ignored.
- *
- * [<name>]
- *
- * Entries following this line are for devices connected to the
- * bus <name>, At least one such entry must be encountered
- * before identifiers are recognised.
- *
- * ident=<identifier> rev=<revision> module=<module> args=<arguments>
- *
- * This line describes an identifier:module mapping. The 'ident'
- * and 'module' fields are required; the 'rev' field is currently
- * ignored (but should be used), and the 'args' field must come
- * last.
- *
- * Comments may be appended to lines; any character including or following
- * '#' on a line is ignored.
- */
-static int
-pnp_readconf(char *path)
-{
- struct pnpinfo *pi;
- struct pnpident *id;
- int fd, line;
- char lbuf[128], *currbus, *ident, *revision, *module, *args;
- char *cp, *ep, *tp, c;
-
- /* try to open the file */
- if ((fd = open(path, O_RDONLY)) >= 0) {
- line = 0;
- currbus = NULL;
-
- while (fgetstr(lbuf, sizeof(lbuf), fd) > 0) {
- line++;
- /* Find the first non-space character on the line */
- for (cp = lbuf; (*cp != 0) && !isspace(*cp); cp++)
- ;
-
- /* keep/discard? */
- if ((*cp == 0) || (*cp == '#'))
- continue;
-
- /* cut trailing comment? */
- if ((ep = strchr(cp, '#')) != NULL)
- *ep = 0;
-
- /* bus declaration? */
- if (*cp == '[') {
- if (((ep = strchr(cp, ']')) == NULL) || ((ep - cp) < 2)) {
- printf("%s line %d: bad bus specification\n", path, line);
- } else {
- if (currbus != NULL)
- free(currbus);
- *ep = 0;
- currbus = strdup(cp + 1);
- }
- continue;
- }
-
- /* XXX should we complain? */
- if (currbus == NULL)
- continue;
-
- /* mapping */
- for (ident = module = args = revision = NULL; *cp != 0;) {
-
- /* discard leading whitespace */
- if (isspace(*cp)) {
- cp++;
- continue;
- }
-
- /* scan for terminator, separator */
- for (ep = cp; (*ep != 0) && (*ep != '=') && !isspace(*ep); ep++)
- ;
-
- if (*ep == '=') {
- *ep = 0;
- for (tp = ep + 1; (*tp != 0) && !isspace(*tp); tp++)
- ;
- c = *tp;
- *tp = 0;
- if ((ident == NULL) && !strcmp(cp, "ident")) {
- ident = ep + 1;
- } else if ((revision == NULL) && !strcmp(cp, "revision")) {
- revision = ep + 1;
- } else if ((args == NULL) && !strcmp(cp, "args")) {
- *tp = c;
- while (*tp != 0) /* skip to end of string */
- tp++;
- args = ep + 1;
- } else {
- /* XXX complain? */
- }
- cp = tp;
- continue;
- }
-
- /* it's garbage or a keyword - ignore it for now */
- cp = ep;
- }
-
- /* we must have at least ident and module set to be interesting */
- if ((ident == NULL) || (module == NULL))
- continue;
-
- /*
- * Loop looking for module/bus that might match this, but aren't already
- * assigned.
- * XXX no revision parse/test here yet.
- */
- STAILQ_FOREACH(pi, &pnp_devices, pi_link) {
-
- /* no driver assigned, bus matches OK */
- if ((pi->pi_module == NULL) &&
- !strcmp(pi->pi_handler->pp_name, currbus)) {
-
- /* scan idents, take first match */
- STAILQ_FOREACH(id, &pi->pi_ident, id_link)
- if (!strcmp(id->id_ident, ident))
- break;
-
- /* find a match? */
- if (id != NULL) {
- if (args != NULL)
- if (parse(&pi->pi_argc, &pi->pi_argv, args)) {
- printf("%s line %d: bad arguments\n", path, line);
- continue;
- }
- pi->pi_module = strdup(module);
- printf("use module '%s' for %s:%s\n", module, pi->pi_handler->pp_name, id->id_ident);
- }
- }
- }
- }
- close(fd);
- }
- return(CMD_OK);
-}
-static int
-pnp_scankernel(void)
-{
- return(CMD_OK);
-}
-#endif
/*
* Add a unique identifier to (pi)
*/
Index: ufsread.c
===================================================================
RCS file: /home/cvs/src/sys/boot/common/ufsread.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/boot/common/ufsread.c -L sys/boot/common/ufsread.c -u -r1.1.1.1 -r1.2
--- sys/boot/common/ufsread.c
+++ sys/boot/common/ufsread.c
@@ -44,14 +44,14 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/common/ufsread.c,v 1.14 2005/01/30 14:58:00 rwatson Exp $");
+__FBSDID("$FreeBSD: src/sys/boot/common/ufsread.c,v 1.14.10.1 2007/11/08 21:31:38 jhb Exp $");
#include <ufs/ufs/dinode.h>
#include <ufs/ffs/fs.h>
-#ifdef __i386__
+#ifdef UFS_SMALL_CGBASE
/* XXX: Revert to old (broken for over 1.5Tb filesystems) version of cgbase
- (see sys/ufs/ffs/fs.h rev 1.39) so that i386 boot loader (boot2) can
- support both UFS1 and UFS2 again. */
+ (see sys/ufs/ffs/fs.h rev 1.39) so that small boot loaders (e.g. boot2) can
+ support both UFS1 and UFS2. */
#undef cgbase
#define cgbase(fs, c) ((ufs2_daddr_t)((fs)->fs_fpg * (c)))
#endif
Index: Makefile.inc
===================================================================
RCS file: /home/cvs/src/sys/boot/common/Makefile.inc,v
retrieving revision 1.3
retrieving revision 1.4
diff -L sys/boot/common/Makefile.inc -L sys/boot/common/Makefile.inc -u -r1.3 -r1.4
--- sys/boot/common/Makefile.inc
+++ sys/boot/common/Makefile.inc
@@ -1,18 +1,14 @@
-# $FreeBSD: src/sys/boot/common/Makefile.inc,v 1.21 2004/10/24 12:32:41 ru Exp $
# $MidnightBSD$
+# $FreeBSD: src/sys/boot/common/Makefile.inc,v 1.23 2006/11/02 00:26:44 marcel Exp $
-SRCS+= bcache.c boot.c commands.c console.c devopen.c interp.c
+SRCS+= boot.c commands.c console.c devopen.c interp.c
SRCS+= interp_backslash.c interp_parse.c ls.c misc.c
SRCS+= module.c panic.c
.if ${MACHINE} == "i386" || ${MACHINE_ARCH} == "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} == "pc98"
-SRCS+= load_elf32.c load_elf32_obj.c reloc_elf32.c
-.elif ${MACHINE_ARCH} == "powerpc"
-SRCS+= load_elf32.c reloc_elf32.c
-.elif ${MACHINE_ARCH} == "sparc64" || ${MACHINE_ARCH} == "ia64"
+.elif ${MACHINE_ARCH} == "sparc64"
SRCS+= load_elf64.c reloc_elf64.c
.endif
@@ -20,6 +16,10 @@
SRCS+= dev_net.c
.endif
+.if defined(HAVE_BCACHE)
+SRCS+= bcache.c
+.endif
+
# Machine-independant ISA PnP
.if defined(HAVE_ISABUS)
SRCS+= isapnp.c
Index: loader.8
===================================================================
RCS file: /home/cvs/src/sys/boot/common/loader.8,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -L sys/boot/common/loader.8 -L sys/boot/common/loader.8 -u -r1.1.1.2 -r1.2
--- sys/boot/common/loader.8
+++ sys/boot/common/loader.8
@@ -22,9 +22,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD: src/sys/boot/common/loader.8,v 1.82.2.2 2006/02/14 06:20:14 ru Exp $
+.\" $FreeBSD: src/sys/boot/common/loader.8,v 1.93 2007/05/09 02:37:58 sepotvin Exp $
.\"
-.Dd September 22, 2005
+.Dd May 8, 2007
.Dt LOADER 8
.Os
.Sh NAME
@@ -159,7 +159,7 @@
.Pp
.It Ic bcachestat
Displays statistics about disk cache usage.
-For depuration only.
+For debugging only.
.Pp
.It Ic boot
.It Ic boot Ar kernelname Op Cm ...
@@ -423,12 +423,63 @@
.It Va currdev
Selects the default device.
Syntax for devices is odd.
+.It Va init_chroot
+If set to a valid directory in the root file system, it causes
+.Xr init 8
+to perform a
+.Xr chroot 2
+operation on that directory, making it the new root directory.
+That happens before entering single-user mode or multi-user
+mode (but after executing the
+.Va init_script
+if enabled).
.It Va init_path
Sets the list of binaries which the kernel will try to run as the initial
process.
The first matching binary is used.
The default list is
-.Dq Li /sbin/init:/sbin/oinit:/sbin/init.bak:/rescue/init:/stand/sysinstall .
+.Dq Li /sbin/init:/sbin/oinit:/sbin/init.bak:\:/rescue/init:/stand/sysinstall .
+.It Va init_script
+If set to a valid file name in the root file system,
+instructs
+.Xr init 8
+to run that script as the very first action,
+before doing anything else.
+Signal handling and exit code interpretation is similar to
+running the
+.Pa /etc/rc
+script.
+In particular, single-user operation is enforced
+if the script terminates with a non-zero exit code,
+or if a SIGTERM is delivered to the
+.Xr init 8
+process (PID 1).
+.It Va init_script
+Defines the shell binary to be used for executing the various shell scripts.
+The default is
+.Dq Li /bin/sh .
+It is used for running the
+.Va init_script
+if set, as well as for the
+.Pa /etc/rc
+and
+.Pa /etc/rc.shutdown
+scripts.
+The value of the corresponding
+.Xr kenv 2
+variable is evaluated every time
+.Xr init 8
+calls a shell script, so it can be changed later on using the
+.Xr kenv 1
+utility.
+In particular, if a non-default shell is used for running an
+.Va init_script ,
+it might be desirable to have that script reset the value of
+.Va init_shell
+back to the default, so that the
+.Pa /etc/rc
+script is executed with the standard shell
+.Pa /bin/sh .
.It Va interpret
Has the value
.Dq Li OK
@@ -509,33 +560,33 @@
Set the number of mbuf clusters to be allocated.
The value cannot be set below the default
determined when the kernel was compiled.
-Modifies
-.Dv NMBCLUSTERS .
.It Va kern.ipc.nsfbufs
Set the number of
.Xr sendfile 2
buffers to be allocated.
Overrides
.Dv NSFBUFS .
+Not all architectures use such buffers; see
+.Xr sendfile 2
+for details.
.It Va kern.maxswzone
Limits the amount of KVM to be used to hold swap
meta information, which directly governs the
maximum amount of swap the system can support.
This value is specified in bytes of KVA space
-and defaults to around 70MBytes.
+and defaults to 32MBytes on i386 and amd64.
Care should be taken
to not reduce this value such that the actual
amount of configured swap exceeds 1/2 the
kernel-supported swap.
-The default 70MB allows
-the kernel to support a maximum of (approximately)
-14GB of configured swap.
-Only mess around with
+The default of 32MB allows
+the kernel to support a maximum of ~7GB of swap.
+Only change
this parameter if you need to greatly extend the
KVM reservation for other resources such as the
buffer cache or
-.Dv NMBCLUSTERS .
-Modifies
+.Va kern.ipc.nmbclusters .
+Modifies kernel option
.Dv VM_SWZONE_SIZE_MAX .
.It Va kern.maxbcache
Limits the amount of KVM reserved for use by the
@@ -547,7 +598,7 @@
Only mess around with this parameter if you need to
greatly extend the KVM reservation for other resources
such as the swap zone or
-.Dv NMBCLUSTERS .
+.Va kern.ipc.nmbclusters .
Note that
the NBUF parameter will override this limit.
Modifies
@@ -564,6 +615,15 @@
This overrides the value determined when the kernel was compiled.
Modifies
.Dv VM_KMEM_SIZE .
+.It Va vm.kmem_size_min
+.It Va vm.kmem_size_max
+Sets the minimum and maximum (respectively) amount of kernel memory
+that will be automatically allocated by the kernel.
+These override the values determined when the kernel was compiled.
+Modifies
+.Dv VM_KMEM_SIZE_MIN
+and
+.Dv VM_KMEM_SIZE_MAX .
.El
.Ss BUILTIN PARSER
When a builtin command is executed, the rest of the line is taken
@@ -800,9 +860,6 @@
.It arch-i386
.Ic TRUE
if the architecture is IA32.
-.It arch-alpha
-.Ic TRUE
-if the architecture is AXP.
.It FreeBSD_version
.Fx
version at compile time.
Index: merge_help.awk
===================================================================
RCS file: /home/cvs/src/sys/boot/common/merge_help.awk,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/boot/common/merge_help.awk -L sys/boot/common/merge_help.awk -u -r1.1.1.1 -r1.2
--- sys/boot/common/merge_help.awk
+++ sys/boot/common/merge_help.awk
@@ -1,6 +1,6 @@
#!/usr/bin/awk -f
#
-# $FreeBSD: src/sys/boot/common/merge_help.awk,v 1.5 2001/11/07 17:53:25 fenner Exp $
+# $FreeBSD: src/sys/boot/common/merge_help.awk,v 1.6 2006/09/28 19:06:20 jhb Exp $
#
# Merge two boot loader help files for FreeBSD 3.0
# Joe Abley <jabley at patho.gen.nz>
@@ -25,9 +25,12 @@
match($0, " T[[:graph:]]+");
T = substr($0, RSTART + 2, RLENGTH - 2);
match($0, " S[[:graph:]]+");
+ SSTART = RSTART
S = (RLENGTH == -1) ? "" : substr($0, RSTART + 2, RLENGTH - 2);
match($0, " D[[:graph:]][[:print:]]*$");
D = substr($0, RSTART + 2);
+ if (SSTART > RSTART)
+ S = "";
# find a suitable place to store this one...
ind++;
Index: console.c
===================================================================
RCS file: /home/cvs/src/sys/boot/common/console.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/boot/common/console.c -L sys/boot/common/console.c -u -r1.1.1.1 -r1.2
--- sys/boot/common/console.c
+++ sys/boot/common/console.c
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/boot/common/console.c,v 1.7.2.1 2005/08/05 00:36:59 brian Exp $");
+__FBSDID("$FreeBSD: src/sys/boot/common/console.c,v 1.8 2005/07/29 12:47:42 brian Exp $");
#include <stand.h>
#include <string.h>
Index: efinet.h
===================================================================
RCS file: /home/cvs/src/sys/boot/efi/include/efinet.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/boot/efi/include/efinet.h -L sys/boot/efi/include/efinet.h -u -r1.1.1.1 -r1.2
--- sys/boot/efi/include/efinet.h
+++ sys/boot/efi/include/efinet.h
@@ -1,10 +1,17 @@
-/* $FreeBSD: src/sys/boot/efi/include/efinet.h,v 1.2 2002/05/19 03:17:20 marcel Exp $ */
+/* $FreeBSD: src/sys/boot/efi/include/efinet.h,v 1.3 2006/11/02 02:42:47 marcel Exp $ */
#ifndef _EFINET_H
#define _EFINET_H
/*++
-Copyright (c) 1999 Intel Corporation
+Copyright (c) 1999 - 2002 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:
efinet.h
@@ -16,55 +23,78 @@
--*/
+///////////////////////////////////////////////////////////////////////////////
+//
+// Simple Network Protocol
+//
+
#define EFI_SIMPLE_NETWORK_PROTOCOL \
{ 0xA19832B9, 0xAC25, 0x11D3, 0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D }
+
INTERFACE_DECL(_EFI_SIMPLE_NETWORK);
+///////////////////////////////////////////////////////////////////////////////
+//
+
typedef struct {
- /*
- * Total number of frames received. Includes frames with errors and
- * dropped frames.
- */
+ //
+ // Total number of frames received. Includes frames with errors and
+ // dropped frames.
+ //
UINT64 RxTotalFrames;
- /* Number of valid frames received and copied into receive buffers. */
+ //
+ // Number of valid frames received and copied into receive buffers.
+ //
UINT64 RxGoodFrames;
- /*
- * Number of frames below the minimum length for the media.
- * This would be <64 for ethernet.
- */
+ //
+ // Number of frames below the minimum length for the media.
+ // This would be <64 for ethernet.
+ //
UINT64 RxUndersizeFrames;
- /*
- * Number of frames longer than the maxminum length for the
- * media. This would be >1500 for ethernet.
- */
+ //
+ // Number of frames longer than the maxminum length for the
+ // media. This would be >1500 for ethernet.
+ //
UINT64 RxOversizeFrames;
- /* Valid frames that were dropped because receive buffers were full. */
+ //
+ // Valid frames that were dropped because receive buffers were full.
+ //
UINT64 RxDroppedFrames;
- /* Number of valid unicast frames received and not dropped. */
+ //
+ // Number of valid unicast frames received and not dropped.
+ //
UINT64 RxUnicastFrames;
- /* Number of valid broadcast frames received and not dropped. */
+ //
+ // Number of valid broadcast frames received and not dropped.
+ //
UINT64 RxBroadcastFrames;
- /* Number of valid mutlicast frames received and not dropped. */
+ //
+ // Number of valid mutlicast frames received and not dropped.
+ //
UINT64 RxMulticastFrames;
- /* Number of frames w/ CRC or alignment errors. */
+ //
+ // Number of frames w/ CRC or alignment errors.
+ //
UINT64 RxCrcErrorFrames;
- /*
- * Total number of bytes received. Includes frames with errors
- * and dropped frames.
- */
+ //
+ // Total number of bytes received. Includes frames with errors
+ // and dropped frames.
+ //
UINT64 RxTotalBytes;
- /* Transmit statistics. */
+ //
+ // Transmit statistics.
+ //
UINT64 TxTotalFrames;
UINT64 TxGoodFrames;
UINT64 TxUndersizeFrames;
@@ -76,14 +106,21 @@
UINT64 TxCrcErrorFrames;
UINT64 TxTotalBytes;
- /* Number of collisions detection on this subnet. */
+ //
+ // Number of collisions detection on this subnet.
+ //
UINT64 Collisions;
- /* Number of frames destined for unsupported protocol. */
+ //
+ // Number of frames destined for unsupported protocol.
+ //
UINT64 UnsupportedProtocol;
} EFI_NETWORK_STATISTICS;
+///////////////////////////////////////////////////////////////////////////////
+//
+
typedef enum {
EfiSimpleNetworkStopped,
EfiSimpleNetworkStarted,
@@ -91,17 +128,25 @@
EfiSimpleNetworkMaxState
} EFI_SIMPLE_NETWORK_STATE;
+///////////////////////////////////////////////////////////////////////////////
+//
+
#define EFI_SIMPLE_NETWORK_RECEIVE_UNICAST 0x01
#define EFI_SIMPLE_NETWORK_RECEIVE_MULTICAST 0x02
#define EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST 0x04
#define EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS 0x08
#define EFI_SIMPLE_NETWORK_RECEIVE_PROMISCUOUS_MULTICAST 0x10
+///////////////////////////////////////////////////////////////////////////////
+//
+
#define EFI_SIMPLE_NETWORK_RECEIVE_INTERRUPT 0x01
#define EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT 0x02
#define EFI_SIMPLE_NETWORK_COMMAND_INTERRUPT 0x04
#define EFI_SIMPLE_NETWORK_SOFTWARE_INTERRUPT 0x08
+///////////////////////////////////////////////////////////////////////////////
+//
#define MAX_MCAST_FILTER_CNT 16
typedef struct {
UINT32 State;
@@ -125,18 +170,27 @@
BOOLEAN MediaPresent;
} EFI_SIMPLE_NETWORK_MODE;
+///////////////////////////////////////////////////////////////////////////////
+//
+
typedef
EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_START) (
IN struct _EFI_SIMPLE_NETWORK *This
);
+///////////////////////////////////////////////////////////////////////////////
+//
+
typedef
EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_STOP) (
IN struct _EFI_SIMPLE_NETWORK *This
);
+///////////////////////////////////////////////////////////////////////////////
+//
+
typedef
EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_INITIALIZE) (
@@ -145,6 +199,9 @@
IN UINTN ExtraTxBufferSize OPTIONAL
);
+///////////////////////////////////////////////////////////////////////////////
+//
+
typedef
EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_RESET) (
@@ -152,12 +209,18 @@
IN BOOLEAN ExtendedVerification
);
+///////////////////////////////////////////////////////////////////////////////
+//
+
typedef
EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_SHUTDOWN) (
IN struct _EFI_SIMPLE_NETWORK *This
);
+///////////////////////////////////////////////////////////////////////////////
+//
+
typedef
EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_RECEIVE_FILTERS) (
@@ -169,6 +232,9 @@
IN EFI_MAC_ADDRESS *MCastFilter OPTIONAL
);
+///////////////////////////////////////////////////////////////////////////////
+//
+
typedef
EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_STATION_ADDRESS) (
@@ -177,6 +243,9 @@
IN EFI_MAC_ADDRESS *New OPTIONAL
);
+///////////////////////////////////////////////////////////////////////////////
+//
+
typedef
EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_STATISTICS) (
@@ -186,6 +255,9 @@
OUT EFI_NETWORK_STATISTICS *StatisticsTable OPTIONAL
);
+///////////////////////////////////////////////////////////////////////////////
+//
+
typedef
EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_MCAST_IP_TO_MAC) (
@@ -195,6 +267,9 @@
OUT EFI_MAC_ADDRESS *MAC
);
+///////////////////////////////////////////////////////////////////////////////
+//
+
typedef
EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_NVDATA) (
@@ -205,6 +280,9 @@
IN OUT VOID *Buffer
);
+///////////////////////////////////////////////////////////////////////////////
+//
+
typedef
EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_GET_STATUS) (
@@ -213,6 +291,9 @@
OUT VOID **TxBuf OPTIONAL
);
+///////////////////////////////////////////////////////////////////////////////
+//
+
typedef
EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_TRANSMIT) (
@@ -225,6 +306,9 @@
IN UINT16 *Protocol OPTIONAL
);
+///////////////////////////////////////////////////////////////////////////////
+//
+
typedef
EFI_STATUS
(EFIAPI *EFI_SIMPLE_NETWORK_RECEIVE) (
@@ -237,6 +321,9 @@
OUT UINT16 *Protocol OPTIONAL
);
+///////////////////////////////////////////////////////////////////////////////
+//
+
#define EFI_SIMPLE_NETWORK_INTERFACE_REVISION 0x00010000
typedef struct _EFI_SIMPLE_NETWORK {
Index: efierr.h
===================================================================
RCS file: /home/cvs/src/sys/boot/efi/include/efierr.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/boot/efi/include/efierr.h -L sys/boot/efi/include/efierr.h -u -r1.1.1.1 -r1.2
--- sys/boot/efi/include/efierr.h
+++ sys/boot/efi/include/efierr.h
@@ -1,10 +1,17 @@
-/* $FreeBSD: src/sys/boot/efi/include/efierr.h,v 1.1 2001/06/09 16:49:49 dfr Exp $ */
+/* $FreeBSD: src/sys/boot/efi/include/efierr.h,v 1.2 2006/11/02 02:42:47 marcel Exp $ */
#ifndef _EFI_ERR_H
#define _EFI_ERR_H
/*++
-Copyright (c) 1998 Intel Corporation
+Copyright (c) 1999 - 2002 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:
@@ -52,7 +59,7 @@
#define EFI_TFTP_ERROR EFIERR(23)
#define EFI_PROTOCOL_ERROR EFIERR(24)
-#define EFI_WARN_UNKOWN_GLYPH EFIWARN(1)
+#define EFI_WARN_UNKNOWN_GLYPH EFIWARN(1)
#define EFI_WARN_DELETE_FAILURE EFIWARN(2)
#define EFI_WARN_WRITE_FAILURE EFIWARN(3)
#define EFI_WARN_BUFFER_TOO_SMALL EFIWARN(4)
Index: efiprot.h
===================================================================
RCS file: /home/cvs/src/sys/boot/efi/include/efiprot.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/boot/efi/include/efiprot.h -L sys/boot/efi/include/efiprot.h -u -r1.1.1.1 -r1.2
--- sys/boot/efi/include/efiprot.h
+++ sys/boot/efi/include/efiprot.h
@@ -1,10 +1,17 @@
-/* $FreeBSD: src/sys/boot/efi/include/efiprot.h,v 1.3 2002/05/19 03:17:20 marcel Exp $ */
+/* $FreeBSD: src/sys/boot/efi/include/efiprot.h,v 1.4 2006/11/02 02:42:47 marcel Exp $ */
#ifndef _EFI_PROT_H
#define _EFI_PROT_H
/*++
-Copyright (c) 1998 Intel Corporation
+Copyright (c) 1999 - 2002 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:
@@ -20,17 +27,17 @@
--*/
-/*
- * Device Path protocol
- */
+//
+// Device Path protocol
+//
#define DEVICE_PATH_PROTOCOL \
{ 0x9576e91, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
-/*
- * Block IO protocol
- */
+//
+// Block IO protocol
+//
#define BLOCK_IO_PROTOCOL \
{ 0x964e5b21, 0x6459, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
@@ -104,9 +111,9 @@
-/*
- * Disk Block IO protocol
- */
+//
+// Disk Block IO protocol
+//
#define DISK_IO_PROTOCOL \
{ 0xce345171, 0xba0b, 0x11d2, 0x8e, 0x4f, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
@@ -143,9 +150,9 @@
} EFI_DISK_IO;
-/*
- * Simple filesystem protocol
- */
+//
+// Simple file system protocol
+//
#define SIMPLE_FILE_SYSTEM_PROTOCOL \
{ 0x964e5b22, 0x6459, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
@@ -167,6 +174,10 @@
EFI_VOLUME_OPEN OpenVolume;
} EFI_FILE_IO_INTERFACE;
+//
+//
+//
+
typedef
EFI_STATUS
(EFIAPI *EFI_FILE_OPEN) (
@@ -177,12 +188,12 @@
IN UINT64 Attributes
);
-/* Open modes */
+// Open modes
#define EFI_FILE_MODE_READ 0x0000000000000001
#define EFI_FILE_MODE_WRITE 0x0000000000000002
#define EFI_FILE_MODE_CREATE 0x8000000000000000
-/* File attributes */
+// File attributes
#define EFI_FILE_READ_ONLY 0x0000000000000001
#define EFI_FILE_HIDDEN 0x0000000000000002
#define EFI_FILE_SYSTEM 0x0000000000000004
@@ -275,9 +286,9 @@
} EFI_FILE, *EFI_FILE_HANDLE;
-/*
- * File information types
- */
+//
+// File information types
+//
#define EFI_FILE_INFO_ID \
{ 0x9576e92, 0x6d3f, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
@@ -293,14 +304,13 @@
CHAR16 FileName[1];
} EFI_FILE_INFO;
-/*
- * The FileName field of the EFI_FILE_INFO data structure is variable length.
- * Whenever code needs to know the size of the EFI_FILE_INFO data structure,
- * it needs to be the size of the data structure without the FileName field.
- * The following macro computes this size correctly no matter how big the
- * FileName array is declared. This is required to make the EFI_FILE_INFO
- * data structure ANSI compliant.
- */
+//
+// The FileName field of the EFI_FILE_INFO data structure is variable length.
+// Whenever code needs to know the size of the EFI_FILE_INFO data structure, it needs to
+// be the size of the data structure without the FileName field. The following macro
+// computes this size correctly no matter how big the FileName array is declared.
+// This is required to make the EFI_FILE_INFO data structure ANSI compilant.
+//
#define SIZE_OF_EFI_FILE_INFO EFI_FIELD_OFFSET(EFI_FILE_INFO,FileName)
@@ -316,15 +326,13 @@
CHAR16 VolumeLabel[1];
} EFI_FILE_SYSTEM_INFO;
-/*
- * The VolumeLabel field of the EFI_FILE_SYSTEM_INFO data structure is
- * variable length. Whenever code needs to know the size of the
- * EFI_FILE_SYSTEM_INFO data structure, it needs to be the size of the data
- * structure without the VolumeLable field. The following macro computes
- * this size correctly no matter how big the VolumeLable array is declared.
- * This is required to make the EFI_FILE_SYSTEM_INFO data structure ANSI
- * compilant.
- */
+//
+// The VolumeLabel field of the EFI_FILE_SYSTEM_INFO data structure is variable length.
+// Whenever code needs to know the size of the EFI_FILE_SYSTEM_INFO data structure, it needs
+// to be the size of the data structure without the VolumeLable field. The following macro
+// computes this size correctly no matter how big the VolumeLable array is declared.
+// This is required to make the EFI_FILE_SYSTEM_INFO data structure ANSI compilant.
+//
#define SIZE_OF_EFI_FILE_SYSTEM_INFO EFI_FIELD_OFFSET(EFI_FILE_SYSTEM_INFO,VolumeLabel)
@@ -337,9 +345,10 @@
#define SIZE_OF_EFI_FILE_SYSTEM_VOLUME_LABEL_INFO EFI_FIELD_OFFSET(EFI_FILE_SYSTEM_VOLUME_LABEL_INFO,VolumeLabel)
-/*
- * Load file protocol
- */
+//
+// Load file protocol
+//
+
#define LOAD_FILE_PROTOCOL \
{ 0x56EC3091, 0x954C, 0x11d2, 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }
@@ -361,9 +370,9 @@
} EFI_LOAD_FILE_INTERFACE;
-/*
- * Device IO protocol
- */
+//
+// Device IO protocol
+//
#define DEVICE_IO_PROTOCOL \
{ 0xaf6ac311, 0x84c3, 0x11d2, 0x8e, 0x3c, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
@@ -375,19 +384,17 @@
IO_UINT16,
IO_UINT32,
IO_UINT64,
-/*
- * Specification Change: Copy from MMIO to MMIO vs. MMIO to buffer, buffer to
- * MMIO
- */
+//
+// Specification Change: Copy from MMIO to MMIO vs. MMIO to buffer, buffer to MMIO
+//
MMIO_COPY_UINT8,
MMIO_COPY_UINT16,
MMIO_COPY_UINT32,
MMIO_COPY_UINT64
} EFI_IO_WIDTH;
-#define EFI_PCI_ADDRESS(_bus,_dev,_func) \
- ( (UINT64) ( (((UINTN)_bus) << 24) + (((UINTN)_dev) << 16) + (((UINTN)_func) << 8) ) )
-
+#define EFI_PCI_ADDRESS(bus,dev,func,reg) \
+ ( (UINT64) ( (((UINTN)bus) << 24) + (((UINTN)dev) << 16) + (((UINTN)func) << 8) + ((UINTN)reg) ))
typedef
EFI_STATUS
@@ -473,9 +480,9 @@
} EFI_DEVICE_IO_INTERFACE;
-/*
- * Unicode Collation protocol
- */
+//
+// Unicode Collation protocol
+//
#define UNICODE_COLLATION_PROTOCOL \
{ 0x1d85cd7f, 0xf43d, 0x11d2, 0x9a, 0xc, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d }
@@ -486,7 +493,7 @@
typedef
INTN
-(EFIAPI *EFI_UNICODE_STRICOLL) (
+(EFIAPI *EFI_UNICODE_COLLATION_STRICOLL) (
IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
IN CHAR16 *s1,
IN CHAR16 *s2
@@ -494,7 +501,7 @@
typedef
BOOLEAN
-(EFIAPI *EFI_UNICODE_METAIMATCH) (
+(EFIAPI *EFI_UNICODE_COLLATION_METAIMATCH) (
IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
IN CHAR16 *String,
IN CHAR16 *Pattern
@@ -502,21 +509,21 @@
typedef
VOID
-(EFIAPI *EFI_UNICODE_STRLWR) (
+(EFIAPI *EFI_UNICODE_COLLATION_STRLWR) (
IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
IN OUT CHAR16 *Str
);
typedef
VOID
-(EFIAPI *EFI_UNICODE_STRUPR) (
+(EFIAPI *EFI_UNICODE_COLLATION_STRUPR) (
IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
IN OUT CHAR16 *Str
);
typedef
VOID
-(EFIAPI *EFI_UNICODE_FATTOSTR) (
+(EFIAPI *EFI_UNICODE_COLLATION_FATTOSTR) (
IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
IN UINTN FatSize,
IN CHAR8 *Fat,
@@ -525,7 +532,7 @@
typedef
BOOLEAN
-(EFIAPI *EFI_UNICODE_STRTOFAT) (
+(EFIAPI *EFI_UNICODE_COLLATION_STRTOFAT) (
IN struct _EFI_UNICODE_COLLATION_INTERFACE *This,
IN CHAR16 *String,
IN UINTN FatSize,
@@ -535,15 +542,15 @@
typedef struct _EFI_UNICODE_COLLATION_INTERFACE {
- /* general */
- EFI_UNICODE_STRICOLL StriColl;
- EFI_UNICODE_METAIMATCH MetaiMatch;
- EFI_UNICODE_STRLWR StrLwr;
- EFI_UNICODE_STRUPR StrUpr;
-
- /* for supporting fat volumes */
- EFI_UNICODE_FATTOSTR FatToStr;
- EFI_UNICODE_STRTOFAT StrToFat;
+ // general
+ EFI_UNICODE_COLLATION_STRICOLL StriColl;
+ EFI_UNICODE_COLLATION_METAIMATCH MetaiMatch;
+ EFI_UNICODE_COLLATION_STRLWR StrLwr;
+ EFI_UNICODE_COLLATION_STRUPR StrUpr;
+
+ // for supporting fat volumes
+ EFI_UNICODE_COLLATION_FATTOSTR FatToStr;
+ EFI_UNICODE_COLLATION_STRTOFAT StrToFat;
CHAR8 *SupportedLanguages;
} EFI_UNICODE_COLLATION_INTERFACE;
Index: efidevp.h
===================================================================
RCS file: /home/cvs/src/sys/boot/efi/include/efidevp.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/boot/efi/include/efidevp.h -L sys/boot/efi/include/efidevp.h -u -r1.1.1.1 -r1.2
--- sys/boot/efi/include/efidevp.h
+++ sys/boot/efi/include/efidevp.h
@@ -1,10 +1,17 @@
-/* $FreeBSD: src/sys/boot/efi/include/efidevp.h,v 1.2 2002/05/19 03:17:20 marcel Exp $ */
+/* $FreeBSD: src/sys/boot/efi/include/efidevp.h,v 1.3 2006/11/02 02:42:47 marcel Exp $ */
#ifndef _DEVPATH_H
#define _DEVPATH_H
/*++
-Copyright (c) 1998 Intel Corporation
+Copyright (c) 1999 - 2002 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:
@@ -20,9 +27,9 @@
--*/
-/*
- * Device Path structures - Section C
- */
+//
+// Device Path structures - Section C
+//
typedef struct _EFI_DEVICE_PATH {
UINT8 Type;
@@ -33,7 +40,9 @@
#define EFI_DP_TYPE_MASK 0x7F
#define EFI_DP_TYPE_UNPACKED 0x80
+//#define END_DEVICE_PATH_TYPE 0xff
#define END_DEVICE_PATH_TYPE 0x7f
+//#define END_DEVICE_PATH_TYPE_UNPACKED 0x7f
#define END_ENTIRE_DEVICE_PATH_SUBTYPE 0xff
#define END_INSTANCE_DEVICE_PATH_SUBTYPE 0x01
@@ -47,6 +56,7 @@
#define DevicePathSubType(a) ( (a)->SubType )
#define DevicePathNodeLength(a) ( ((a)->Length[0]) | ((a)->Length[1] << 8) )
#define NextDevicePathNode(a) ( (EFI_DEVICE_PATH *) ( ((UINT8 *) (a)) + DevicePathNodeLength(a)))
+//#define IsDevicePathEndType(a) ( DevicePathType(a) == END_DEVICE_PATH_TYPE_UNPACKED )
#define IsDevicePathEndType(a) ( DevicePathType(a) == END_DEVICE_PATH_TYPE )
#define IsDevicePathEndSubType(a) ( (a)->SubType == END_ENTIRE_DEVICE_PATH_SUBTYPE )
#define IsDevicePathEnd(a) ( IsDevicePathEndType(a) && IsDevicePathEndSubType(a) )
@@ -82,7 +92,7 @@
#define HW_PCCARD_DP 0x02
typedef struct _PCCARD_DEVICE_PATH {
EFI_DEVICE_PATH Header;
- UINT8 SocketNumber;
+ UINT8 FunctionNumber;
} PCCARD_DEVICE_PATH;
#define HW_MEMMAP_DP 0x03
@@ -125,16 +135,25 @@
UINT32 UID;
} ACPI_HID_DEVICE_PATH;
-/*
- * EISA ID Macro
- * EISA ID Definition 32-bits
- * bits[15:0] - three character compressed ASCII EISA ID.
- * bits[31:16] - binary number
- * Compressed ASCII is 5 bits per character 0b00001 = 'A' 0b11010 = 'Z'
- */
+#define ACPI_EXTENDED_DP 0x02
+typedef struct _ACPI_EXTENDED_HID_DEVICE_PATH {
+ EFI_DEVICE_PATH Header;
+ UINT32 HID;
+ UINT32 UID;
+ UINT32 CID;
+} ACPI_EXTENDED_HID_DEVICE_PATH;
+
+//
+// EISA ID Macro
+// EISA ID Definition 32-bits
+// bits[15:0] - three character compressed ASCII EISA ID.
+// bits[31:16] - binary number
+// Compressed ASCII is 5 bits per character 0b00001 = 'A' 0b11010 = 'Z'
+//
#define PNP_EISA_ID_CONST 0x41d0
#define EISA_ID(_Name, _Num) ((UINT32) ((_Name) | (_Num) << 16))
#define EISA_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))
+#define EFI_PNP_ID(_PNPId) (EISA_ID(PNP_EISA_ID_CONST, (_PNPId)))
#define PNP_EISA_ID_MASK 0xffff
#define EISA_ID_TO_NUM(_Id) ((_Id) >> 16)
@@ -175,9 +194,9 @@
#define MSG_USB_DP 0x05
typedef struct _USB_DEVICE_PATH {
- EFI_DEVICE_PATH Header;
- UINT8 Port;
- UINT8 Endpoint;
+ EFI_DEVICE_PATH Header;
+ UINT8 ParentPortNumber;
+ UINT8 InterfaceNumber;
} USB_DEVICE_PATH;
#define MSG_USB_CLASS_DP 0x0F
@@ -186,7 +205,7 @@
UINT16 VendorId;
UINT16 ProductId;
UINT8 DeviceClass;
- UINT8 DeviceSubclass;
+ UINT8 DeviceSubClass;
UINT8 DeviceProtocol;
} USB_CLASS_DEVICE_PATH;
@@ -227,13 +246,20 @@
#define MSG_INFINIBAND_DP 0x09
typedef struct _INFINIBAND_DEVICE_PATH {
- EFI_DEVICE_PATH Header;
- UINT32 Reserved;
- UINT64 NodeGuid;
- UINT64 IocGuid;
- UINT64 DeviceId;
+ EFI_DEVICE_PATH Header;
+ UINT32 ResourceFlags;
+ UINT8 PortGid[16];
+ UINT64 ServiceId;
+ UINT64 TargetPortId;
+ UINT64 DeviceId;
} INFINIBAND_DEVICE_PATH;
+#define INFINIBAND_RESOURCE_FLAG_IOC_SERVICE 0x01
+#define INFINIBAND_RESOURCE_FLAG_EXTENDED_BOOT_ENVIRONMENT 0x02
+#define INFINIBAND_RESOURCE_FLAG_CONSOLE_PROTOCOL 0x04
+#define INFINIBAND_RESOURCE_FLAG_STORAGE_PROTOCOL 0x08
+#define INFINIBAND_RESOURCE_FLAG_NETWORK_PROTOCOL 0x10
+
#define MSG_UART_DP 0x0e
typedef struct _UART_DEVICE_PATH {
EFI_DEVICE_PATH Header;
@@ -253,6 +279,11 @@
#define DEVICE_PATH_MESSAGING_VT_100 \
{ 0xdfa66065, 0xb419, 0x11d3, 0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d }
+#define DEVICE_PATH_MESSAGING_VT_100_PLUS \
+ { 0x7baec70b, 0x57e0, 0x4c76, 0x8e, 0x87, 0x2f, 0x9e, 0x28, 0x08, 0x83, 0x43 }
+
+#define DEVICE_PATH_MESSAGING_VT_UTF8 \
+ { 0xad15a0d6, 0x8bec, 0x4acf, 0xa0, 0x73, 0xd0, 0x1d, 0xe7, 0x7e, 0x2d, 0x88 }
#define MEDIA_DEVICE_PATH 0x04
@@ -362,6 +393,7 @@
UNKNOWN_DEVICE_VENDOR_DEVICE_PATH *UnknownVendor;
CONTROLLER_DEVICE_PATH *Controller;
ACPI_HID_DEVICE_PATH *Acpi;
+ ACPI_EXTENDED_HID_DEVICE_PATH *ExtendedAcpi;
ATAPI_DEVICE_PATH *Atapi;
SCSI_DEVICE_PATH *Scsi;
Index: efipxebc.h
===================================================================
RCS file: /home/cvs/src/sys/boot/efi/include/efipxebc.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/boot/efi/include/efipxebc.h -L sys/boot/efi/include/efipxebc.h -u -r1.1.1.1 -r1.2
--- sys/boot/efi/include/efipxebc.h
+++ sys/boot/efi/include/efipxebc.h
@@ -1,10 +1,17 @@
-/* $FreeBSD: src/sys/boot/efi/include/efipxebc.h,v 1.2 2002/05/19 03:17:20 marcel Exp $ */
+/* $FreeBSD: src/sys/boot/efi/include/efipxebc.h,v 1.3 2006/11/02 02:42:47 marcel Exp $ */
#ifndef _EFIPXEBC_H
#define _EFIPXEBC_H
/*++
-Copyright (c) 1998 Intel Corporation
+Copyright (c) 1999 - 2002 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:
@@ -20,21 +27,20 @@
--*/
-/*
- * PXE Base Code protocol
- */
+//
+// PXE Base Code protocol
+//
#define EFI_PXE_BASE_CODE_PROTOCOL \
{ 0x03c4e603, 0xac28, 0x11d3, 0x9a, 0x2d, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d }
INTERFACE_DECL(_EFI_PXE_BASE_CODE);
-#define DEFAULT_TTL 4
+#define DEFAULT_TTL 8
#define DEFAULT_ToS 0
-
-/*
- * Address definitions
- */
+//
+// Address definitions
+//
typedef union {
UINT32 Addr[4];
@@ -44,9 +50,9 @@
typedef UINT16 EFI_PXE_BASE_CODE_UDP_PORT;
-/*
- * Packet definitions
- */
+//
+// Packet definitions
+//
typedef struct {
UINT8 BootpOpcode;
@@ -67,9 +73,15 @@
UINT8 DhcpOptions[56];
} EFI_PXE_BASE_CODE_DHCPV4_PACKET;
+// TBD in EFI v1.1
+//typedef struct {
+// UINT8 reserved;
+//} EFI_PXE_BASE_CODE_DHCPV6_PACKET;
+
typedef union {
UINT8 Raw[1472];
EFI_PXE_BASE_CODE_DHCPV4_PACKET Dhcpv4;
+// EFI_PXE_BASE_CODE_DHCPV6_PACKET Dhcpv6;
} EFI_PXE_BASE_CODE_PACKET;
typedef struct {
@@ -93,9 +105,9 @@
CHAR8 ErrorString[127];
} EFI_PXE_BASE_CODE_TFTP_ERROR;
-/*
- * IP Receive Filter definitions
- */
+//
+// IP Receive Filter definitions
+//
#define EFI_PXE_BASE_CODE_MAX_IPCNT 8
typedef struct {
UINT8 Filters;
@@ -109,9 +121,9 @@
#define EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS 0x0004
#define EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS_MULTICAST 0x0008
-/*
- * ARP Cache definitions
- */
+//
+// ARP Cache definitions
+//
typedef struct {
EFI_IP_ADDRESS IpAddr;
@@ -124,9 +136,9 @@
EFI_IP_ADDRESS GwAddr;
} EFI_PXE_BASE_CODE_ROUTE_ENTRY;
-/*
- * UDP definitions
- */
+//
+// UDP definitions
+//
#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_IP 0x0001
#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_PORT 0x0002
@@ -135,9 +147,9 @@
#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_USE_FILTER 0x0010
#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_MAY_FRAGMENT 0x0020
-/*
- * Discover() definitions
- */
+//
+// Discover() definitions
+//
#define EFI_PXE_BASE_CODE_BOOT_TYPE_BOOTSTRAP 0
#define EFI_PXE_BASE_CODE_BOOT_TYPE_MS_WINNT_RIS 1
@@ -156,15 +168,16 @@
#define EFI_PXE_BASE_CODE_BOOT_TYPE_REDHAT_BOOT 14
#define EFI_PXE_BASE_CODE_BOOT_TYPE_REMBO 15
#define EFI_PXE_BASE_CODE_BOOT_TYPE_BEOBOOT 16
-/*
- * 17 through 32767 are reserved
- * 32768 through 65279 are for vendor use
- * 65280 through 65534 are reserved
- */
+//
+// 17 through 32767 are reserved
+// 32768 through 65279 are for vendor use
+// 65280 through 65534 are reserved
+//
#define EFI_PXE_BASE_CODE_BOOT_TYPE_PXETEST 65535
#define EFI_PXE_BASE_CODE_BOOT_LAYER_MASK 0x7FFF
#define EFI_PXE_BASE_CODE_BOOT_LAYER_INITIAL 0x0000
+#define EFI_PXE_BASE_CODE_BOOT_LAYER_CREDENTIALS 0x8000
typedef struct {
@@ -184,9 +197,9 @@
EFI_PXE_BASE_CODE_SRVLIST SrvList[1];
} EFI_PXE_BASE_CODE_DISCOVER_INFO;
-/*
- * Mtftp() definitions
- */
+//
+// Mtftp() definitions
+//
typedef enum {
EFI_PXE_BASE_CODE_TFTP_FIRST,
@@ -208,9 +221,9 @@
UINT16 TransmitTimeout;
} EFI_PXE_BASE_CODE_MTFTP_INFO;
-/*
- * PXE Base Code Mode structure
- */
+//
+// PXE Base Code Mode structure
+//
#define EFI_PXE_BASE_CODE_MAX_ARP_ENTRIES 8
#define EFI_PXE_BASE_CODE_MAX_ROUTE_ENTRIES 8
@@ -252,9 +265,9 @@
EFI_PXE_BASE_CODE_TFTP_ERROR TftpError;
} EFI_PXE_BASE_CODE_MODE;
-/*
- * PXE Base Code Interface Function definitions
- */
+//
+// PXE Base Code Interface Function definitions
+//
typedef
EFI_STATUS
@@ -293,7 +306,7 @@
IN EFI_PXE_BASE_CODE_TFTP_OPCODE Operation,
IN OUT VOID *BufferPtr OPTIONAL,
IN BOOLEAN Overwrite,
- IN OUT UINTN *BufferSize,
+ IN OUT UINT64 *BufferSize,
IN UINTN *BlockSize OPTIONAL,
IN EFI_IP_ADDRESS *ServerIp,
IN UINT8 *Filename,
@@ -384,9 +397,9 @@
IN EFI_PXE_BASE_CODE_PACKET *NewPxeBisReply OPTIONAL
);
-/*
- * PXE Base Code Protocol structure
- */
+//
+// PXE Base Code Protocol structure
+//
#define EFI_PXE_BASE_CODE_INTERFACE_REVISION 0x00010000
@@ -407,16 +420,16 @@
EFI_PXE_BASE_CODE_MODE *Mode;
} EFI_PXE_BASE_CODE;
-/*
- * Call Back Definitions
- */
+//
+// Call Back Definitions
+//
#define EFI_PXE_BASE_CODE_CALLBACK_PROTOCOL \
{ 0x245dca21, 0xfb7b, 0x11d3, 0x8f, 0x01, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
-/*
- * Revision Number
- */
+//
+// Revision Number
+//
#define EFI_PXE_BASE_CODE_CALLBACK_INTERFACE_REVISION 0x00010000
Index: efifs.h
===================================================================
RCS file: /home/cvs/src/sys/boot/efi/include/efifs.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/boot/efi/include/efifs.h -L sys/boot/efi/include/efifs.h -u -r1.1.1.1 -r1.2
--- sys/boot/efi/include/efifs.h
+++ sys/boot/efi/include/efifs.h
@@ -1,10 +1,17 @@
-/* $FreeBSD: src/sys/boot/efi/include/efifs.h,v 1.2 2002/05/19 03:17:20 marcel Exp $ */
+/* $FreeBSD: src/sys/boot/efi/include/efifs.h,v 1.3 2006/11/02 02:42:47 marcel Exp $ */
#ifndef _EFI_FS_H
#define _EFI_FS_H
/*++
-Copyright (c) 1998 Intel Corporation
+Copyright (c) 1999 - 2002 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:
@@ -21,9 +28,9 @@
--*/
-/*
- * EFI Partition header (normaly starts in LBA 1)
- */
+//
+// EFI Partition header (normaly starts in LBA 1)
+//
#define EFI_PARTITION_SIGNATURE 0x5053595320494249
#define EFI_PARTITION_REVISION 0x00010001
@@ -43,9 +50,9 @@
} EFI_PARTITION_HEADER;
-/*
- * File header
- */
+//
+// File header
+//
#define EFI_FILE_HEADER_SIGNATURE 0x454c494620494249
#define EFI_FILE_HEADER_REVISION 0x00010000
@@ -65,10 +72,10 @@
} EFI_FILE_HEADER;
-/*
- * Return the file's first LBAL which is in the same
- * logical block as the file header
- */
+//
+// Return the file's first LBAL which is in the same
+// logical block as the file header
+//
#define EFI_FILE_LBAL(a) ((EFI_LBAL *) (((CHAR8 *) (a)) + (a)->LBALOffset))
@@ -77,10 +84,10 @@
#define EFI_FILE_CLASS_NORMAL 3
-/*
- * Logical Block Address List - the fundemental block
- * description structure
- */
+//
+// Logical Block Address List - the fundemental block
+// description structure
+//
#define EFI_LBAL_SIGNATURE 0x4c41424c20494249
#define EFI_LBAL_REVISION 0x00010000
@@ -94,22 +101,22 @@
UINT32 ArrayCount;
} EFI_LBAL;
-/* Array size */
+// Array size
#define EFI_LBAL_ARRAY_SIZE(lbal,offs,blks) \
(((blks) - (offs) - (lbal)->Hdr.HeaderSize) / sizeof(EFI_RL))
-/*
- * Logical Block run-length
- */
+//
+// Logical Block run-length
+//
typedef struct {
EFI_LBA Start;
UINT64 Length;
} EFI_RL;
-/*
- * Return the run-length structure from an LBAL header
- */
+//
+// Return the run-length structure from an LBAL header
+//
#define EFI_LBAL_RL(a) ((EFI_RL*) (((CHAR8 *) (a)) + (a)->Hdr.HeaderSize))
Index: efi.h
===================================================================
RCS file: /home/cvs/src/sys/boot/efi/include/efi.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/boot/efi/include/efi.h -L sys/boot/efi/include/efi.h -u -r1.1.1.1 -r1.2
--- sys/boot/efi/include/efi.h
+++ sys/boot/efi/include/efi.h
@@ -1,7 +1,14 @@
-/* $FreeBSD: src/sys/boot/efi/include/efi.h,v 1.3 2002/05/19 03:17:20 marcel Exp $ */
+/* $FreeBSD: src/sys/boot/efi/include/efi.h,v 1.4 2006/11/02 02:42:47 marcel Exp $ */
/*++
-Copyright (c) 1998 Intel Corporation
+Copyright (c) 1999 - 2002 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:
@@ -17,19 +24,20 @@
--*/
-/*
- * Build flags on input
- * EFI32
- * EFI_DEBUG - Enable debugging code
- * EFI_NT_EMULATOR - Building for running under NT
- */
+//
+// Build flags on input
+// EFI32
+// EFI_DEBUG - Enable debugging code
+// EFI_NT_EMULATOR - Building for running under NT
+//
+
#ifndef _EFI_INCLUDE_
#define _EFI_INCLUDE_
#define EFI_FIRMWARE_VENDOR L"INTEL"
-#define EFI_FIRMWARE_MAJOR_REVISION 12
-#define EFI_FIRMWARE_MINOR_REVISION 33
+#define EFI_FIRMWARE_MAJOR_REVISION 14
+#define EFI_FIRMWARE_MINOR_REVISION 62
#define EFI_FIRMWARE_REVISION ((EFI_FIRMWARE_MAJOR_REVISION <<16) | (EFI_FIRMWARE_MINOR_REVISION))
#include "efibind.h"
@@ -43,7 +51,12 @@
#include "efinet.h"
#include "efiapi.h"
#include "efifs.h"
-#include "efifpswa.h"
#include "efierr.h"
+#define EFI_STRINGIZE(a) #a
+#define EFI_PROTOCOL_DEFINITION(a) EFI_STRINGIZE(Protocol/a/a.h)
+
+#define EFI_GUID_DEFINITION(a) EFI_STRINGIZE(Guid/a/a##.h)
+#define EFI_GUID_STRING(guidpointer, shortstring, longstring)
+
#endif
Index: efiser.h
===================================================================
RCS file: /home/cvs/src/sys/boot/efi/include/efiser.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/boot/efi/include/efiser.h -L sys/boot/efi/include/efiser.h -u -r1.1.1.1 -r1.2
--- sys/boot/efi/include/efiser.h
+++ sys/boot/efi/include/efiser.h
@@ -1,10 +1,17 @@
-/* $FreeBSD: src/sys/boot/efi/include/efiser.h,v 1.2 2002/05/19 03:17:21 marcel Exp $ */
+/* $FreeBSD: src/sys/boot/efi/include/efiser.h,v 1.3 2006/11/02 02:42:47 marcel Exp $ */
#ifndef _EFI_SER_H
#define _EFI_SER_H
/*++
-Copyright (c) 1998 Intel Corporation
+Copyright (c) 1999 - 2002 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:
@@ -18,9 +25,9 @@
--*/
-/*
- * Serial protocol
- */
+//
+// Serial protocol
+//
#define SERIAL_IO_PROTOCOL \
{ 0xBB25CF6F, 0xF1D4, 0x11D2, 0x9A, 0x0C, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0xFD }
@@ -37,23 +44,23 @@
} EFI_PARITY_TYPE;
typedef enum {
- DefaultStopBits,
- OneStopBit,
- OneFiveStopBits,
- TwoStopBits
+ DefaultStopBits,
+ OneStopBit, // 1 stop bit
+ OneFiveStopBits, // 1.5 stop bits
+ TwoStopBits // 2 stop bits
} EFI_STOP_BITS_TYPE;
-#define EFI_SERIAL_CLEAR_TO_SEND 0x0010
-#define EFI_SERIAL_DATA_SET_READY 0x0020
-#define EFI_SERIAL_RING_INDICATE 0x0040
-#define EFI_SERIAL_CARRIER_DETECT 0x0080
-#define EFI_SERIAL_REQUEST_TO_SEND 0x0002
-#define EFI_SERIAL_DATA_TERMINAL_READY 0x0001
-#define EFI_SERIAL_INPUT_BUFFER_EMPTY 0x0100
-#define EFI_SERIAL_OUTPUT_BUFFER_EMPTY 0x0200
-#define EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE 0x1000
-#define EFI_SERIAL_SOFTWARE_LOOPBACK_ENABLE 0x2000
-#define EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE 0x4000
+#define EFI_SERIAL_CLEAR_TO_SEND 0x0010 // RO
+#define EFI_SERIAL_DATA_SET_READY 0x0020 // RO
+#define EFI_SERIAL_RING_INDICATE 0x0040 // RO
+#define EFI_SERIAL_CARRIER_DETECT 0x0080 // RO
+#define EFI_SERIAL_REQUEST_TO_SEND 0x0002 // WO
+#define EFI_SERIAL_DATA_TERMINAL_READY 0x0001 // WO
+#define EFI_SERIAL_INPUT_BUFFER_EMPTY 0x0100 // RO
+#define EFI_SERIAL_OUTPUT_BUFFER_EMPTY 0x0200 // RO
+#define EFI_SERIAL_HARDWARE_LOOPBACK_ENABLE 0x1000 // RW
+#define EFI_SERIAL_SOFTWARE_LOOPBACK_ENABLE 0x2000 // RW
+#define EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE 0x4000 // RW
typedef
EFI_STATUS
@@ -106,7 +113,7 @@
typedef struct {
UINT32 ControlMask;
- /* current Attributes. */
+ // current Attributes
UINT32 Timeout;
UINT64 BaudRate;
UINT32 ReceiveFifoDepth;
Index: efilib.h
===================================================================
RCS file: /home/cvs/src/sys/boot/efi/include/efilib.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/boot/efi/include/efilib.h -L sys/boot/efi/include/efilib.h -u -r1.1.1.1 -r1.2
--- sys/boot/efi/include/efilib.h
+++ sys/boot/efi/include/efilib.h
@@ -1,5 +1,6 @@
/*-
* Copyright (c) 2000 Doug Rabson
+ * Copyright (c) 2006 Marcel Moolenaar
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -23,18 +24,31 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/boot/efi/include/efilib.h,v 1.4 2004/11/28 00:30:22 marcel Exp $
+ * $FreeBSD: src/sys/boot/efi/include/efilib.h,v 1.6 2006/11/05 22:03:02 marcel Exp $
*/
+#include <stand.h>
+
extern EFI_HANDLE IH;
extern EFI_SYSTEM_TABLE *ST;
extern EFI_BOOT_SERVICES *BS;
extern EFI_RUNTIME_SERVICES *RS;
+extern struct devsw efifs_dev;
+extern struct fs_ops efifs_fsops;
+
+extern struct devsw efinet_dev;
+extern struct netif_driver efinetif;
+
void *efi_get_table(EFI_GUID *tbl);
void efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *system_table);
-EFI_PHYSICAL_ADDRESS efimd_va2pa(EFI_VIRTUAL_ADDRESS);
+int efi_register_handles(struct devsw *, EFI_HANDLE *, int);
+EFI_HANDLE efi_find_handle(struct devsw *, int);
+int efi_handle_lookup(EFI_HANDLE, struct devsw **, int *);
+
+int efi_status_to_errno(EFI_STATUS);
+time_t efi_time(EFI_TIME *);
EFI_STATUS main(int argc, CHAR16 *argv[]);
void exit(EFI_STATUS status);
Index: efiapi.h
===================================================================
RCS file: /home/cvs/src/sys/boot/efi/include/efiapi.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/boot/efi/include/efiapi.h -L sys/boot/efi/include/efiapi.h -u -r1.1.1.1 -r1.2
--- sys/boot/efi/include/efiapi.h
+++ sys/boot/efi/include/efiapi.h
@@ -1,10 +1,17 @@
-/* $FreeBSD: src/sys/boot/efi/include/efiapi.h,v 1.6 2003/12/10 19:08:09 jhb Exp $ */
+/* $FreeBSD: src/sys/boot/efi/include/efiapi.h,v 1.7 2006/11/02 02:42:47 marcel Exp $ */
#ifndef _EFI_API_H
#define _EFI_API_H
/*++
-Copyright (c) 1998 Intel Corporation
+Copyright (c) 1999 - 2002 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:
@@ -21,22 +28,22 @@
--*/
-/*
- * EFI Specification Revision
- */
+//
+// EFI Specification Revision
+//
#define EFI_SPECIFICATION_MAJOR_REVISION 1
-#define EFI_SPECIFICATION_MINOR_REVISION 02
+#define EFI_SPECIFICATION_MINOR_REVISION 10
-/*
- * Declare forward referenced data structures
- */
+//
+// Declare forward referenced data structures
+//
INTERFACE_DECL(_EFI_SYSTEM_TABLE);
-/*
- * EFI Memory
- */
+//
+// EFI Memory
+//
typedef
EFI_STATUS
@@ -92,8 +99,8 @@
#define EFI_OPTIONAL_PTR 0x00000001
-#define EFI_INTERNAL_FNC 0x00000002 /* Pointer to internal runtime fnc */
-#define EFI_INTERNAL_PTR 0x00000004 /* Pointer to internal runtime data */
+#define EFI_INTERNAL_FNC 0x00000002 // Pointer to internal runtime fnc
+#define EFI_INTERNAL_PTR 0x00000004 // Pointer to internal runtime data
typedef
@@ -104,9 +111,9 @@
);
-/*
- * EFI Events
- */
+//
+// EFI Events
+//
@@ -181,9 +188,9 @@
IN EFI_EVENT Event
);
-/*
- * Task priority level
- */
+//
+// Task priority level
+//
#define TPL_APPLICATION 4
#define TPL_CALLBACK 8
@@ -203,19 +210,19 @@
);
-/*
- * EFI platform variables
- */
+//
+// EFI platform varibles
+//
#define EFI_GLOBAL_VARIABLE \
{ 0x8BE4DF61, 0x93CA, 0x11d2, 0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C }
-/* Variable attributes */
+// Variable attributes
#define EFI_VARIABLE_NON_VOLATILE 0x00000001
#define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002
#define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004
-/* Variable size limitation */
+// Variable size limitation
#define EFI_MAXIMUM_VARIABLE_SIZE 1024
typedef
@@ -248,14 +255,14 @@
);
-/*
- * EFI Time
- */
+//
+// EFI Time
+//
typedef struct {
- UINT32 Resolution; /* 1e-6 parts per million */
- UINT32 Accuracy; /* hertz */
- BOOLEAN SetsToZero; /* Set clears sub-second time */
+ UINT32 Resolution; // 1e-6 parts per million
+ UINT32 Accuracy; // hertz
+ BOOLEAN SetsToZero; // Set clears sub-second time
} EFI_TIME_CAPABILITIES;
@@ -288,12 +295,12 @@
);
-/*
- * Image functions
- */
+//
+// Image functions
+//
-/* PE32+ Subsystem type for EFI images */
+// PE32+ Subsystem type for EFI images
#if !defined(IMAGE_SUBSYSTEM_EFI_APPLICATION)
#define IMAGE_SUBSYSTEM_EFI_APPLICATION 10
@@ -301,7 +308,7 @@
#define IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER 12
#endif
-/* PE32+ Machine type for EFI images */
+// PE32+ Machine type for EFI images
#if !defined(EFI_IMAGE_MACHINE_IA32)
#define EFI_IMAGE_MACHINE_IA32 0x014c
@@ -311,7 +318,11 @@
#define EFI_IMAGE_MACHINE_IA64 0x0200
#endif
-/* Image Entry prototype */
+#if !defined(EFI_IMAGE_MACHINE_EBC)
+#define EFI_IMAGE_MACHINE_EBC 0x0EBC
+#endif
+
+// Image Entry prototype
typedef
EFI_STATUS
@@ -355,32 +366,32 @@
);
-/* Image handle */
+// Image handle
#define LOADED_IMAGE_PROTOCOL \
{ 0x5B1B31A1, 0x9562, 0x11d2, 0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }
-#define EFI_IMAGE_INFORMATION_REVISION 0x1000
+#define EFI_LOADED_IMAGE_INFORMATION_REVISION 0x1000
typedef struct {
UINT32 Revision;
EFI_HANDLE ParentHandle;
struct _EFI_SYSTEM_TABLE *SystemTable;
- /* Source location of image */
+ // Source location of image
EFI_HANDLE DeviceHandle;
EFI_DEVICE_PATH *FilePath;
VOID *Reserved;
- /* Images load options */
+ // Images load options
UINT32 LoadOptionsSize;
VOID *LoadOptions;
- /* Location of where image was loaded */
+ // Location of where image was loaded
VOID *ImageBase;
UINT64 ImageSize;
EFI_MEMORY_TYPE ImageCodeType;
EFI_MEMORY_TYPE ImageDataType;
- /* If the driver image supports a dynamic unload request */
+ // If the driver image supports a dynamic unload request
EFI_IMAGE_UNLOAD Unload;
} EFI_LOADED_IMAGE;
@@ -393,9 +404,9 @@
IN UINTN MapKey
);
-/*
- * Misc
- */
+//
+// Misc
+//
typedef
@@ -416,11 +427,12 @@
typedef enum {
EfiResetCold,
- EfiResetWarm
+ EfiResetWarm,
+ EfiResetShutdown
} EFI_RESET_TYPE;
typedef
-EFI_STATUS
+VOID
(EFIAPI *EFI_RESET_SYSTEM) (
IN EFI_RESET_TYPE ResetType,
IN EFI_STATUS ResetStatus,
@@ -440,13 +452,12 @@
OUT UINT32 *HighCount
);
-/*
- * Protocol handler functions
- */
+//
+// Protocol handler functions
+//
typedef enum {
- EFI_NATIVE_INTERFACE,
- EFI_PCODE_INTERFACE
+ EFI_NATIVE_INTERFACE
} EFI_INTERFACE_TYPE;
typedef
@@ -525,179 +536,355 @@
typedef
EFI_STATUS
(EFIAPI *EFI_RESERVED_SERVICE) (
- VOID
);
-/*
- * Standard EFI table header
- */
-
-typedef struct _EFI_TABLE_HEARDER {
- UINT64 Signature;
- UINT32 Revision;
- UINT32 HeaderSize;
- UINT32 CRC32;
- UINT32 Reserved;
-} EFI_TABLE_HEADER;
-
-
-/*
- * EFI Runtime Serivces Table
- */
-
-#define EFI_RUNTIME_SERVICES_SIGNATURE 0x56524553544e5552
-#define EFI_RUNTIME_SERVICES_REVISION (EFI_SPECIFICATION_MAJOR_REVISION<<16) | (EFI_SPECIFICATION_MINOR_REVISION)
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CONNECT_CONTROLLER) (
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_HANDLE *DriverImageHandle OPTIONAL,
+ IN EFI_DEVICE_PATH *RemainingDevicePath OPTIONAL,
+ IN BOOLEAN Recursive
+ );
-typedef struct {
- EFI_TABLE_HEADER Hdr;
+typedef
+EFI_STATUS
+(EFIAPI *EFI_DISCONNECT_CONTROLLER)(
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_HANDLE DriverImageHandle, OPTIONAL
+ IN EFI_HANDLE ChildHandle OPTIONAL
+ );
+
+#define EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL 0x00000001
+#define EFI_OPEN_PROTOCOL_GET_PROTOCOL 0x00000002
+#define EFI_OPEN_PROTOCOL_TEST_PROTOCOL 0x00000004
+#define EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 0x00000008
+#define EFI_OPEN_PROTOCOL_BY_DRIVER 0x00000010
+#define EFI_OPEN_PROTOCOL_EXCLUSIVE 0x00000020
- /* Time services */
+typedef
+EFI_STATUS
+(EFIAPI *EFI_OPEN_PROTOCOL) (
+ IN EFI_HANDLE Handle,
+ IN EFI_GUID *Protocol,
+ OUT VOID **Interface,
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_HANDLE ControllerHandle, OPTIONAL
+ IN UINT32 Attributes
+ );
- EFI_GET_TIME GetTime;
- EFI_SET_TIME SetTime;
- EFI_GET_WAKEUP_TIME GetWakeupTime;
- EFI_SET_WAKEUP_TIME SetWakeupTime;
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CLOSE_PROTOCOL) (
+ IN EFI_HANDLE Handle,
+ IN EFI_GUID *Protocol,
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_HANDLE DeviceHandle
+ );
- /* Virtual memory services */
+typedef struct {
+ EFI_HANDLE AgentHandle;
+ EFI_HANDLE ControllerHandle;
+ UINT32 Attributes;
+ UINT32 OpenCount;
+} EFI_OPEN_PROTOCOL_INFORMATION_ENTRY;
- EFI_SET_VIRTUAL_ADDRESS_MAP SetVirtualAddressMap;
- EFI_CONVERT_POINTER ConvertPointer;
+typedef
+EFI_STATUS
+(EFIAPI *EFI_OPEN_PROTOCOL_INFORMATION) (
+ IN EFI_HANDLE UserHandle,
+ IN EFI_GUID *Protocol,
+ IN EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer,
+ OUT UINTN *EntryCount
+ );
- /* Variable serviers */
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PROTOCOLS_PER_HANDLE) (
+ IN EFI_HANDLE UserHandle,
+ OUT EFI_GUID ***ProtocolBuffer,
+ OUT UINTN *ProtocolBufferCount
+ );
- EFI_GET_VARIABLE GetVariable;
- EFI_GET_NEXT_VARIABLE_NAME GetNextVariableName;
- EFI_SET_VARIABLE SetVariable;
+typedef
+EFI_STATUS
+(EFIAPI *EFI_LOCATE_HANDLE_BUFFER) (
+ IN EFI_LOCATE_SEARCH_TYPE SearchType,
+ IN EFI_GUID *Protocol OPTIONAL,
+ IN VOID *SearchKey OPTIONAL,
+ IN OUT UINTN *NumberHandles,
+ OUT EFI_HANDLE **Buffer
+ );
- /* Misc */
+typedef
+EFI_STATUS
+(EFIAPI *EFI_LOCATE_PROTOCOL) (
+ EFI_GUID *Protocol,
+ VOID *Registration, OPTIONAL
+ VOID **Interface
+ );
- EFI_GET_NEXT_HIGH_MONO_COUNT GetNextHighMonotonicCount;
- EFI_RESET_SYSTEM ResetSystem;
+typedef
+EFI_STATUS
+(EFIAPI *EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES) (
+ IN OUT EFI_HANDLE *Handle,
+ ...
+ );
-} EFI_RUNTIME_SERVICES;
+typedef
+EFI_STATUS
+(EFIAPI *EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES) (
+ IN EFI_HANDLE Handle,
+ ...
+ );
+typedef
+EFI_STATUS
+(EFIAPI *EFI_CALCULATE_CRC32) (
+ IN VOID *Data,
+ IN UINTN DataSize,
+ OUT UINT32 *Crc32
+ );
-/*
- * EFI Boot Services Table
- */
+typedef
+VOID
+(EFIAPI *EFI_COPY_MEM) (
+ IN VOID *Destination,
+ IN VOID *Source,
+ IN UINTN Length
+ );
-#define EFI_BOOT_SERVICES_SIGNATURE 0x56524553544f4f42
-#define EFI_BOOT_SERVICES_REVISION (EFI_SPECIFICATION_MAJOR_REVISION<<16) | (EFI_SPECIFICATION_MINOR_REVISION)
+typedef
+VOID
+(EFIAPI *EFI_SET_MEM) (
+ IN VOID *Buffer,
+ IN UINTN Size,
+ IN UINT8 Value
+ );
+
+//
+// Standard EFI table header
+//
-typedef struct _EFI_BOOT_SERVICES {
+typedef struct _EFI_TABLE_HEARDER {
+ UINT64 Signature;
+ UINT32 Revision;
+ UINT32 HeaderSize;
+ UINT32 CRC32;
+ UINT32 Reserved;
+} EFI_TABLE_HEADER;
- EFI_TABLE_HEADER Hdr;
- /* Task priority functions */
+//
+// EFI Runtime Serivces Table
+//
- EFI_RAISE_TPL RaiseTPL;
- EFI_RESTORE_TPL RestoreTPL;
+#define EFI_RUNTIME_SERVICES_SIGNATURE 0x56524553544e5552
+#define EFI_RUNTIME_SERVICES_REVISION ((EFI_SPECIFICATION_MAJOR_REVISION<<16) | (EFI_SPECIFICATION_MINOR_REVISION))
- /* Memory functions */
+typedef struct {
+ EFI_TABLE_HEADER Hdr;
- EFI_ALLOCATE_PAGES AllocatePages;
- EFI_FREE_PAGES FreePages;
- EFI_GET_MEMORY_MAP GetMemoryMap;
- EFI_ALLOCATE_POOL AllocatePool;
- EFI_FREE_POOL FreePool;
+ //
+ // Time services
+ //
+
+ EFI_GET_TIME GetTime;
+ EFI_SET_TIME SetTime;
+ EFI_GET_WAKEUP_TIME GetWakeupTime;
+ EFI_SET_WAKEUP_TIME SetWakeupTime;
+
+ //
+ // Virtual memory services
+ //
+
+ EFI_SET_VIRTUAL_ADDRESS_MAP SetVirtualAddressMap;
+ EFI_CONVERT_POINTER ConvertPointer;
+
+ //
+ // Variable serviers
+ //
+
+ EFI_GET_VARIABLE GetVariable;
+ EFI_GET_NEXT_VARIABLE_NAME GetNextVariableName;
+ EFI_SET_VARIABLE SetVariable;
+
+ //
+ // Misc
+ //
- /* Event & timer functions */
+ EFI_GET_NEXT_HIGH_MONO_COUNT GetNextHighMonotonicCount;
+ EFI_RESET_SYSTEM ResetSystem;
- EFI_CREATE_EVENT CreateEvent;
- EFI_SET_TIMER SetTimer;
- EFI_WAIT_FOR_EVENT WaitForEvent;
- EFI_SIGNAL_EVENT SignalEvent;
- EFI_CLOSE_EVENT CloseEvent;
- EFI_CHECK_EVENT CheckEvent;
+} EFI_RUNTIME_SERVICES;
- /* Protocol handler functions */
- EFI_INSTALL_PROTOCOL_INTERFACE InstallProtocolInterface;
- EFI_REINSTALL_PROTOCOL_INTERFACE ReinstallProtocolInterface;
- EFI_UNINSTALL_PROTOCOL_INTERFACE UninstallProtocolInterface;
- EFI_HANDLE_PROTOCOL HandleProtocol;
- EFI_HANDLE_PROTOCOL PCHandleProtocol;
- EFI_REGISTER_PROTOCOL_NOTIFY RegisterProtocolNotify;
- EFI_LOCATE_HANDLE LocateHandle;
- EFI_LOCATE_DEVICE_PATH LocateDevicePath;
- EFI_INSTALL_CONFIGURATION_TABLE InstallConfigurationTable;
+//
+// EFI Boot Services Table
+//
- /* Image functions */
+#define EFI_BOOT_SERVICES_SIGNATURE 0x56524553544f4f42
+#define EFI_BOOT_SERVICES_REVISION ((EFI_SPECIFICATION_MAJOR_REVISION<<16) | (EFI_SPECIFICATION_MINOR_REVISION))
- EFI_IMAGE_LOAD LoadImage;
- EFI_IMAGE_START StartImage;
- EFI_EXIT Exit;
- EFI_IMAGE_UNLOAD UnloadImage;
- EFI_EXIT_BOOT_SERVICES ExitBootServices;
+typedef struct {
- /* Misc functions */
+ EFI_TABLE_HEADER Hdr;
- EFI_GET_NEXT_MONOTONIC_COUNT GetNextMonotonicCount;
- EFI_STALL Stall;
- EFI_SET_WATCHDOG_TIMER SetWatchdogTimer;
+ //
+ // Task priority functions
+ //
+
+ EFI_RAISE_TPL RaiseTPL;
+ EFI_RESTORE_TPL RestoreTPL;
+
+ //
+ // Memory functions
+ //
+
+ EFI_ALLOCATE_PAGES AllocatePages;
+ EFI_FREE_PAGES FreePages;
+ EFI_GET_MEMORY_MAP GetMemoryMap;
+ EFI_ALLOCATE_POOL AllocatePool;
+ EFI_FREE_POOL FreePool;
+
+ //
+ // Event & timer functions
+ //
+
+ EFI_CREATE_EVENT CreateEvent;
+ EFI_SET_TIMER SetTimer;
+ EFI_WAIT_FOR_EVENT WaitForEvent;
+ EFI_SIGNAL_EVENT SignalEvent;
+ EFI_CLOSE_EVENT CloseEvent;
+ EFI_CHECK_EVENT CheckEvent;
+
+ //
+ // Protocol handler functions
+ //
+
+ EFI_INSTALL_PROTOCOL_INTERFACE InstallProtocolInterface;
+ EFI_REINSTALL_PROTOCOL_INTERFACE ReinstallProtocolInterface;
+ EFI_UNINSTALL_PROTOCOL_INTERFACE UninstallProtocolInterface;
+ EFI_HANDLE_PROTOCOL HandleProtocol;
+ VOID *Reserved;
+ EFI_REGISTER_PROTOCOL_NOTIFY RegisterProtocolNotify;
+ EFI_LOCATE_HANDLE LocateHandle;
+ EFI_LOCATE_DEVICE_PATH LocateDevicePath;
+ EFI_INSTALL_CONFIGURATION_TABLE InstallConfigurationTable;
+
+ //
+ // Image functions
+ //
+
+ EFI_IMAGE_LOAD LoadImage;
+ EFI_IMAGE_START StartImage;
+ EFI_EXIT Exit;
+ EFI_IMAGE_UNLOAD UnloadImage;
+ EFI_EXIT_BOOT_SERVICES ExitBootServices;
+
+ //
+ // Misc functions
+ //
+
+ EFI_GET_NEXT_MONOTONIC_COUNT GetNextMonotonicCount;
+ EFI_STALL Stall;
+ EFI_SET_WATCHDOG_TIMER SetWatchdogTimer;
+
+ //
+ // DriverSupport Services
+ //
+ EFI_CONNECT_CONTROLLER ConnectController;
+ EFI_DISCONNECT_CONTROLLER DisconnectController;
+
+ //
+ // Open and Close Protocol Services
+ //
+ EFI_OPEN_PROTOCOL OpenProtocol;
+ EFI_CLOSE_PROTOCOL CloseProtocol;
+ EFI_OPEN_PROTOCOL_INFORMATION OpenProtocolInformation;
+
+ //
+ // Library Services to reduce size of drivers
+ //
+ EFI_PROTOCOLS_PER_HANDLE ProtocolsPerHandle;
+ EFI_LOCATE_HANDLE_BUFFER LocateHandleBuffer;
+ EFI_LOCATE_PROTOCOL LocateProtocol;
+
+ EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES InstallMultipleProtocolInterfaces;
+ EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES UninstallMultipleProtocolInterfaces;
+
+ //
+ // CRC32 services
+ //
+ EFI_CALCULATE_CRC32 CalculateCrc32;
+
+ //
+ // Memory Utility Services
+ //
+ EFI_COPY_MEM CopyMem;
+ EFI_SET_MEM SetMem;
} EFI_BOOT_SERVICES;
-/*
- * EFI Configuration Table and GUID definitions
- */
+//
+// EFI Configuration Table and GUID definitions
+//
#define MPS_TABLE_GUID \
- { 0xeb9d2d2f, 0x2d88, 0x11d3, { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } }
+ { 0xeb9d2d2f, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d }
#define ACPI_TABLE_GUID \
- { 0xeb9d2d30, 0x2d88, 0x11d3, { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } }
+ { 0xeb9d2d30, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d }
#define ACPI_20_TABLE_GUID \
- { 0x8868e871, 0xe4f1, 0x11d3, { 0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } }
+ { 0x8868e871, 0xe4f1, 0x11d3, 0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 }
#define SMBIOS_TABLE_GUID \
- { 0xeb9d2d31, 0x2d88, 0x11d3, { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } }
+ { 0xeb9d2d31, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d }
#define SAL_SYSTEM_TABLE_GUID \
- { 0xeb9d2d32, 0x2d88, 0x11d3, { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } }
+ { 0xeb9d2d32, 0x2d88, 0x11d3, 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d }
-/* DIG64 Headless Console & Debug Port Table. */
-#define HCDP_TABLE_GUID \
- {0xf951938d,0x620b,0x42ef,{0x82,0x79,0xa8,0x4b,0x79,0x61,0x78,0x98}}
typedef struct _EFI_CONFIGURATION_TABLE {
- EFI_GUID VendorGuid;
- VOID *VendorTable;
+ EFI_GUID VendorGuid;
+ VOID *VendorTable;
} EFI_CONFIGURATION_TABLE;
-/*
- * EFI System Table
- */
+//
+// EFI System Table
+//
#define EFI_SYSTEM_TABLE_SIGNATURE 0x5453595320494249
-#define EFI_SYSTEM_TABLE_REVISION (EFI_SPECIFICATION_MAJOR_REVISION<<16) | (EFI_SPECIFICATION_MINOR_REVISION)
+#define EFI_SYSTEM_TABLE_REVISION ((EFI_SPECIFICATION_MAJOR_REVISION<<16) | (EFI_SPECIFICATION_MINOR_REVISION))
+#define EFI_1_10_SYSTEM_TABLE_REVISION ((1<<16) | 10)
+#define EFI_1_02_SYSTEM_TABLE_REVISION ((1<<16) | 02)
typedef struct _EFI_SYSTEM_TABLE {
- EFI_TABLE_HEADER Hdr;
+ EFI_TABLE_HEADER Hdr;
- CHAR16 *FirmwareVendor;
- UINT32 FirmwareRevision;
+ CHAR16 *FirmwareVendor;
+ UINT32 FirmwareRevision;
- EFI_HANDLE ConsoleInHandle;
- SIMPLE_INPUT_INTERFACE *ConIn;
+ EFI_HANDLE ConsoleInHandle;
+ SIMPLE_INPUT_INTERFACE *ConIn;
- EFI_HANDLE ConsoleOutHandle;
- SIMPLE_TEXT_OUTPUT_INTERFACE *ConOut;
+ EFI_HANDLE ConsoleOutHandle;
+ SIMPLE_TEXT_OUTPUT_INTERFACE *ConOut;
- EFI_HANDLE StandardErrorHandle;
- SIMPLE_TEXT_OUTPUT_INTERFACE *StdErr;
+ EFI_HANDLE StandardErrorHandle;
+ SIMPLE_TEXT_OUTPUT_INTERFACE *StdErr;
- EFI_RUNTIME_SERVICES *RuntimeServices;
- EFI_BOOT_SERVICES *BootServices;
+ EFI_RUNTIME_SERVICES *RuntimeServices;
+ EFI_BOOT_SERVICES *BootServices;
- UINTN NumberOfTableEntries;
- EFI_CONFIGURATION_TABLE *ConfigurationTable;
+ UINTN NumberOfTableEntries;
+ EFI_CONFIGURATION_TABLE *ConfigurationTable;
} EFI_SYSTEM_TABLE;
Index: eficon.h
===================================================================
RCS file: /home/cvs/src/sys/boot/efi/include/eficon.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/boot/efi/include/eficon.h -L sys/boot/efi/include/eficon.h -u -r1.1.1.1 -r1.2
--- sys/boot/efi/include/eficon.h
+++ sys/boot/efi/include/eficon.h
@@ -1,10 +1,17 @@
-/* $FreeBSD: src/sys/boot/efi/include/eficon.h,v 1.2 2002/05/19 03:17:20 marcel Exp $ */
+/* $FreeBSD: src/sys/boot/efi/include/eficon.h,v 1.3 2006/11/02 02:42:47 marcel Exp $ */
#ifndef _EFI_CON_H
#define _EFI_CON_H
/*++
-Copyright (c) 1998 Intel Corporation
+Copyright (c) 1999 - 2002 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:
@@ -20,9 +27,9 @@
--*/
-/*
- * Text output protocol
- */
+//
+// Text output protocol
+//
#define SIMPLE_TEXT_OUTPUT_PROTOCOL \
{ 0x387477c2, 0x69c7, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
@@ -126,7 +133,7 @@
typedef struct {
INT32 MaxMode;
- /* current settings */
+ // current settings
INT32 Mode;
INT32 Attribute;
INT32 CursorColumn;
@@ -148,13 +155,13 @@
EFI_TEXT_SET_CURSOR_POSITION SetCursorPosition;
EFI_TEXT_ENABLE_CURSOR EnableCursor;
- /* Current mode */
+ // Current mode
SIMPLE_TEXT_OUTPUT_MODE *Mode;
} SIMPLE_TEXT_OUTPUT_INTERFACE;
-/*
- * Define's for required EFI Unicode Box Draw character
- */
+//
+// Define's for required EFI Unicode Box Draw character
+//
#define BOXDRAW_HORIZONTAL 0x2500
#define BOXDRAW_VERTICAL 0x2502
@@ -206,29 +213,31 @@
#define BOXDRAW_VERTICAL_DOUBLE_HORIZONTAL 0x256b
#define BOXDRAW_DOUBLE_VERTICAL_HORIZONTAL 0x256c
-/*
- * EFI Required Block Elements Code Chart
- */
+//
+// EFI Required Block Elements Code Chart
+//
+
#define BLOCKELEMENT_FULL_BLOCK 0x2588
#define BLOCKELEMENT_LIGHT_SHADE 0x2591
+//
+// EFI Required Geometric Shapes Code Chart
+//
-/*
- * EFI Required Geometric Shapes Code Chart
- */
#define GEOMETRICSHAPE_UP_TRIANGLE 0x25b2
#define GEOMETRICSHAPE_RIGHT_TRIANGLE 0x25ba
#define GEOMETRICSHAPE_DOWN_TRIANGLE 0x25bc
#define GEOMETRICSHAPE_LEFT_TRIANGLE 0x25c4
-/*
- * EFI Required Arrow shapes
- */
+//
+// EFI Required Arrow shapes
+//
+
#define ARROW_UP 0x2191
#define ARROW_DOWN 0x2193
-/*
- * Text input protocol
- */
+//
+// Text input protocol
+//
#define SIMPLE_TEXT_INPUT_PROTOCOL \
{ 0x387477c1, 0x69c7, 0x11d2, 0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b }
@@ -240,9 +249,9 @@
CHAR16 UnicodeChar;
} EFI_INPUT_KEY;
-/*
- * Baseline unicode control chars
- */
+//
+// Baseline unicode control chars
+//
#define CHAR_NULL 0x0000
#define CHAR_BACKSPACE 0x0008
@@ -250,9 +259,10 @@
#define CHAR_LINEFEED 0x000A
#define CHAR_CARRIAGE_RETURN 0x000D
-/*
- * Scan codes for base line keys
- */
+//
+// Scan codes for base line keys
+//
+
#define SCAN_NULL 0x0000
#define SCAN_UP 0x0001
#define SCAN_DOWN 0x0002
Index: efipart.h
===================================================================
RCS file: /home/cvs/src/sys/boot/efi/include/efipart.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/boot/efi/include/efipart.h -L sys/boot/efi/include/efipart.h -u -r1.1.1.1 -r1.2
--- sys/boot/efi/include/efipart.h
+++ sys/boot/efi/include/efipart.h
@@ -1,10 +1,17 @@
-/* $FreeBSD: src/sys/boot/efi/include/efipart.h,v 1.2 2002/05/19 03:17:20 marcel Exp $ */
+/* $FreeBSD: src/sys/boot/efi/include/efipart.h,v 1.3 2006/11/02 02:42:47 marcel Exp $ */
#ifndef _EFI_PART_H
#define _EFI_PART_H
/*++
-Copyright (c) 1998 Intel Corporation
+Copyright (c) 1999 - 2002 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:
@@ -20,6 +27,10 @@
--*/
+//
+//
+//
+
#define EFI_PARTITION 0xef
#define MBR_SIZE 512
@@ -42,7 +53,7 @@
#define MBR_SIGNATURE 0xaa55
#define MIN_MBR_DEVICE_SIZE 0x80000
-#define MBR_ERRATA_PAD 0x40000 /* 128 MB */
+#define MBR_ERRATA_PAD 0x40000 // 128 MB
#define MAX_MBR_PARTITIONS 4
typedef struct {
Index: efidebug.h
===================================================================
RCS file: /home/cvs/src/sys/boot/efi/include/efidebug.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/boot/efi/include/efidebug.h -L sys/boot/efi/include/efidebug.h -u -r1.1.1.1 -r1.2
--- sys/boot/efi/include/efidebug.h
+++ sys/boot/efi/include/efidebug.h
@@ -1,10 +1,17 @@
-/* $FreeBSD: src/sys/boot/efi/include/efidebug.h,v 1.2 2002/05/19 03:17:20 marcel Exp $ */
+/* $FreeBSD: src/sys/boot/efi/include/efidebug.h,v 1.3 2006/11/02 02:42:47 marcel Exp $ */
#ifndef _EFI_DEBUG_H
#define _EFI_DEBUG_H
/*++
-Copyright (c) 1998 Intel Corporation
+Copyright (c) 1999 - 2002 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:
@@ -44,32 +51,38 @@
#endif
-#define D_INIT 0x00000001 /* Initialization style messages */
-#define D_WARN 0x00000002 /* Warnings */
-#define D_LOAD 0x00000004 /* Load events */
-#define D_FS 0x00000008 /* EFI File system */
-#define D_POOL 0x00000010 /* Alloc & Free's */
-#define D_PAGE 0x00000020 /* Alloc & Free's */
-#define D_INFO 0x00000040 /* Verbose */
-#define D_VAR 0x00000100 /* Variable */
-#define D_PARSE 0x00000200 /* Command parsing */
-#define D_BM 0x00000400 /* Boot manager */
-#define D_BLKIO 0x00001000 /* BlkIo Driver */
-#define D_BLKIO_ULTRA 0x00002000 /* BlkIo Driver */
-#define D_NET 0x00004000 /* SNI Driver */
-#define D_NET_ULTRA 0x00008000 /* SNI Driver */
-#define D_TXTIN 0x00010000 /* Simple Input Driver */
-#define D_TXTOUT 0x00020000 /* Simple Text Output Driver */
-#define D_ERROR_ATA 0x00040000 /* ATA error messages */
-#define D_ERROR 0x80000000 /* Error */
-
-#define D_RESERVED 0x7fffC880 /* Bits not reserved above */
-
-/*
- * Current Debug level of the system, value of EFIDebug
- */
+#define D_INIT 0x00000001 // Initialization style messages
+#define D_WARN 0x00000002 // Warnings
+#define D_LOAD 0x00000004 // Load events
+#define D_FS 0x00000008 // EFI File system
+#define D_POOL 0x00000010 // Alloc & Free's
+#define D_PAGE 0x00000020 // Alloc & Free's
+#define D_INFO 0x00000040 // Verbose
+#define D_VARIABLE 0x00000100 // Variable
+#define D_VAR 0x00000100 // Variable
+#define D_BM 0x00000400 // Boot Manager
+#define D_BLKIO 0x00001000 // BlkIo Driver
+#define D_BLKIO_ULTRA 0x00002000 // BlkIo Driver
+#define D_NET 0x00004000 // SNI Driver
+#define D_NET_ULTRA 0x00008000 // SNI Driver
+#define D_UNDI 0x00010000 // UNDI Driver
+#define D_LOADFILE 0x00020000 // UNDI Driver
+#define D_EVENT 0x00080000 // Event messages
+
+#define D_ERROR 0x80000000 // Error
+
+#define D_RESERVED 0x7ff40A80 // Bits not reserved above
+
+//
+// Current Debug level of the system, value of EFIDebug
+//
+//#define EFI_DBUG_MASK (D_ERROR | D_WARN | D_LOAD | D_BLKIO | D_INIT)
#define EFI_DBUG_MASK (D_ERROR)
+//
+//
+//
+
#if EFI_DEBUG
#define ASSERT(a) if(!(a)) DBGASSERT(a)
@@ -84,9 +97,9 @@
#endif
-/*
- * Prototypes
- */
+//
+// Prototypes
+//
INTN
DbgAssert (
Index: efi_nii.h
===================================================================
RCS file: /home/cvs/src/sys/boot/efi/include/efi_nii.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/boot/efi/include/efi_nii.h -L sys/boot/efi/include/efi_nii.h -u -r1.1.1.1 -r1.2
--- sys/boot/efi/include/efi_nii.h
+++ sys/boot/efi/include/efi_nii.h
@@ -1,9 +1,16 @@
-/* $FreeBSD: src/sys/boot/efi/include/efi_nii.h,v 1.2 2002/05/19 03:17:20 marcel Exp $ */
+/* $FreeBSD: src/sys/boot/efi/include/efi_nii.h,v 1.3 2006/11/02 02:42:47 marcel Exp $ */
#ifndef _EFI_NII_H
#define _EFI_NII_H
/*++
-Copyright (c) 2000 Intel Corporation
+Copyright (c) 1999 - 2002 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:
efi_nii.h
@@ -20,8 +27,11 @@
#define EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL \
{ 0xE18541CD, 0xF755, 0x4f73, 0x92, 0x8D, 0x64, 0x3C, 0x8A, 0x79, 0xB2, 0x29 }
+#define EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_31 \
+ { 0x1ACED566, 0x76ED, 0x4218, 0xBC, 0x81, 0x76, 0x7F, 0x1F, 0x97, 0x7A, 0x89 }
#define EFI_NETWORK_INTERFACE_IDENTIFIER_INTERFACE_REVISION 0x00010000
+#define EFI_NETWORK_INTERFACE_IDENTIFIER_INTERFACE_REVISION_31 0x00010001
typedef enum {
EfiNetworkInterfaceUndi = 1
@@ -29,54 +39,48 @@
typedef struct {
- /* Revision of the network interface identifier protocol interface. */
UINT64 Revision;
+ // Revision of the network interface identifier protocol interface.
- /*
- * Address of the first byte of the identifying structure for this
- * network interface. This is set to zero if there is no structure.
- * For PXE/UNDI this is the first byte of the !PXE structure.
- */
UINT64 ID;
+ // Address of the first byte of the identifying structure for this
+ // network interface. This is set to zero if there is no structure.
+ //
+ // For PXE/UNDI this is the first byte of the !PXE structure.
- /*
- * Address of the UNrelocated driver/ROM image. This is set
- * to zero if there is no driver/ROM image.
- * For 16-bit UNDI, this is the first byte of the option ROM in
- * upper memory.
- * For 32/64-bit S/W UNDI, this is the first byte of the EFI ROM
- * image.
- * For H/W UNDI, this is set to zero.
- */
UINT64 ImageAddr;
+ // Address of the UNrelocated driver/ROM image. This is set
+ // to zero if there is no driver/ROM image.
+ //
+ // For 16-bit UNDI, this is the first byte of the option ROM in
+ // upper memory.
+ //
+ // For 32/64-bit S/W UNDI, this is the first byte of the EFI ROM
+ // image.
+ //
+ // For H/W UNDI, this is set to zero.
- /*
- * Size of the UNrelocated driver/ROM image of this network interface.
- * This is set to zero if there is no driver/ROM image.
- */
UINT32 ImageSize;
+ // Size of the UNrelocated driver/ROM image of this network interface.
+ // This is set to zero if there is no driver/ROM image.
- /*
- * 4 char ASCII string to go in class identifier (option 60) in DHCP
- * and Boot Server discover packets.
- * For EfiNetworkInterfaceUndi this field is "UNDI".
- * For EfiNetworkInterfaceSnp this field is "SNPN".
- */
CHAR8 StringId[4];
+ // 4 char ASCII string to go in class identifier (option 60) in DHCP
+ // and Boot Server discover packets.
+ // For EfiNetworkInterfaceUndi this field is "UNDI".
+ // For EfiNetworkInterfaceSnp this field is "SNPN".
- /*
- * Information to be placed into the PXE DHCP and Discover packets.
- * This is the network interface type and version number that will
- * be placed into DHCP option 94 (client network interface identifier).
- */
UINT8 Type;
UINT8 MajorVer;
UINT8 MinorVer;
-
+ // Information to be placed into the PXE DHCP and Discover packets.
+ // This is the network interface type and version number that will
+ // be placed into DHCP option 94 (client network interface identifier).
BOOLEAN Ipv6Supported;
- UINT8 IfNum; /* interface number to be used with pxeid structure */
+ UINT8 IfNum; // interface number to be used with pxeid structure
} EFI_NETWORK_INTERFACE_IDENTIFIER_INTERFACE;
extern EFI_GUID NetworkInterfaceIdentifierProtocol;
+extern EFI_GUID NetworkInterfaceIdentifierProtocol_31;
-#endif /* _EFI_NII_H */
+#endif // _EFI_NII_H
Index: efidef.h
===================================================================
RCS file: /home/cvs/src/sys/boot/efi/include/efidef.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/boot/efi/include/efidef.h -L sys/boot/efi/include/efidef.h -u -r1.1.1.1 -r1.2
--- sys/boot/efi/include/efidef.h
+++ sys/boot/efi/include/efidef.h
@@ -1,10 +1,17 @@
-/* $FreeBSD: src/sys/boot/efi/include/efidef.h,v 1.2 2002/05/19 03:17:20 marcel Exp $ */
+/* $FreeBSD: src/sys/boot/efi/include/efidef.h,v 1.3 2006/11/02 02:42:47 marcel Exp $ */
#ifndef _EFI_DEF_H
#define _EFI_DEF_H
/*++
-Copyright (c) 1998 Intel Corporation
+Copyright (c) 1999 - 2002 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:
@@ -41,14 +48,14 @@
typedef VOID *EFI_EVENT;
-/*
- * Prototype argument decoration for EFI parameters to indicate
- * their direction
- *
- * IN - argument is passed into the function
- * OUT - argument (pointer) is returned from the function
- * OPTIONAL - argument is optional
- */
+//
+// Prototype argument decoration for EFI parameters to indicate
+// their direction
+//
+// IN - argument is passed into the function
+// OUT - argument (pointer) is returned from the function
+// OPTIONAL - argument is optional
+//
#ifndef IN
#define IN
@@ -57,9 +64,9 @@
#endif
-/*
- * A GUID
- */
+//
+// A GUID
+//
typedef struct {
UINT32 Data1;
@@ -69,36 +76,36 @@
} EFI_GUID;
-/*
- * Time
- */
+//
+// Time
+//
typedef struct {
- UINT16 Year; /* 1998 - 20XX */
- UINT8 Month; /* 1 - 12 */
- UINT8 Day; /* 1 - 31 */
- UINT8 Hour; /* 0 - 23 */
- UINT8 Minute; /* 0 - 59 */
- UINT8 Second; /* 0 - 59 */
- UINT8 Pad1;
- UINT32 Nanosecond; /* 0 - 999,999,999 */
- INT16 TimeZone; /* -1440 to 1440 or 2047 */
- UINT8 Daylight;
- UINT8 Pad2;
+ UINT16 Year; // 1998 - 20XX
+ UINT8 Month; // 1 - 12
+ UINT8 Day; // 1 - 31
+ UINT8 Hour; // 0 - 23
+ UINT8 Minute; // 0 - 59
+ UINT8 Second; // 0 - 59
+ UINT8 Pad1;
+ UINT32 Nanosecond; // 0 - 999,999,999
+ INT16 TimeZone; // -1440 to 1440 or 2047
+ UINT8 Daylight;
+ UINT8 Pad2;
} EFI_TIME;
-/* Bit definitions for EFI_TIME.Daylight */
+// Bit definitions for EFI_TIME.Daylight
#define EFI_TIME_ADJUST_DAYLIGHT 0x01
#define EFI_TIME_IN_DAYLIGHT 0x02
-/* Value definition for EFI_TIME.TimeZone */
+// Value definition for EFI_TIME.TimeZone
#define EFI_UNSPECIFIED_TIMEZONE 0x07FF
-/*
- * Networking
- */
+//
+// Networking
+//
typedef struct {
UINT8 Addr[4];
@@ -112,9 +119,9 @@
UINT8 Addr[32];
} EFI_MAC_ADDRESS;
-/*
- * Memory
- */
+//
+// Memory
+//
typedef UINT64 EFI_PHYSICAL_ADDRESS;
typedef UINT64 EFI_VIRTUAL_ADDRESS;
@@ -126,13 +133,12 @@
MaxAllocateType
} EFI_ALLOCATE_TYPE;
-/*
- * Preseve the attr on any range supplied.
- * ConventialMemory must have WB,SR,SW when supplied.
- * When allocating from ConventialMemory always make it WB,SR,SW
- * When returning to ConventialMemory always make it WB,SR,SW
- * When getting the memory map, or on RT for runtime types
- */
+//Preseve the attr on any range supplied.
+//ConventialMemory must have WB,SR,SW when supplied.
+//When allocating from ConventialMemory always make it WB,SR,SW
+//When returning to ConventialMemory always make it WB,SR,SW
+//When getting the memory map, or on RT for runtime types
+
typedef enum {
EfiReservedMemoryType,
@@ -152,42 +158,46 @@
EfiMaxMemoryType
} EFI_MEMORY_TYPE;
-/* possible caching types for the memory range */
+// possible caching types for the memory range
#define EFI_MEMORY_UC 0x0000000000000001
#define EFI_MEMORY_WC 0x0000000000000002
#define EFI_MEMORY_WT 0x0000000000000004
#define EFI_MEMORY_WB 0x0000000000000008
#define EFI_MEMORY_UCE 0x0000000000000010
-/* physical memory protection on range */
+// physical memory protection on range
#define EFI_MEMORY_WP 0x0000000000001000
#define EFI_MEMORY_RP 0x0000000000002000
#define EFI_MEMORY_XP 0x0000000000004000
-/* range requires a runtime mapping */
+// range requires a runtime mapping
#define EFI_MEMORY_RUNTIME 0x8000000000000000
#define EFI_MEMORY_DESCRIPTOR_VERSION 1
typedef struct {
- UINT32 Type; /* 32 bit padding */
- EFI_PHYSICAL_ADDRESS PhysicalStart;
- EFI_VIRTUAL_ADDRESS VirtualStart;
- UINT64 NumberOfPages;
- UINT64 Attribute;
+ UINT32 Type; // Field size is 32 bits followed by 32 bit pad
+ EFI_PHYSICAL_ADDRESS PhysicalStart; // Field size is 64 bits
+ EFI_VIRTUAL_ADDRESS VirtualStart; // Field size is 64 bits
+ UINT64 NumberOfPages; // Field size is 64 bits
+ UINT64 Attribute; // Field size is 64 bits
} EFI_MEMORY_DESCRIPTOR;
-/*
- * International Language
- */
+//
+// International Language
+//
typedef UINT8 ISO_639_2;
#define ISO_639_2_ENTRY_SIZE 3
+//
+//
+//
+
#define EFI_PAGE_SIZE 4096
#define EFI_PAGE_MASK 0xFFF
#define EFI_PAGE_SHIFT 12
#define EFI_SIZE_TO_PAGES(a) \
- ( ((a) >> EFI_PAGE_SHIFT) + ((a) & EFI_PAGE_MASK ? 1 : 0) )
+ ( ((a) >> EFI_PAGE_SHIFT) + (((a) & EFI_PAGE_MASK) ? 1 : 0) )
#endif
Index: efistdarg.h
===================================================================
RCS file: /home/cvs/src/sys/boot/efi/include/efistdarg.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/boot/efi/include/efistdarg.h -L sys/boot/efi/include/efistdarg.h -u -r1.1.1.1 -r1.2
--- sys/boot/efi/include/efistdarg.h
+++ sys/boot/efi/include/efistdarg.h
@@ -1,10 +1,17 @@
-/* $FreeBSD: src/sys/boot/efi/include/efistdarg.h,v 1.1 2001/06/09 16:49:49 dfr Exp $ */
+/* $FreeBSD: src/sys/boot/efi/include/efistdarg.h,v 1.2 2006/11/02 02:42:47 marcel Exp $ */
#ifndef _EFISTDARG_H_
#define _EFISTDARG_H_
/*++
-Copyright (c) 1998 Intel Corporation
+Copyright (c) 1999 - 2002 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:
Index: pe.h
===================================================================
RCS file: /home/cvs/src/sys/boot/efi/include/i386/pe.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/boot/efi/include/i386/pe.h -L sys/boot/efi/include/i386/pe.h -u -r1.1.1.1 -r1.2
--- sys/boot/efi/include/i386/pe.h
+++ sys/boot/efi/include/i386/pe.h
@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/boot/efi/include/i386/pe.h,v 1.1 2001/06/09 16:49:50 dfr Exp $ */
+/* $FreeBSD: src/sys/boot/efi/include/i386/pe.h,v 1.2 2006/11/02 02:42:48 marcel Exp $ */
/*
PE32+ header file
*/
@@ -589,4 +589,43 @@
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
Index: efibind.h
===================================================================
RCS file: /home/cvs/src/sys/boot/efi/include/i386/efibind.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/boot/efi/include/i386/efibind.h -L sys/boot/efi/include/i386/efibind.h -u -r1.1.1.1 -r1.2
--- sys/boot/efi/include/i386/efibind.h
+++ sys/boot/efi/include/i386/efibind.h
@@ -1,7 +1,14 @@
-/* $FreeBSD: src/sys/boot/efi/include/i386/efibind.h,v 1.3 2005/03/07 15:38:37 stefanf Exp $ */
+/* $FreeBSD: src/sys/boot/efi/include/i386/efibind.h,v 1.4 2006/11/02 02:42:47 marcel Exp $ */
/*++
-Copyright (c) 1998 Intel Corporation
+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:
@@ -21,17 +28,20 @@
#pragma pack()
-/*
- * Basic int types of various widths
- */
+#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 */
+ // No ANSI C 1999/2000 stdint.h integer width declarations
#if _MSC_EXTENSIONS
-/* Use Microsoft C compiler integer width declarations */
+ // Use Microsoft C compiler integer width declarations
typedef unsigned __int64 uint64_t;
typedef __int64 int64_t;
@@ -44,7 +54,7 @@
#else
#ifdef UNIX_LP64
-/* Use LP64 programming model from C_FLAGS for integer width declarations */
+ // Use LP64 programming model from C_FLAGS for integer width declarations
typedef unsigned long uint64_t;
typedef long int64_t;
@@ -56,7 +66,7 @@
typedef char int8_t;
#else
-/* Assume P64 programming model from C_FLAGS for integer width declarations */
+ // Assume P64 programming model from C_FLAGS for integer width declarations
typedef unsigned long long uint64_t;
typedef long long int64_t;
@@ -69,10 +79,11 @@
#endif
#endif
#endif
+#endif /* __FreeBSD__ */
-/*
- * Basic EFI types of various widths
- */
+//
+// Basic EFI types of various widths
+//
typedef uint64_t UINT64;
typedef int64_t INT64;
@@ -113,15 +124,11 @@
#define BAD_POINTER 0xFBFBFBFB
#define MAX_ADDRESS 0xFFFFFFFF
-#ifdef EFI_NT_EMULATOR
- #define BREAKPOINT() __asm { int 3 }
-#else
- #define BREAKPOINT() while (TRUE);
-#endif
+#define BREAKPOINT() __asm { int 3 }
-/*
- * Pointers must be aligned to these address to function
- */
+//
+// Pointers must be aligned to these address to function
+//
#define MIN_ALIGNMENT_SIZE 4
@@ -132,108 +139,125 @@
Value = (UINTN)Value + (UINTN)Adjustment
-/*
- * Define macros to build data structure signatures from characters.
- */
+//
+// Define macros to build data structure signatures from characters.
+//
#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))
-/*
- * To export & import functions in the EFI emulator environment
- */
-
-#if EFI_NT_EMULATOR
- #define EXPORTAPI __declspec( dllexport )
-#else
- #define EXPORTAPI
-#endif
-
+//
+// 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
+//
-/*
- * 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
- */
-
-/* Forces EFI calling conventions reguardless of compiler options */
-#ifndef EFIAPI
+#ifndef EFIAPI // Forces EFI calling conventions reguardless of compiler options
#if _MSC_EXTENSIONS
- #define EFIAPI __cdecl
+ #define EFIAPI __cdecl // Force C calling convention for Microsoft C compiler
#else
- #define EFIAPI
+ #define EFIAPI // Substitute expresion to force C calling convention
#endif
#endif
#define BOOTSERVICE
+//#define RUNTIMESERVICE(proto,a) alloc_text("rtcode",a); proto a
+//#define RUNTIMEFUNCTION(proto,a) alloc_text("rtcode",a); proto a
#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 END_RUNTIME_DATA() data_seg()
#define VOLATILE volatile
#define MEMORY_FENCE()
+#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
+
#ifdef EFI_NT_EMULATOR
-/*
- * To help ensure proper coding of integrated drivers, they are
- * compiled as DLLs. In NT they require a dll init entry pointer.
- * The macro puts a stub entry point into the DLL so it will load.
- */
-
-#define EFI_DRIVER_ENTRY_POINT(InitFunction) \
- UINTN \
- __stdcall \
- _DllMainCRTStartup ( \
- UINTN Inst, \
- UINTN reason_for_call, \
- VOID *rserved \
- ) \
- { \
- return 1; \
- } \
- \
- int \
- EXPORTAPI \
- __cdecl \
- InitializeDriver ( \
- void *ImageHandle, \
- void *SystemTable \
- ) \
- { \
- return InitFunction(ImageHandle, SystemTable); \
+//
+// To help ensure proper coding of integrated drivers, they are
+// compiled as DLLs. In NT they require a dll init entry pointer.
+// The macro puts a stub entry point into the DLL so it will load.
+//
+
+#define EFI_DRIVER_ENTRY_POINT(InitFunction) \
+ EFI_STATUS \
+ InitFunction ( \
+ EFI_HANDLE ImageHandle, \
+ EFI_SYSTEM_TABLE *SystemTable \
+ ); \
+ \
+ UINTN \
+ __stdcall \
+ _DllMainCRTStartup ( \
+ UINTN Inst, \
+ UINTN reason_for_call, \
+ VOID *rserved \
+ ) \
+ { \
+ return 1; \
+ } \
+ \
+ int \
+ __declspec( dllexport ) \
+ __cdecl \
+ InitializeDriver ( \
+ void *ImageHandle, \
+ void *SystemTable \
+ ) \
+ { \
+ return InitFunction(ImageHandle, SystemTable); \
}
#define LOAD_INTERNAL_DRIVER(_if, type, name, entry) \
(_if)->LoadInternal(type, name, NULL)
-#else /* EFI_NT_EMULATOR */
+#else // EFI_NT_EMULATOR
-/*
- * When build similiar to FW, then link everything together as
- * one big module.
- */
+//
+// 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)
-#endif /* EFI_FW_NT */
+#endif // EFI_FW_NT
+#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 /* __FreeBSD__ */
#if _MSC_EXTENSIONS
-#pragma warning ( disable : 4731 )
+#pragma warning ( disable : 4731 ) // Suppress warnings about modification of EBP
#endif
Index: words.c
===================================================================
RCS file: /home/cvs/src/sys/boot/ficl/words.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -L sys/boot/ficl/words.c -L sys/boot/ficl/words.c -u -r1.1.1.2 -r1.2
--- sys/boot/ficl/words.c
+++ sys/boot/ficl/words.c
@@ -41,7 +41,7 @@
** SUCH DAMAGE.
*/
-/* $FreeBSD: src/sys/boot/ficl/words.c,v 1.39 2002/12/30 21:18:06 schweikh Exp $ */
+/* $FreeBSD: src/sys/boot/ficl/words.c,v 1.40 2007/03/23 22:26:01 jkim Exp $ */
#ifdef TESTMAIN
#include <stdlib.h>
@@ -71,6 +71,10 @@
static char destTag[] = "target";
static char origTag[] = "origin";
+static char caseTag[] = "case";
+static char ofTag[] = "of";
+static char fallthroughTag[] = "fallthrough";
+
#if FICL_WANT_LOCALS
static void doLocalIm(FICL_VM *pVM);
static void do2LocalIm(FICL_VM *pVM);
@@ -1220,34 +1224,26 @@
/**************************************************************************
- i f C o I m
-** IMMEDIATE
-** Compiles code for a conditional branch into the dictionary
-** and pushes the branch patch address on the stack for later
-** patching by ELSE or THEN/ENDIF.
+ b r a n c h P a r e n
+**
+** Runtime for "(branch)" -- expects a literal offset in the next
+** compilation address, and branches to that location.
**************************************************************************/
-static void ifCoIm(FICL_VM *pVM)
+static void branchParen(FICL_VM *pVM)
{
- FICL_DICT *dp = vmGetDict(pVM);
-
- assert(pVM->pSys->pIfParen);
-
- dictAppendCell(dp, LVALUEtoCELL(pVM->pSys->pIfParen));
- markBranch(dp, pVM, origTag);
- dictAppendUNS(dp, 1);
+ vmBranchRelative(pVM, (uintptr_t)*(pVM->ip));
return;
}
/**************************************************************************
- i f P a r e n
-** Runtime code to do "if" or "until": pop a flag from the stack,
-** fall through if true, branch if false. Probably ought to be
-** called (not?branch) since it does "branch if false".
+ b r a n c h 0
+** Runtime code for "(branch0)"; pop a flag from the stack,
+** branch if 0. fall through otherwise. The heart of "if" and "until".
**************************************************************************/
-static void ifParen(FICL_VM *pVM)
+static void branch0(FICL_VM *pVM)
{
FICL_UNS flag;
@@ -1270,9 +1266,31 @@
/**************************************************************************
+ i f C o I m
+** IMMEDIATE COMPILE-ONLY
+** Compiles code for a conditional branch into the dictionary
+** and pushes the branch patch address on the stack for later
+** patching by ELSE or THEN/ENDIF.
+**************************************************************************/
+
+static void ifCoIm(FICL_VM *pVM)
+{
+ FICL_DICT *dp = vmGetDict(pVM);
+
+ assert(pVM->pSys->pBranch0);
+
+ dictAppendCell(dp, LVALUEtoCELL(pVM->pSys->pBranch0));
+ markBranch(dp, pVM, origTag);
+ dictAppendUNS(dp, 1);
+ return;
+}
+
+
+/**************************************************************************
e l s e C o I m
**
-** IMMEDIATE -- compiles an "else"...
+** IMMEDIATE COMPILE-ONLY
+** compiles an "else"...
** 1) Compile a branch and a patch address; the address gets patched
** by "endif" to point past the "else" code.
** 2) Pop the the "if" patch address
@@ -1303,33 +1321,247 @@
/**************************************************************************
- b r a n c h P a r e n
-**
-** Runtime for "(branch)" -- expects a literal offset in the next
-** compilation address, and branches to that location.
+ e n d i f C o I m
+** IMMEDIATE COMPILE-ONLY
**************************************************************************/
-static void branchParen(FICL_VM *pVM)
+static void endifCoIm(FICL_VM *pVM)
{
- vmBranchRelative(pVM, (uintptr_t)*(pVM->ip));
+ FICL_DICT *dp = vmGetDict(pVM);
+ resolveForwardBranch(dp, pVM, origTag);
return;
}
/**************************************************************************
- e n d i f C o I m
-**
+ c a s e C o I m
+** IMMEDIATE COMPILE-ONLY
+**
+**
+** At compile-time, a CASE-SYS (see DPANS94 6.2.0873) looks like this:
+** i*addr i caseTag
+** and an OF-SYS (see DPANS94 6.2.1950) looks like this:
+** i*addr i caseTag addr ofTag
+** The integer under caseTag is the count of fixup addresses that branch
+** to ENDCASE.
**************************************************************************/
-static void endifCoIm(FICL_VM *pVM)
+static void caseCoIm(FICL_VM *pVM)
+{
+#if FICL_ROBUST > 1
+ vmCheckStack(pVM, 0, 2);
+#endif
+
+ PUSHUNS(0);
+ markControlTag(pVM, caseTag);
+ return;
+}
+
+
+/**************************************************************************
+ e n d c a s eC o I m
+** IMMEDIATE COMPILE-ONLY
+**************************************************************************/
+
+static void endcaseCoIm(FICL_VM *pVM)
+{
+ FICL_UNS fixupCount;
+ FICL_DICT *dp;
+ CELL *patchAddr;
+ FICL_INT offset;
+
+ assert(pVM->pSys->pDrop);
+
+ /*
+ ** if the last OF ended with FALLTHROUGH,
+ ** just add the FALLTHROUGH fixup to the
+ ** ENDOF fixups
+ */
+ if (stackGetTop(pVM->pStack).p == fallthroughTag)
+ {
+ matchControlTag(pVM, fallthroughTag);
+ patchAddr = POPPTR();
+ matchControlTag(pVM, caseTag);
+ fixupCount = POPUNS();
+ PUSHPTR(patchAddr);
+ PUSHUNS(fixupCount + 1);
+ markControlTag(pVM, caseTag);
+ }
+
+ matchControlTag(pVM, caseTag);
+
+#if FICL_ROBUST > 1
+ vmCheckStack(pVM, 1, 0);
+#endif
+ fixupCount = POPUNS();
+#if FICL_ROBUST > 1
+ vmCheckStack(pVM, fixupCount, 0);
+#endif
+
+ dp = vmGetDict(pVM);
+
+ dictAppendCell(dp, LVALUEtoCELL(pVM->pSys->pDrop));
+
+ while (fixupCount--)
+ {
+ patchAddr = (CELL *)stackPopPtr(pVM->pStack);
+ offset = dp->here - patchAddr;
+ *patchAddr = LVALUEtoCELL(offset);
+ }
+ return;
+}
+
+
+static void ofParen(FICL_VM *pVM)
+{
+ FICL_UNS a, b;
+
+#if FICL_ROBUST > 1
+ vmCheckStack(pVM, 2, 1);
+#endif
+
+ a = POPUNS();
+ b = stackGetTop(pVM->pStack).u;
+
+ if (a == b)
+ { /* fall through */
+ stackDrop(pVM->pStack, 1);
+ vmBranchRelative(pVM, 1);
+ }
+ else
+ { /* take branch to next of or endswitch */
+ vmBranchRelative(pVM, *(int *)(pVM->ip));
+ }
+
+ return;
+}
+
+
+/**************************************************************************
+ o f C o I m
+** IMMEDIATE COMPILE-ONLY
+**************************************************************************/
+
+static void ofCoIm(FICL_VM *pVM)
{
FICL_DICT *dp = vmGetDict(pVM);
- resolveForwardBranch(dp, pVM, origTag);
+ CELL *fallthroughFixup = NULL;
+
+ assert(pVM->pSys->pBranch0);
+
+#if FICL_ROBUST > 1
+ vmCheckStack(pVM, 1, 3);
+#endif
+
+ if (stackGetTop(pVM->pStack).p == fallthroughTag)
+ {
+ matchControlTag(pVM, fallthroughTag);
+ fallthroughFixup = POPPTR();
+ }
+
+ matchControlTag(pVM, caseTag);
+
+ markControlTag(pVM, caseTag);
+
+ dictAppendCell(dp, LVALUEtoCELL(pVM->pSys->pOfParen));
+ markBranch(dp, pVM, ofTag);
+ dictAppendUNS(dp, 2);
+
+ if (fallthroughFixup != NULL)
+ {
+ FICL_INT offset = dp->here - fallthroughFixup;
+ *fallthroughFixup = LVALUEtoCELL(offset);
+ }
+
return;
}
/**************************************************************************
+ e n d o f C o I m
+** IMMEDIATE COMPILE-ONLY
+**************************************************************************/
+
+static void endofCoIm(FICL_VM *pVM)
+{
+ CELL *patchAddr;
+ FICL_UNS fixupCount;
+ FICL_INT offset;
+ FICL_DICT *dp = vmGetDict(pVM);
+
+#if FICL_ROBUST > 1
+ vmCheckStack(pVM, 4, 3);
+#endif
+
+ assert(pVM->pSys->pBranchParen);
+
+ /* ensure we're in an OF, */
+ matchControlTag(pVM, ofTag);
+ /* grab the address of the branch location after the OF */
+ patchAddr = (CELL *)stackPopPtr(pVM->pStack);
+ /* ensure we're also in a "case" */
+ matchControlTag(pVM, caseTag);
+ /* grab the current number of ENDOF fixups */
+ fixupCount = POPUNS();
+
+ /* compile branch runtime */
+ dictAppendCell(dp, LVALUEtoCELL(pVM->pSys->pBranchParen));
+
+ /* push a new ENDOF fixup, the updated count of ENDOF fixups, and the caseTag */
+ PUSHPTR(dp->here);
+ PUSHUNS(fixupCount + 1);
+ markControlTag(pVM, caseTag);
+
+ /* reserve space for the ENDOF fixup */
+ dictAppendUNS(dp, 2);
+
+ /* and patch the original OF */
+ offset = dp->here - patchAddr;
+ *patchAddr = LVALUEtoCELL(offset);
+}
+
+
+/**************************************************************************
+ f a l l t h r o u g h C o I m
+** IMMEDIATE COMPILE-ONLY
+**************************************************************************/
+
+static void fallthroughCoIm(FICL_VM *pVM)
+{
+ CELL *patchAddr;
+ FICL_INT offset;
+ FICL_DICT *dp = vmGetDict(pVM);
+
+#if FICL_ROBUST > 1
+ vmCheckStack(pVM, 4, 3);
+#endif
+
+ /* ensure we're in an OF, */
+ matchControlTag(pVM, ofTag);
+ /* grab the address of the branch location after the OF */
+ patchAddr = (CELL *)stackPopPtr(pVM->pStack);
+ /* ensure we're also in a "case" */
+ matchControlTag(pVM, caseTag);
+
+ /* okay, here we go. put the case tag back. */
+ markControlTag(pVM, caseTag);
+
+ /* compile branch runtime */
+ dictAppendCell(dp, LVALUEtoCELL(pVM->pSys->pBranchParen));
+
+ /* push a new FALLTHROUGH fixup and the fallthroughTag */
+ PUSHPTR(dp->here);
+ markControlTag(pVM, fallthroughTag);
+
+ /* reserve space for the FALLTHROUGH fixup */
+ dictAppendUNS(dp, 2);
+
+ /* and patch the original OF */
+ offset = dp->here - patchAddr;
+ *patchAddr = LVALUEtoCELL(offset);
+}
+
+/**************************************************************************
h a s h
** hash ( c-addr u -- code)
** calculates hashcode of specified string and leaves it on the stack
@@ -2990,9 +3222,9 @@
{
FICL_DICT *dp = vmGetDict(pVM);
- assert(pVM->pSys->pIfParen);
+ assert(pVM->pSys->pBranch0);
- dictAppendCell(dp, LVALUEtoCELL(pVM->pSys->pIfParen));
+ dictAppendCell(dp, LVALUEtoCELL(pVM->pSys->pBranch0));
resolveBackBranch(dp, pVM, destTag);
return;
}
@@ -3001,9 +3233,9 @@
{
FICL_DICT *dp = vmGetDict(pVM);
- assert(pVM->pSys->pIfParen);
+ assert(pVM->pSys->pBranch0);
- dictAppendCell(dp, LVALUEtoCELL(pVM->pSys->pIfParen));
+ dictAppendCell(dp, LVALUEtoCELL(pVM->pSys->pBranch0));
markBranch(dp, pVM, origTag);
twoSwap(pVM);
dictAppendUNS(dp, 1);
@@ -4554,9 +4786,10 @@
{CREATE, createParen},
{DO, doParen},
{DOES, doDoes},
- {IF, ifParen},
+ {IF, branch0},
{LITERAL, literalParen},
{LOOP, loopParen},
+ {OF, ofParen},
{PLOOP, plusLoopParen},
{QDO, qDoParen},
{CSTRINGLIT, cstringLit},
@@ -4582,6 +4815,28 @@
}
+#ifdef TESTMAIN
+/**************************************************************************
+** r a n d o m
+** FICL-specific
+**************************************************************************/
+static void ficlRandom(FICL_VM *pVM)
+{
+ PUSHINT(rand());
+}
+
+
+/**************************************************************************
+** s e e d - r a n d o m
+** FICL-specific
+**************************************************************************/
+static void ficlSeedRandom(FICL_VM *pVM)
+{
+ srand(POPINT());
+}
+#endif
+
+
/**************************************************************************
f i c l C o m p i l e C o r e
** Builds the primitive wordset and the environment-query namespace.
@@ -4651,6 +4906,7 @@
dictAppendWord(dp, "c!", cStore, FW_DEFAULT);
dictAppendWord(dp, "c,", cComma, FW_DEFAULT);
dictAppendWord(dp, "c@", cFetch, FW_DEFAULT);
+ dictAppendWord(dp, "case", caseCoIm, FW_COMPIMMED);
dictAppendWord(dp, "cell+", cellPlus, FW_DEFAULT);
dictAppendWord(dp, "cells", cells, FW_DEFAULT);
dictAppendWord(dp, "char", ficlChar, FW_DEFAULT);
@@ -4664,14 +4920,18 @@
dictAppendWord(dp, "depth", depth, FW_DEFAULT);
dictAppendWord(dp, "do", doCoIm, FW_COMPIMMED);
dictAppendWord(dp, "does>", doesCoIm, FW_COMPIMMED);
+ pSys->pDrop =
dictAppendWord(dp, "drop", drop, FW_DEFAULT);
dictAppendWord(dp, "dup", dup, FW_DEFAULT);
dictAppendWord(dp, "else", elseCoIm, FW_COMPIMMED);
dictAppendWord(dp, "emit", emit, FW_DEFAULT);
+ dictAppendWord(dp, "endcase", endcaseCoIm, FW_COMPIMMED);
+ dictAppendWord(dp, "endof", endofCoIm, FW_COMPIMMED);
dictAppendWord(dp, "environment?", environmentQ,FW_DEFAULT);
dictAppendWord(dp, "evaluate", evaluate, FW_DEFAULT);
dictAppendWord(dp, "execute", execute, FW_DEFAULT);
dictAppendWord(dp, "exit", exitCoIm, FW_COMPIMMED);
+ dictAppendWord(dp, "fallthrough",fallthroughCoIm,FW_COMPIMMED);
dictAppendWord(dp, "fill", fill, FW_DEFAULT);
dictAppendWord(dp, "find", cFind, FW_DEFAULT);
dictAppendWord(dp, "fm/mod", fmSlashMod, FW_DEFAULT);
@@ -4693,6 +4953,7 @@
dictAppendWord(dp, "mod", ficlMod, FW_DEFAULT);
dictAppendWord(dp, "move", move, FW_DEFAULT);
dictAppendWord(dp, "negate", negate, FW_DEFAULT);
+ dictAppendWord(dp, "of", ofCoIm, FW_COMPIMMED);
dictAppendWord(dp, "or", bitwiseOr, FW_DEFAULT);
dictAppendWord(dp, "over", over, FW_DEFAULT);
dictAppendWord(dp, "postpone", postponeCoIm, FW_COMPIMMED);
@@ -4741,7 +5002,6 @@
dictAppendWord(dp, "?do", qDoCoIm, FW_COMPIMMED);
dictAppendWord(dp, "again", againCoIm, FW_COMPIMMED);
dictAppendWord(dp, "c\"", cstringQuoteIm, FW_IMMEDIATE);
- /* case of endof endcase */
dictAppendWord(dp, "hex", hex, FW_DEFAULT);
dictAppendWord(dp, "pad", pad, FW_DEFAULT);
dictAppendWord(dp, "parse", parse, FW_DEFAULT);
@@ -4888,6 +5148,10 @@
dictAppendWord(dp, "(user)", userParen, FW_DEFAULT);
dictAppendWord(dp, "user", userVariable, FW_DEFAULT);
#endif
+#ifdef TESTMAIN
+ dictAppendWord(dp, "random", ficlRandom, FW_DEFAULT);
+ dictAppendWord(dp, "seed-random",ficlSeedRandom,FW_DEFAULT);
+#endif
/*
** internal support words
@@ -4905,8 +5169,8 @@
dictAppendWord(dp, "(.\")", stringLit, FW_COMPILE);
pSys->pCStringLit =
dictAppendWord(dp, "(c\")", cstringLit, FW_COMPILE);
- pSys->pIfParen =
- dictAppendWord(dp, "(if)", ifParen, FW_COMPILE);
+ pSys->pBranch0 =
+ dictAppendWord(dp, "(branch0)", branch0, FW_COMPILE);
pSys->pBranchParen =
dictAppendWord(dp, "(branch)", branchParen, FW_COMPILE);
pSys->pDoParen =
@@ -4922,6 +5186,8 @@
pSys->pInterpret =
dictAppendWord(dp, "interpret", interpret, FW_DEFAULT);
dictAppendWord(dp, "lookup", lookup, FW_DEFAULT);
+ pSys->pOfParen =
+ dictAppendWord(dp, "(of)", ofParen, FW_DEFAULT);
dictAppendWord(dp, "(variable)",variableParen, FW_COMPILE);
dictAppendWord(dp, "(constant)",constantParen, FW_COMPILE);
dictAppendWord(dp, "(parse-step)",
Index: float.c
===================================================================
RCS file: /home/cvs/src/sys/boot/ficl/float.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -L sys/boot/ficl/float.c -L sys/boot/ficl/float.c -u -r1.1.1.2 -r1.2
--- sys/boot/ficl/float.c
+++ sys/boot/ficl/float.c
@@ -41,7 +41,7 @@
** SUCH DAMAGE.
*/
-/* $FreeBSD: src/sys/boot/ficl/float.c,v 1.1 2002/04/09 17:45:11 dcs Exp $ */
+/* $FreeBSD: src/sys/boot/ficl/float.c,v 1.2 2007/03/23 22:26:01 jkim Exp $ */
#include <stdlib.h>
#include <stdio.h>
@@ -977,6 +977,8 @@
}
PUSHFLOAT(accum);
+ if (pVM->state == COMPILE)
+ fliteralIm(pVM);
return(1);
}
@@ -1062,3 +1064,4 @@
#endif
return;
}
+
Index: vm.c
===================================================================
RCS file: /home/cvs/src/sys/boot/ficl/vm.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -L sys/boot/ficl/vm.c -L sys/boot/ficl/vm.c -u -r1.1.1.2 -r1.2
--- sys/boot/ficl/vm.c
+++ sys/boot/ficl/vm.c
@@ -47,7 +47,7 @@
** SUCH DAMAGE.
*/
-/* $FreeBSD: src/sys/boot/ficl/vm.c,v 1.9 2002/04/09 17:45:11 dcs Exp $ */
+/* $FreeBSD: src/sys/boot/ficl/vm.c,v 1.10 2007/03/23 22:26:01 jkim Exp $ */
#ifdef TESTMAIN
#include <stdlib.h>
@@ -316,15 +316,29 @@
char *pEnd = vmGetInBufEnd(pVM);
STRINGINFO si;
FICL_UNS count = 0;
- char ch;
+ char ch = 0;
pSrc = skipSpace(pSrc, pEnd);
SI_SETPTR(si, pSrc);
+/*
for (ch = *pSrc; (pEnd != pSrc) && !isspace(ch); ch = *++pSrc)
{
count++;
}
+*/
+
+ /* Changed to make Purify happier. --lch */
+ for (;;)
+ {
+ if (pEnd == pSrc)
+ break;
+ ch = *pSrc;
+ if (isspace(ch))
+ break;
+ count++;
+ pSrc++;
+ }
SI_SETLEN(si, count);
Index: unix.c
===================================================================
RCS file: /home/cvs/src/sys/boot/ficl/unix.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/boot/ficl/unix.c -L sys/boot/ficl/unix.c -u -r1.1.1.1 -r1.2
--- sys/boot/ficl/unix.c
+++ sys/boot/ficl/unix.c
@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/boot/ficl/unix.c,v 1.1 2001/04/29 02:36:34 dcs Exp $ */
+/* $FreeBSD: src/sys/boot/ficl/unix.c,v 1.2 2007/03/23 22:26:01 jkim Exp $ */
#include <string.h>
#include <netinet/in.h>
@@ -8,9 +8,9 @@
unsigned long ficlNtohl(unsigned long number)
- {
- return ntohl(number);
- }
+{
+ return ntohl(number);
+}
Index: tools.c
===================================================================
RCS file: /home/cvs/src/sys/boot/ficl/tools.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -L sys/boot/ficl/tools.c -L sys/boot/ficl/tools.c -u -r1.1.1.2 -r1.2
--- sys/boot/ficl/tools.c
+++ sys/boot/ficl/tools.c
@@ -54,7 +54,7 @@
** Specify breakpoint default action
*/
-/* $FreeBSD: src/sys/boot/ficl/tools.c,v 1.2 2002/04/09 17:45:11 dcs Exp $ */
+/* $FreeBSD: src/sys/boot/ficl/tools.c,v 1.3 2007/03/23 22:26:01 jkim Exp $ */
#ifdef TESTMAIN
#include <stdlib.h>
@@ -244,10 +244,17 @@
break;
case BRANCH:
c = *++pc;
- if (c.i > 0)
+ if (c.i == 0)
+ sprintf(cp, "repeat (branch %d)", pc+c.i-param0);
+ else if (c.i == 1)
sprintf(cp, "else (branch %d)", pc+c.i-param0);
else
- sprintf(cp, "repeat (branch %d)", pc+c.i-param0);
+ sprintf(cp, "endof (branch %d)", pc+c.i-param0);
+ break;
+
+ case OF:
+ c = *++pc;
+ sprintf(cp, "of (branch %d)", pc+c.i-param0);
break;
case QDO:
Index: ficl.h
===================================================================
RCS file: /home/cvs/src/sys/boot/ficl/ficl.h,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -L sys/boot/ficl/ficl.h -L sys/boot/ficl/ficl.h -u -r1.1.1.2 -r1.2
--- sys/boot/ficl/ficl.h
+++ sys/boot/ficl/ficl.h
@@ -41,7 +41,7 @@
** SUCH DAMAGE.
*/
-/* $FreeBSD: src/sys/boot/ficl/ficl.h,v 1.21 2004/11/30 11:35:30 scottl Exp $ */
+/* $FreeBSD: src/sys/boot/ficl/ficl.h,v 1.22 2007/03/23 22:26:01 jkim Exp $ */
#if !defined (__FICL_H__)
#define __FICL_H__
@@ -237,9 +237,9 @@
/*
** the Good Stuff starts here...
*/
-#define FICL_VER "3.02"
+#define FICL_VER "3.03"
#define FICL_VER_MAJOR 3
-#define FICL_VER_MINOR 2
+#define FICL_VER_MINOR 3
#if !defined (FICL_PROMPT)
#define FICL_PROMPT "ok> "
#endif
@@ -857,7 +857,7 @@
FICL_WORD *pDoesParen;
FICL_WORD *pExitInner;
FICL_WORD *pExitParen;
- FICL_WORD *pIfParen;
+ FICL_WORD *pBranch0;
FICL_WORD *pInterpret;
FICL_WORD *pLitParen;
FICL_WORD *pTwoLitParen;
@@ -865,7 +865,9 @@
FICL_WORD *pPLoopParen;
FICL_WORD *pQDoParen;
FICL_WORD *pSemiParen;
+ FICL_WORD *pOfParen;
FICL_WORD *pStore;
+ FICL_WORD *pDrop;
FICL_WORD *pCStringLit;
FICL_WORD *pStringLit;
@@ -1086,6 +1088,7 @@
IF,
LITERAL,
LOOP,
+ OF,
PLOOP,
PRIMITIVE,
QDO,
Index: Makefile
===================================================================
RCS file: /home/cvs/src/sys/boot/ficl/Makefile,v
retrieving revision 1.3
retrieving revision 1.4
diff -L sys/boot/ficl/Makefile -L sys/boot/ficl/Makefile -u -r1.3 -r1.4
--- sys/boot/ficl/Makefile
+++ sys/boot/ficl/Makefile
@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/boot/ficl/Makefile,v 1.41 2005/05/31 18:13:29 obrien Exp $
+# $FreeBSD: src/sys/boot/ficl/Makefile,v 1.44.2.1 2007/10/18 12:08:53 nyan Exp $
#
.PATH: ${.CURDIR}/${MACHINE_ARCH:S/amd64/i386/}
BASE_SRCS= dict.c ficl.c fileaccess.c float.c loader.c math64.c \
@@ -7,18 +7,12 @@
SRCS= ${BASE_SRCS} sysdep.c softcore.c
CLEANFILES= softcore.c testmain testmain.o
CFLAGS+= -ffreestanding
-.if ${MACHINE_ARCH} == "alpha"
-CFLAGS+= -mno-fp-regs -Os
-.endif
.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
CFLAGS+= -mpreferred-stack-boundary=2
CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2
.endif
-.if ${MACHINE_ARCH} == "powerpc"
-CFLAGS+= -msoft-float
-.endif
-.if ${MACHINE} == "pc98"
-CFLAGS+= -DPC98
+.if ${MACHINE_ARCH} == "i386"
+CFLAGS+= -mno-sse3
.endif
.if HAVE_PNP
CFLAGS+= -DHAVE_PNP
@@ -42,7 +36,7 @@
#SOFTWORDS+= oo.fr classes.fr
.if ${MACHINE_ARCH} == "amd64"
-CFLAGS+= -m32 -I.
+CFLAGS+= -m32 -march=i386 -I.
.endif
CFLAGS+= -I${.CURDIR} -I${.CURDIR}/${MACHINE_ARCH:S/amd64/i386/} \
Index: loader.c
===================================================================
RCS file: /home/cvs/src/sys/boot/ficl/loader.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/boot/ficl/loader.c -L sys/boot/ficl/loader.c -u -r1.1.1.1 -r1.2
--- sys/boot/ficl/loader.c
+++ sys/boot/ficl/loader.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/boot/ficl/loader.c,v 1.11 2004/11/30 11:35:30 scottl Exp $
+ * $FreeBSD: src/sys/boot/ficl/loader.c,v 1.12 2006/05/12 04:07:42 jhb Exp $
*/
/*******************************************************************
@@ -691,22 +691,14 @@
ficlSetEnv(pSys, "arch-pc98", FICL_TRUE);
#elif defined(__i386__)
ficlSetEnv(pSys, "arch-i386", FICL_TRUE);
- ficlSetEnv(pSys, "arch-alpha", FICL_FALSE);
- ficlSetEnv(pSys, "arch-ia64", FICL_FALSE);
- ficlSetEnv(pSys, "arch-powerpc", FICL_FALSE);
-#elif defined(__alpha__)
- ficlSetEnv(pSys, "arch-i386", FICL_FALSE);
- ficlSetEnv(pSys, "arch-alpha", 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-alpha", 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-alpha", FICL_FALSE);
ficlSetEnv(pSys, "arch-ia64", FICL_FALSE);
ficlSetEnv(pSys, "arch-powerpc", FICL_TRUE);
#endif
Index: pe.h
===================================================================
RCS file: /home/cvs/src/sys/boot/efi/include/ia64/pe.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/boot/efi/include/ia64/pe.h -L sys/boot/efi/include/ia64/pe.h -u -r1.1.1.1 -r1.2
--- sys/boot/efi/include/ia64/pe.h
+++ sys/boot/efi/include/ia64/pe.h
@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/boot/efi/include/ia64/pe.h,v 1.1 2001/06/09 16:49:50 dfr Exp $ */
+/* $FreeBSD: src/sys/boot/efi/include/ia64/pe.h,v 1.2 2006/11/02 02:42:48 marcel Exp $ */
/*
PE32+ header file
*/
@@ -595,4 +595,43 @@
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
Index: efibind.h
===================================================================
RCS file: /home/cvs/src/sys/boot/efi/include/ia64/efibind.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/boot/efi/include/ia64/efibind.h -L sys/boot/efi/include/ia64/efibind.h -u -r1.1.1.1 -r1.2
--- sys/boot/efi/include/ia64/efibind.h
+++ sys/boot/efi/include/ia64/efibind.h
@@ -1,7 +1,14 @@
-/* $FreeBSD: src/sys/boot/efi/include/ia64/efibind.h,v 1.6 2005/03/07 15:38:37 stefanf Exp $ */
+/* $FreeBSD: src/sys/boot/efi/include/ia64/efibind.h,v 1.7 2006/11/02 02:42:48 marcel Exp $ */
/*++
-Copyright (c) 1998 Intel Corporation
+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:
@@ -18,9 +25,66 @@
--*/
+#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
+//
-/* Basic EFI types of various widths. */
typedef uint64_t UINT64;
typedef int64_t INT64;
@@ -39,17 +103,22 @@
typedef int64_t INTN;
typedef uint64_t UINTN;
-/*
- *XXX BugBug: Code to debug
- */
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+// BugBug: Code to debug
+//
#define BIT63 0x8000000000000000
-#define PLATFORM_IOBASE_ADDRESS (0xffffc000000 | BIT63)
+#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. */
+
+//
+// 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
@@ -58,12 +127,13 @@
#define BAD_POINTER 0xFBFBFBFBFBFBFBFB
#define MAX_ADDRESS 0xFFFFFFFFFFFFFFFF
-#define BREAKPOINT() while (TRUE)
+#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
- */
+//
+// 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) \
@@ -72,34 +142,28 @@
(UINTN)Adjustment = MIN_ALIGNMENT_SIZE - ((UINTN)Value % MIN_ALIGNMENT_SIZE); \
Value = (UINTN)Value + (UINTN)Adjustment
-/*
- * Define macros to create data structure signatures.
- */
+//
+// 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))
-/*
- * To export & import functions in the EFI emulator environment
- */
-
-#define EXPORTAPI
-
-/*
- * 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
-#else
-#define EFIAPI
-#endif
+//
+// 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
@@ -108,27 +172,48 @@
#define RUNTIME_CODE(a) alloc_text("rtcode", a)
#define BEGIN_RUNTIME_DATA() data_seg("rtdata")
-#define END_RUNTIME_DATA() data_seg("")
+#define END_RUNTIME_DATA() data_seg()
#define VOLATILE volatile
-/*
- * XXX Need to find out if this is portable across compilers.
- */
-void __mf (void);
-#ifndef __GNUC__
-#pragma intrinsic (__mf)
+//
+// 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
-#define MEMORY_FENCE() __mf()
-/*
- * When build similiar to FW, then link everything together as
- * one big module.
- */
+//
+// 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)
+ (_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
--- 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 at alum.mit.edu)
-** Created: 16 Oct 1997
-** Implementations of FICL external interface functions...
-**
-*******************************************************************/
-
-/* $FreeBSD: src/sys/boot/ficl/ia64/sysdep.c,v 1.1 2001/09/04 08:50:23 dfr Exp $ */
-
-#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 */
-
-
--- 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 at 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 at 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: src/sys/boot/ficl/ia64/sysdep.h,v 1.3 2002/05/16 21:21:57 trhodes Exp $ */
-
-#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__*/
--- sys/boot/ficl/powerpc/sysdep.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************
-** s y s d e p . c
-** Forth Inspired Command Language
-** Author: John Sadler (john_sadler at alum.mit.edu)
-** Created: 16 Oct 1997
-** Implementations of FICL external interface functions...
-**
-*******************************************************************/
-
-/* $FreeBSD: src/sys/boot/ficl/powerpc/sysdep.c,v 1.1 2003/12/10 09:05:08 grehan Exp $ */
-
-#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 */
-
-
--- sys/boot/ficl/powerpc/sysdep.h
+++ /dev/null
@@ -1,432 +0,0 @@
-/*******************************************************************
- s y s d e p . h
-** Forth Inspired Command Language
-** Author: John Sadler (john_sadler at 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.6 2001-04-26 21:41:55-07 jsadler Exp jsadler $
-*******************************************************************/
-/*
-** Copyright (c) 1997-2001 John Sadler (john_sadler at alum.mit.edu)
-** All rights reserved.
-**
-** Get the latest Ficl release at http://ficl.sourceforge.net
-**
-** 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.
-**
-** 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 send
-** contact me by email at the address above.
-**
-** $Id: sysdep.h,v 1.6 2001-04-26 21:41:55-07 jsadler Exp jsadler $
-** $FreeBSD: src/sys/boot/ficl/powerpc/sysdep.h,v 1.1 2003/12/10 09:05:08 grehan Exp $
-*/
-
-#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 INT32
-#endif
-
-#if !defined FICL_UNS
-#define FICL_UNS UNS32
-#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 32
-#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 1
-#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
-
-/*
-** 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_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
-
-/*
-** 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 2
-#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__*/
Index: jhlocal.fr
===================================================================
RCS file: /home/cvs/src/sys/boot/ficl/softwords/jhlocal.fr,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/boot/ficl/softwords/jhlocal.fr -L sys/boot/ficl/softwords/jhlocal.fr -u -r1.1.1.1 -r1.2
--- sys/boot/ficl/softwords/jhlocal.fr
+++ sys/boot/ficl/softwords/jhlocal.fr
@@ -14,11 +14,13 @@
\
\ revised 2 June 2000 - { | a -- } now works correctly
\
-\ $FreeBSD: src/sys/boot/ficl/softwords/jhlocal.fr,v 1.4 2001/04/29 02:36:36 dcs Exp $
+\ $FreeBSD: src/sys/boot/ficl/softwords/jhlocal.fr,v 1.5 2007/03/23 22:26:01 jkim Exp $
hide
+
0 constant zero
+
: ?-- ( c-addr u -- c-addr u flag )
2dup s" --" compare 0= ;
: ?} ( c-addr u -- c-addr u flag )
@@ -74,23 +76,24 @@
parse-word
?delim dup to locstate
0= while
- ?2loc if
- postpone zero postpone zero (2local)
- else
- postpone zero (local)
- endif
+ ?2loc if
+ postpone zero postpone zero (2local)
+ else
+ postpone zero (local)
+ endif
repeat
endif
0 0 (local)
\ toss words until }
+ \ (explicitly allow | and -- in the comment)
locstate 2 = if
begin
parse-word
- ?delim dup to locstate
- 0= while
- 2drop
+ ?delim dup to locstate
+ 3 < while
+ locstate 0= if 2drop endif
repeat
endif
Index: softcore.awk
===================================================================
RCS file: /home/cvs/src/sys/boot/ficl/softwords/softcore.awk,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/boot/ficl/softwords/softcore.awk -L sys/boot/ficl/softwords/softcore.awk -u -r1.1.1.1 -r1.2
--- sys/boot/ficl/softwords/softcore.awk
+++ sys/boot/ficl/softwords/softcore.awk
@@ -10,25 +10,63 @@
# Note! This script uses strftime() which is a gawk-ism, and the
# POSIX [[:space:]] character class.
#
-# $FreeBSD: src/sys/boot/ficl/softwords/softcore.awk,v 1.8 2001/11/03 01:33:12 obrien Exp $
+# $FreeBSD: src/sys/boot/ficl/softwords/softcore.awk,v 1.9 2007/03/23 22:26:01 jkim Exp $
BEGIN \
{
- printf "/***************************************************************\n";
+ printf "/*******************************************************************\n";
printf "** s o f t c o r e . c\n";
printf "** Forth Inspired Command Language -\n";
printf "** Words from CORE set written in FICL\n";
printf "** Author: John Sadler (john_sadler at alum.mit.edu)\n";
printf "** Created: 27 December 1997\n";
printf "** Last update: %s\n", datestamp;
- printf "***************************************************************/\n";
- printf "\n/*\n";
+ printf "*******************************************************************/\n";
+ printf "/*\n";
+ printf "** DO NOT EDIT THIS FILE -- it is generated by softwords/softcore.awk\n";
+ printf "** Make changes to the .fr files in ficl/softwords instead.\n";
printf "** This file contains definitions that are compiled into the\n";
printf "** system dictionary by the first virtual machine to be created.\n";
printf "** Created automagically by ficl/softwords/softcore.awk\n";
printf "*/\n";
+ printf "/*\n";
+ printf "** Copyright (c) 1997-2001 John Sadler (john_sadler at alum.mit.edu)\n";
+ printf "** All rights reserved.\n";
+ printf "**\n";
+ printf "** Get the latest Ficl release at http://ficl.sourceforge.net\n";
+ printf "**\n";
+ printf "** I am interested in hearing from anyone who uses ficl. If you have\n";
+ printf "** a problem, a success story, a defect, an enhancement request, or\n";
+ printf "** if you would like to contribute to the ficl release, please send\n";
+ printf "** contact me by email at the address above.\n";
+ printf "**\n";
+ printf "** L I C E N S E and D I S C L A I M E R\n";
+ printf "** \n";
+ printf "** Redistribution and use in source and binary forms, with or without\n";
+ printf "** modification, are permitted provided that the following conditions\n";
+ printf "** are met:\n";
+ printf "** 1. Redistributions of source code must retain the above copyright\n";
+ printf "** notice, this list of conditions and the following disclaimer.\n";
+ printf "** 2. Redistributions in binary form must reproduce the above copyright\n";
+ printf "** notice, this list of conditions and the following disclaimer in the\n";
+ printf "** documentation and/or other materials provided with the distribution.\n";
+ printf "**\n";
+ printf "** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND\n";
+ printf "** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n";
+ printf "** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n";
+ printf "** ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n";
+ printf "** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n";
+ printf "** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n";
+ printf "** OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n";
+ printf "** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n";
+ printf "** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n";
+ printf "** OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n";
+ printf "** SUCH DAMAGE.\n";
+ printf "*/\n";
+ printf "\n";
printf "\n#include \"ficl.h\"\n";
printf "\nstatic char softWords[] =\n";
+ printf "#if FICL_WANT_SOFTWORDS\n";
commenting = 0;
}
@@ -127,14 +165,17 @@
END \
{
if (commenting) end_comments();
+ printf "#endif /* WANT_SOFTWORDS */\n";
printf " \"quit \";\n";
printf "\n\nvoid ficlCompileSoftCore(FICL_SYSTEM *pSys)\n";
printf "{\n";
printf " FICL_VM *pVM = pSys->vmList;\n";
+ printf " CELL id = pVM->sourceID;\n";
printf " int ret = sizeof (softWords);\n";
printf " assert(pVM);\n";
- printf "\n"
+ printf " pVM->sourceID.i = -1;\n";
printf " ret = ficlExec(pVM, softWords);\n";
+ printf " pVM->sourceID = id;\n";
printf " if (ret == VM_ERREXIT)\n";
printf " assert(FALSE);\n";
printf " return;\n";
Index: oo.fr
===================================================================
RCS file: /home/cvs/src/sys/boot/ficl/softwords/oo.fr,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/boot/ficl/softwords/oo.fr -L sys/boot/ficl/softwords/oo.fr -u -r1.1.1.1 -r1.2
--- sys/boot/ficl/softwords/oo.fr
+++ sys/boot/ficl/softwords/oo.fr
@@ -3,7 +3,7 @@
\ ** F I C L O - O E X T E N S I O N S
\ ** john sadler aug 1998
\
-\ $FreeBSD: src/sys/boot/ficl/softwords/oo.fr,v 1.4 2002/04/09 17:45:28 dcs Exp $
+\ $FreeBSD: src/sys/boot/ficl/softwords/oo.fr,v 1.5 2007/03/23 22:26:01 jkim Exp $
17 ficl-vocabulary oop
also oop definitions
@@ -86,8 +86,6 @@
\ execute it at run-time...
\
-hide
-
\ p a r s e - m e t h o d
\ compiles a method name so that it pushes
\ the string base address and count at run-time.
@@ -97,6 +95,13 @@
postpone sliteral
; compile-only
+
+
+: (lookup-method) { class 2:name -- class 0 | class xt 1 | class xt -1 }
+ class name class cell+ @ ( class c-addr u wid )
+ search-wordlist
+;
+
\ l o o k u p - m e t h o d
\ takes a counted string method name from the stack (as compiled
\ by parse-method) and attempts to look this method up in the method list of
@@ -104,22 +109,18 @@
\ and pushes the xt of the method. If not, it aborts with an error message.
: lookup-method { class 2:name -- class xt }
- name class cell+ @ ( c-addr u wid )
- search-wordlist ( 0 | xt 1 | xt -1 )
+ class name (lookup-method) ( 0 | xt 1 | xt -1 )
0= if
name type ." not found in "
class body> >name type
cr abort
endif
- class swap
;
: find-method-xt \ name ( class -- class xt )
parse-word lookup-method
;
-set-current ( stop hiding definitions )
-
: catch-method ( instance class c-addr u -- <method-signature> exc-flag )
lookup-method catch
;
Index: fileaccess.fr
===================================================================
RCS file: /home/cvs/src/sys/boot/ficl/softwords/fileaccess.fr,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/boot/ficl/softwords/fileaccess.fr -L sys/boot/ficl/softwords/fileaccess.fr -u -r1.1.1.1 -r1.2
--- sys/boot/ficl/softwords/fileaccess.fr
+++ sys/boot/ficl/softwords/fileaccess.fr
@@ -4,7 +4,7 @@
\ ** submitted by Larry Hastings, larry at hastings.org
\ **
\
-\ $FreeBSD: src/sys/boot/ficl/softwords/fileaccess.fr,v 1.1 2002/04/09 17:45:27 dcs Exp $
+\ $FreeBSD: src/sys/boot/ficl/softwords/fileaccess.fr,v 1.2 2007/03/23 22:26:01 jkim Exp $
: r/o 1 ;
: r/w 3 ;
@@ -15,12 +15,11 @@
r/o bin open-file 0= if
locals| f | end-locals
f include-file
- f close-file drop
else
drop
endif
;
-: include parse-word included ; immediate
+: include parse-word included ;
\ #endif
Index: prefix.fr
===================================================================
RCS file: /home/cvs/src/sys/boot/ficl/softwords/prefix.fr,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -L sys/boot/ficl/softwords/prefix.fr -L sys/boot/ficl/softwords/prefix.fr -u -r1.1.1.1 -r1.2
--- sys/boot/ficl/softwords/prefix.fr
+++ sys/boot/ficl/softwords/prefix.fr
@@ -5,7 +5,7 @@
\ (jws) To make a prefix, simply create a new definition in the <prefixes>
\ wordlist. start-prefixes and end-prefixes handle the bookkeeping
\
-\ $FreeBSD: src/sys/boot/ficl/softwords/prefix.fr,v 1.2 2002/04/09 17:45:28 dcs Exp $
+\ $FreeBSD: src/sys/boot/ficl/softwords/prefix.fr,v 1.3 2007/03/23 22:26:01 jkim Exp $
variable save-current
@@ -22,7 +22,7 @@
\ make .( a prefix (we just create an alias for it in the prefixes list)
-: .( .( ;
+: .( postpone .( ; immediate
\ make \ a prefix, and add // (same thing) as a prefix too
Index: Makefile
===================================================================
RCS file: /home/cvs/src/sys/boot/Makefile,v
retrieving revision 1.3
retrieving revision 1.4
diff -L sys/boot/Makefile -L sys/boot/Makefile -u -r1.3 -r1.4
--- sys/boot/Makefile
+++ sys/boot/Makefile
@@ -1,22 +1,24 @@
-# $FreeBSD: src/sys/boot/Makefile,v 1.26 2004/12/21 12:32:13 ru Exp $
# $MidnightBSD$
+# $FreeBSD: src/sys/boot/Makefile,v 1.32 2006/11/05 22:03:02 marcel Exp $
-.if !defined(NO_FORTH)
+.include <bsd.own.mk>
+
+.if ${MK_FORTH} != "no"
# Build the add-in FORTH interpreter.
SUBDIR+= ficl
.endif
# Build EFI library.
-.if ${MACHINE_ARCH} == "ia64"
+.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
SUBDIR+= efi
.endif
# Build Open Firmware library.
-.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "sparc64"
+.if ${MACHINE_ARCH} == "sparc64"
SUBDIR+= ofw
.endif
# Pick the machine-dependent subdir based on the target architecture.
-SUBDIR+= ${MACHINE:S/amd64/i386/}
+SUBDIR+= ${MACHINE:S/amd64/i386/:S/sun4v/sparc64/}
.include <bsd.subdir.mk>
Index: loader.4th
===================================================================
RCS file: /home/cvs/src/sys/boot/forth/loader.4th,v
retrieving revision 1.2
retrieving revision 1.3
diff -L sys/boot/forth/loader.4th -L sys/boot/forth/loader.4th -u -r1.2 -r1.3
--- sys/boot/forth/loader.4th
+++ sys/boot/forth/loader.4th
@@ -25,18 +25,6 @@
\ $FreeBSD: src/sys/boot/forth/loader.4th,v 1.24 2002/05/24 02:28:58 gordon Exp $
\ $MidnightBSD$
-s" arch-alpha" environment? [if] [if]
- s" loader_version" environment? [if]
- 12 < [if]
- .( Loader version 1.2+ required) cr
- abort
- [then]
- [else]
- .( Could not get loader version!) cr
- abort
- [then]
-[then] [then]
-
s" arch-i386" environment? [if] [if]
s" loader_version" environment? [if]
11 < [if]
Index: loader.conf
===================================================================
RCS file: /home/cvs/src/sys/boot/forth/loader.conf,v
retrieving revision 1.2
retrieving revision 1.3
diff -L sys/boot/forth/loader.conf -L sys/boot/forth/loader.conf -u -r1.2 -r1.3
--- sys/boot/forth/loader.conf
+++ sys/boot/forth/loader.conf
@@ -6,8 +6,8 @@
#
# All arguments must be in double quotes.
#
-# $FreeBSD: src/sys/boot/forth/loader.conf,v 1.95.2.6 2006/02/14 06:20:15 ru Exp $
# $MidnightBSD$
+# $FreeBSD: src/sys/boot/forth/loader.conf,v 1.122 2007/09/26 08:38:25 ru Exp $
##############################################################
### Basic configuration options ############################
@@ -45,7 +45,8 @@
#autoboot_delay="10" # Delay in seconds before autobooting,
# set to -1 if you don't want user to be
# allowed to interrupt autoboot process and
- # escape to the loader prompt
+ # escape to the loader prompt, set to
+ # "NO" to disable autobooting
#beastie_disable="NO" # Turn the beastie boot menu on and off
#loader_logo="fbsdbw" # Desired logo: fbsdbw, beastiebw, beastie, none
#comconsole_speed="9600" # Set the current serial console speed
@@ -78,6 +79,9 @@
#boot_verbose="" # -v: Causes extra debugging information to be printed
#init_path="/sbin/init:/sbin/oinit:/sbin/init.bak:/rescue/init:/stand/sysinstall"
# Sets the list of init candidates
+#init_shell="/bin/sh" # The shell binary used by init(8).
+#init_script="" # Initial script to run by init(8) before chrooting.
+#init_chroot="" # Directory for init(8) to chroot into.
##############################################################
@@ -96,7 +100,7 @@
#kern.maxswzone="" # Set the max swmeta KVA storage
#kern.maxtsiz="" # Set the max text size
#kern.maxusers="32" # Set size of various static tables
-#kern.nbuf="" # Set the number of buffer headers
+#kern.nbuf="" # Set the number of buffer headers
#kern.ncallout="" # Set the maximum # of timer events
#kern.sgrowsiz="" # Set the amount to grow stack
#kern.cam.scsi_delay="2000" # Delay (in ms) before probing SCSI
@@ -124,6 +128,7 @@
coda_load="NO" # CODA filesystem
fdescfs_load="NO" # Filedescriptors filesystem
linprocfs_load="NO" # Linux compatibility process filesystem
+linsysfs_load="NO" # Linux compatibility system filesystem
msdosfs_load="NO" # FAT-12/16/32
nfsclient_load="NO" # NFS client
nfsserver_load="NO" # NFS server
@@ -131,14 +136,30 @@
nullfs_load="NO" # Null filesystem
portalfs_load="NO" # Portal filesystem
procfs_load="NO" # Process filesystem
-#umapfs_load="NO" # User-id map filesystem
+reiserfs_load="NO" # ReiserFS
unionfs_load="NO" # Union filesystem
+xfs_load="NO" # XFS
+zfs_load="NO" # ZFS
# Related stuff
-geom_ccd_load="NO" # Concatenated disk driver
-geom_vinum_load="NO" # Concatenated/mirror/raid driver
-g_md_load="NO" # Memory disk driver (vnode/swap/malloc)
+geom_bde_load="NO" # Disk encryption driver (see gbde(4,8))
+geom_ccd_load="NO" # Concatenated disk driver (see ccd(4),
+ # ccdconfig(8))
+geom_concat_load="NO" # Concatenated disk driver (see gconcat(8))
+geom_eli_load="NO" # Disk encryption driver (see geli(8))
+geom_gate_load="NO" # Userland disk driver (see geom_gate(4),
+ # ggatec(8), ggated(8), ggatel(8))
+geom_label_load="NO" # File system labels (see glabel(8))
+geom_md_load="NO" # Memory disk driver (vnode/swap/malloc) (see
+ # md(4), mdconfig(8))
+geom_mirror_load="NO" # RAID1 disk driver (see gmirror(8))
+geom_nop_load="NO" # Transparent disk driver (see gnop(8))
+geom_raid3_load="NO" # RAID3 disk driver (see graid3(8))
+geom_shsec_load="NO" # Shared secret disk driver (see gshsec(8))
+geom_stripe_load="NO" # RAID0 disk driver (see gstripe(8))
+geom_uzip_load="NO" # Compressed disk images driver (see mkuzip(8))
+geom_vinum_load="NO" # Concatenated/mirror/raid driver (see vinum(4))
##############################################################
@@ -167,7 +188,8 @@
##############################################################
if_disc_load="NO" # Discard device
-if_ef_load="NO" # pseudo-device providing support for multiple ethernet frame types
+if_ef_load="NO" # pseudo-device providing support for multiple
+ # ethernet frame types
if_faith_load="NO" # IPv6-to-IPv4 TCP relay capturing interface
if_gif_load="NO" # generic tunnel interface
if_gre_load="NO" # encapsulating network device
@@ -188,48 +210,68 @@
miibus_load="NO" # miibus support, needed for some drivers
if_an_load="NO" # Aironet 4500/4800 802.11 wireless NICs
if_ar_load="NO" # Digi SYNC/570i
+if_arl_load="NO" # Aironet Arlan 655 wireless network adapter
+if_ath_load="NO" # Atheros IEEE 802.11 wireless NICs
+if_aue_load="NO" # ADMtek AN986 Pegasus USB Ethernet
if_awi_load="NO" # AMD PCnetMobile IEEE 802.11 wireless NICs
+if_axe_load="NO" # ASIX Electronics AX88172 USB Ethernet
+if_bce_load="NO" # Broadcom NetXtreme II Gigabit Ethernet
if_bfe_load="NO" # Broadcom BCM4401
-if_bge_load="NO" # Broadcom BCM570x PCI gigabit ethernet
+if_bge_load="NO" # Broadcom BCM570x PCI Gigabit Ethernet
if_cm_load="NO" # SMC (90c26, 90c56, 90c66)
+if_cs_load="NO" # Crystal Semiconductor CS8920
+if_cue_load="NO" # CATC USB-EL1210A USB Ethernet
if_dc_load="NO" # DEC/Intel 21143 and various workalikes
-if_de_load="NO" # DEC DC21x4x ethernet
-if_ed_load="NO" # National Semiconductor DS8390/WD83C690 ethernet
-if_el_load="NO" # 3Com Etherlink 3C501
-if_em_load="NO" # Intel(R) PRO/1000 gigabit ethernet
+if_de_load="NO" # DEC DC21x4x Ethernet
+if_ed_load="NO" # National Semiconductor DS8390/WD83C690
+ # Ethernet
+if_em_load="NO" # Intel(R) PRO/1000 Gigabit Ethernet
if_en_load="NO" # Midway-based ATM interfaces
if_ep_load="NO" # 3Com Etherlink III (3c5x9)
-if_ex_load="NO" # Intel EtherExpress Pro/10 ethernet
-if_fe_load="NO" # Fujitsu MB86960A/MB86965A based Ethernet adapters
+if_ex_load="NO" # Intel EtherExpress Pro/10 Ethernet
+if_fe_load="NO" # Fujitsu MB86960A/MB86965A based Ethernet
+ # adapters
if_fxp_load="NO" # Intel EtherExpress PRO/100B (82557, 82558)
-if_gx_load="NO" # Intel Pro/1000 gigabit ethernet
+if_gem_load="NO" # Sun GEM/Sun ERI/Apple GMAC
+if_hme_load="NO" # Sun Microelectronics STP2002-STQ Ethernet
if_ie_load="NO" # Intel 82586
-if_lge_load="NO" # Level 1 LXT1001 NetCellerator PCI gigabit ethernet
-if_lnc_load="NO" # AMD Lance/PCnet Ethernet
-if_my_load="NO" # Myson PCI fast ethernet
-if_nge_load="NO" # National Semiconductor PCI gigabit ethernet
+if_ipw_load="NO" # Intel PRO/Wireless 2100 wireless
+if_iwi_load="NO" # Intel PRO/Wireless 2200BG/2225BG/2915ABG
+ # wireless
+if_ixgb_load="NO" # Intel PRO/10Gb Ethernet
+if_le_load="NO" # AMD Am7900 LANCE and Am79C9xx PCnet
+if_lge_load="NO" # Level 1 LXT1001 NetCellerator PCI Gigabit
+ # Ethernet
+if_msk_load="NO" # Marvell/SysKonnect Yukon II Gigabit Ethernet
+if_mxge_load="NO" # Myricom Myri10GE 10Gb Ethernet
+if_my_load="NO" # Myson PCI Fast Ethernet
+if_nfe_load="NO" # NVIDIA nForce MCP Networking Adapter
+if_nge_load="NO" # National Semiconductor PCI Gigabit Ethernet
+if_nve_load="NO" # NVIDIA nForce MCP Networking Adapter
if_oltr_load="NO" # Olicom
if_pcn_load="NO" # AMD PCnet PCI
if_ray_load="NO" # Raytheon Raylink/Webgear Aviator PCCard
if_re_load="NO" # RealTek 8139C+/8169/8169S/8110S
if_rl_load="NO" # RealTek 8129/8139
+if_rue_load="NO" # RealTek RTL8150 USB to Fast Ethernet
if_sbni_load="NO" # Granch SBNI12 leased line adapters
if_sf_load="NO" # Adaptec Duralink PCI (AIC-6915 "starfire")
if_sis_load="NO" # Silicon Integrated Systems SiS 900/7016
-if_sk_load="NO" # SysKonnect SK-984x series PCI gigabit ethernet
+if_sk_load="NO" # SysKonnect SK-984x series PCI Gigabit Ethernet
if_sn_load="NO" # SMC 91Cxx
if_sr_load="NO" # synchronous RISCom/N2 / WANic 400/405
-if_ste_load="NO" # Sundance Technologies ST201 fast ethernet
+if_ste_load="NO" # Sundance Technologies ST201 Fast Ethernet
+if_stge_load="NO" # Sundance/Tamarack TC9021 Gigabit Ethernet
if_ti_load="NO" # Alteon Networks Tigon 1 and Tigon 2
if_tl_load="NO" # Texas Instruments TNETE100 ("ThunderLAN")
-if_tx_load="NO" # SMC 83c17x fast ethernet
+if_tx_load="NO" # SMC 83c17x Fast Ethernet
if_txp_load="NO" # 3Com 3XP Typhoon/Sidewinder (3CR990)
if_vge_load="NO" # VIA VT6122 PCI Gigabit Ethernet
+if_udav_load="NO" # Davicom DM9601 USB Ethernet
if_vr_load="NO" # VIA Rhine I and Rhine II
if_vx_load="NO" # 3Com 3C590 family
if_wb_load="NO" # Winbond W89C840F
if_wi_load="NO" # WaveLAN/IEEE 802.11 wireless NICs
-if_wx_load="NO" # Intel Gigabit Ethernet
if_xe_load="NO" # Xircom CreditCard PCMCIA
if_xl_load="NO" # 3Com Etherlink XL (3c900, 3c905, 3c905B)
@@ -257,18 +299,21 @@
ng_ksocket_load="NO" # kernel socket netgraph node type
ng_l2tp_load="NO" # L2TP protocol netgraph node type
ng_lmi_load="NO" # frame relay LMI protocol netgraph node type
-ng_mppc_load="NO" # Microsoft MPPC/MPPE compression and encryption netgraph node type
-ng_netflow_load="NO" # Cisco's NetFlow netgraph note type
+ng_mppc_load="NO" # Microsoft MPPC/MPPE compression and
+ # encryption netgraph node type
+ng_netflow_load="NO" # Cisco's NetFlow netgraph node type
ng_one2many_load="NO" # packet multiplexing netgraph node type
ng_ppp_load="NO" # PPP protocol netgraph node type
ng_pppoe_load="NO" # RFC 2516 PPPOE protocol netgraph node type
ng_pptpgre_load="NO" # PPTP GRE protocol netgraph node type
ng_rfc1490_load="NO" # RFC 1490 netgraph node type
ng_socket_load="NO" # Netgraph socket node type
-ng_split_load="NO" # netgraph node to separate incoming and outgoing flows
+ng_split_load="NO" # netgraph node to separate incoming and
+ # outgoing flows
ng_sppp_load="NO" # sppp netgraph node type
ng_tee_load="NO" # Netgraph ``tee'' node type
-ng_tty_load="NO" # Netgraph node type that is also a line discipline
+ng_tty_load="NO" # Netgraph node type that is also a line
+ # discipline
ng_vjc_load="NO" # Van Jacobsen compression netgraph node type
ng_vlan_load="NO" # IEEE 802.1Q VLAN tagging netgraph node type
@@ -285,9 +330,13 @@
snd_csa_load="NO" # csa
snd_ds1_load="NO" # ds1
snd_emu10k1_load="NO" # Creative Sound Blaster Live
+snd_emu10kx_load="NO" # Creative SoundBlaster Live! and Audigy
+snd_envy24_load="NO" # VIA Envy24
+snd_envy24ht_load="NO" # VIA Envy24HT
snd_es137x_load="NO" # es137x
snd_ess_load="NO" # ess
snd_fm801_load="NO" # fm801
+snd_hda_load="NO" # Intel High Definition Audio (Controller)
snd_ich_load="NO" # Intel ICH
snd_maestro_load="NO" # Maestro
snd_maestro3_load="NO" # Maestro3
@@ -297,6 +346,7 @@
snd_sb8_load="NO" # Sound Blaster Pro
snd_sbc_load="NO" # Sbc
snd_solo_load="NO" # Solo
+snd_spicds_load="NO" # SPI codecs
snd_t4dwave_load="NO" # t4dwave
snd_via8233_load="NO" # via8233
snd_via82c686_load="NO" # via82c686
@@ -370,3 +420,10 @@
#module_after="cmd" # executes "cmd" after loading the module
#module_error="cmd" # executes "cmd" if load fails
+##############################################################
+### Always try to load ZFS pool cache file #################
+##############################################################
+
+zpool_cache_load="YES"
+zpool_cache_type="/boot/zfs/zpool.cache"
+zpool_cache_name="/boot/zfs/zpool.cache"
Index: frames.4th
===================================================================
RCS file: /home/cvs/src/sys/boot/forth/frames.4th,v
retrieving revision 1.2
retrieving revision 1.3
diff -L sys/boot/forth/frames.4th -L sys/boot/forth/frames.4th -u -r1.2 -r1.3
--- sys/boot/forth/frames.4th
+++ sys/boot/forth/frames.4th
@@ -13,49 +13,26 @@
variable rb_el
variable fill
-s" arch-pc98" environment? [if]
- \ Single frames
- 149 constant sh_el
- 150 constant sv_el
- 152 constant slt_el
- 154 constant slb_el
- 153 constant srt_el
- 155 constant srb_el
- \ Double frames
- 149 constant dh_el
- 150 constant dv_el
- 152 constant dlt_el
- 154 constant dlb_el
- 153 constant drt_el
- 155 constant drb_el
- \ Fillings
- 0 constant fill_none
- 32 constant fill_blank
- 135 constant fill_dark
- 135 constant fill_med
- 135 constant fill_bright
-[else]
- \ Single frames
- 196 constant sh_el
- 179 constant sv_el
- 218 constant slt_el
- 192 constant slb_el
- 191 constant srt_el
- 217 constant srb_el
- \ Double frames
- 205 constant dh_el
- 186 constant dv_el
- 201 constant dlt_el
- 200 constant dlb_el
- 187 constant drt_el
- 188 constant drb_el
- \ Fillings
- 0 constant fill_none
- 32 constant fill_blank
- 176 constant fill_dark
- 177 constant fill_med
- 178 constant fill_bright
-[then]
+\ Single frames
+196 constant sh_el
+179 constant sv_el
+218 constant slt_el
+192 constant slb_el
+191 constant srt_el
+217 constant srb_el
+\ Double frames
+205 constant dh_el
+186 constant dv_el
+201 constant dlt_el
+200 constant dlb_el
+187 constant drt_el
+188 constant drb_el
+\ Fillings
+0 constant fill_none
+32 constant fill_blank
+176 constant fill_dark
+177 constant fill_med
+178 constant fill_bright
: hline ( len x y -- ) \ Draw horizontal single line
at-xy \ move cursor
Index: beastie.4th
===================================================================
RCS file: /home/cvs/src/sys/boot/forth/beastie.4th,v
retrieving revision 1.3
retrieving revision 1.4
diff -L sys/boot/forth/beastie.4th -L sys/boot/forth/beastie.4th -u -r1.3 -r1.4
--- sys/boot/forth/beastie.4th
+++ sys/boot/forth/beastie.4th
@@ -268,6 +268,7 @@
s" 0" s" hw.ata.atapi_dma" setenv
s" 0" s" hw.ata.wc" setenv
s" 0" s" hw.eisa_slots" setenv
+ s" 1" s" hint.kbdmux.0.disabled" setenv
0 boot
then
dup bootverbosekey @ = if
More information about the Midnightbsd-cvs
mailing list