From 68d770451811f1a9144cdbef19fce785d07f5f69 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Mon, 4 Dec 2017 14:00:00 +0200 Subject: [PATCH] 8888 loader: rename STAND to _STANDALONE Reviewed by: Yuri Pankov Reviewed by: Andrew Stormont Approved by: Dan McDonald --- usr/src/boot/sys/boot/efi/libefi/Makefile | 2 +- usr/src/boot/sys/boot/efi/loader/Makefile | 2 +- usr/src/boot/sys/boot/ficl/Makefile.inc | 3 +- usr/src/boot/sys/boot/i386/libi386/Makefile | 3 +- usr/src/boot/sys/boot/i386/loader/Makefile | 2 +- usr/src/boot/sys/boot/libstand/Makefile.com | 1 + usr/src/boot/sys/sys/errno.h | 2 +- usr/src/common/ficl/ficl.h | 6 ++-- usr/src/common/ficl/ficlplatform/unix.c | 2 +- usr/src/common/ficl/loader.c | 54 ++++++++++++++--------------- 10 files changed, 39 insertions(+), 38 deletions(-) diff --git a/usr/src/boot/sys/boot/efi/libefi/Makefile b/usr/src/boot/sys/boot/efi/libefi/Makefile index 228203f701..5845cf85b2 100644 --- a/usr/src/boot/sys/boot/efi/libefi/Makefile +++ b/usr/src/boot/sys/boot/efi/libefi/Makefile @@ -35,7 +35,7 @@ SRCS= delay.c devpath.c efi_console.c efinet.c efipart.c env.c errno.c \ OBJS= $(SRCS:%.c=%.o) -CPPFLAGS= -DTERM_EMU -DSTAND +CPPFLAGS= -DTERM_EMU -D_STANDALONE CFLAGS = -O2 #.if ${MACHINE_CPUARCH} == "aarch64" diff --git a/usr/src/boot/sys/boot/efi/loader/Makefile b/usr/src/boot/sys/boot/efi/loader/Makefile index 4baf9a2413..f535fe7fe9 100644 --- a/usr/src/boot/sys/boot/efi/loader/Makefile +++ b/usr/src/boot/sys/boot/efi/loader/Makefile @@ -62,7 +62,7 @@ CPPFLAGS += -DSMBIOS_LITTLE_ENDIAN_UUID LIBSTAND= ../../libstand/${MACHINE}/libstand.a BOOT_FORTH= yes -CPPFLAGS += -DBOOT_FORTH -DSTAND +CPPFLAGS += -DBOOT_FORTH -D_STANDALONE CPPFLAGS += -I$(SRC)/common/ficl CPPFLAGS += -I../../ficl LIBFICL= ../../ficl/${MACHINE}/libficl.a diff --git a/usr/src/boot/sys/boot/ficl/Makefile.inc b/usr/src/boot/sys/boot/ficl/Makefile.inc index dbf6508754..98f9671c00 100644 --- a/usr/src/boot/sys/boot/ficl/Makefile.inc +++ b/usr/src/boot/sys/boot/ficl/Makefile.inc @@ -20,7 +20,8 @@ FICLDIR= $(SRC)/common/ficl all: lib -CPPFLAGS= -DSTAND -I. -I.. -I../../../../include -I../../../../lib/libstand +CPPFLAGS= -D_STANDALONE -I. -I.. -I../../../../include +CPPFLAGS += -I../../../../lib/libstand CPPFLAGS += -I../../.. -I$(FICLDIR) -I../../common CFLAGS= -O2 -Wall -nostdinc diff --git a/usr/src/boot/sys/boot/i386/libi386/Makefile b/usr/src/boot/sys/boot/i386/libi386/Makefile index ee95aa3c61..439d3c63fa 100644 --- a/usr/src/boot/sys/boot/i386/libi386/Makefile +++ b/usr/src/boot/sys/boot/i386/libi386/Makefile @@ -17,8 +17,7 @@ include $(SRC)/Makefile.master CFLAGS= -O2 -I../../../../include -I../../.. -CFLAGS += -DLOADER_ZFS_SUPPORT -CPPFLAGS= -DSTAND +CPPFLAGS= -D_STANDALONE -DLOADER_ZFS_SUPPORT all: libi386.a diff --git a/usr/src/boot/sys/boot/i386/loader/Makefile b/usr/src/boot/sys/boot/i386/loader/Makefile index 1275085c18..47a24f16c3 100644 --- a/usr/src/boot/sys/boot/i386/loader/Makefile +++ b/usr/src/boot/sys/boot/i386/loader/Makefile @@ -18,7 +18,7 @@ include $(SRC)/Makefile.master include $(SRC)/boot/Makefile.version CFLAGS= -O2 -CPPFLAGS= -DSTAND -nostdinc -I../../../../include -I../../.. +CPPFLAGS= -D_STANDALONE -nostdinc -I../../../../include -I../../.. CPPFLAGS += -I$(SRC)/uts/intel/sys/acpi LOADER= zfsloader NEWVERSWHAT= "ZFS enabled bootstrap loader" x86 diff --git a/usr/src/boot/sys/boot/libstand/Makefile.com b/usr/src/boot/sys/boot/libstand/Makefile.com index 8594b787fd..9a7e717614 100644 --- a/usr/src/boot/sys/boot/libstand/Makefile.com +++ b/usr/src/boot/sys/boot/libstand/Makefile.com @@ -29,6 +29,7 @@ LIBSTAND_SRC= $(LIB_BASE)/libstand CPPFLAGS = -nostdinc -I../../../../include -I${LIBSTAND_SRC} -I../../.. CPPFLAGS += -I../../../sys -I. -I$(SRC)/common/bzip2 +CPPFLAGS += -D_STANDALONE CFLAGS = -O2 -ffreestanding -Wformat CFLAGS += -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float diff --git a/usr/src/boot/sys/sys/errno.h b/usr/src/boot/sys/sys/errno.h index d4c59504cc..db0bc95188 100644 --- a/usr/src/boot/sys/sys/errno.h +++ b/usr/src/boot/sys/sys/errno.h @@ -38,7 +38,7 @@ #ifndef _SYS_ERRNO_H_ #define _SYS_ERRNO_H_ -#ifndef _KERNEL +#if !defined(_KERNEL) && !defined(_STANDALONE) #include __BEGIN_DECLS int * __error(void); diff --git a/usr/src/common/ficl/ficl.h b/usr/src/common/ficl/ficl.h index 6db0c81833..b2c1ddc2f9 100644 --- a/usr/src/common/ficl/ficl.h +++ b/usr/src/common/ficl/ficl.h @@ -140,7 +140,7 @@ extern "C" { #endif -#ifdef STAND +#ifdef _STANDALONE #include #include #include @@ -1794,13 +1794,13 @@ FICL_PLATFORM_EXTERN long ficlFileSize(ficlFile *ff); #endif /* Support for linker set inclusions. */ -#ifdef STAND +#ifdef _STANDALONE typedef void ficlCompileFcn(ficlSystem *); #define FICL_COMPILE_SET(func) \ DATA_SET(Xficl_compile_set, func) SET_DECLARE(Xficl_compile_set, ficlCompileFcn); -#endif /* STAND */ +#endif /* _STANDALONE */ #ifdef __cplusplus } diff --git a/usr/src/common/ficl/ficlplatform/unix.c b/usr/src/common/ficl/ficlplatform/unix.c index ac49de5c2f..420ec02546 100644 --- a/usr/src/common/ficl/ficlplatform/unix.c +++ b/usr/src/common/ficl/ficlplatform/unix.c @@ -39,7 +39,7 @@ ficlCallbackDefaultTextOut(ficlCallback *callback, char *message) FICL_IGNORE(callback); if (message != NULL) { -#ifdef STAND +#ifdef _STANDALONE while (*message != 0) putchar((unsigned char)*(message++)); #else diff --git a/usr/src/common/ficl/loader.c b/usr/src/common/ficl/loader.c index 6726e1998e..be642c3b46 100644 --- a/usr/src/common/ficl/loader.c +++ b/usr/src/common/ficl/loader.c @@ -31,7 +31,7 @@ * Additional FICL words designed for FreeBSD's loader */ -#ifndef STAND +#ifndef _STANDALONE #include #include #include @@ -48,7 +48,7 @@ #endif #include "bootstrap.h" #endif -#ifdef STAND +#ifdef _STANDALONE #include #else #include @@ -186,7 +186,7 @@ ficlUnsetenv(ficlVm *pVM) void ficlCopyin(ficlVm *pVM) { -#ifdef STAND +#ifdef _STANDALONE void* src; vm_offset_t dest; size_t len; @@ -194,7 +194,7 @@ ficlCopyin(ficlVm *pVM) FICL_STACK_CHECK(ficlVmGetDataStack(pVM), 3, 0); -#ifdef STAND +#ifdef _STANDALONE len = ficlStackPopInteger(ficlVmGetDataStack(pVM)); dest = ficlStackPopInteger(ficlVmGetDataStack(pVM)); src = ficlStackPopPointer(ficlVmGetDataStack(pVM)); @@ -209,7 +209,7 @@ ficlCopyin(ficlVm *pVM) void ficlCopyout(ficlVm *pVM) { -#ifdef STAND +#ifdef _STANDALONE void* dest; vm_offset_t src; size_t len; @@ -217,7 +217,7 @@ ficlCopyout(ficlVm *pVM) FICL_STACK_CHECK(ficlVmGetDataStack(pVM), 3, 0); -#ifdef STAND +#ifdef _STANDALONE len = ficlStackPopInteger(ficlVmGetDataStack(pVM)); dest = ficlStackPopPointer(ficlVmGetDataStack(pVM)); src = ficlStackPopInteger(ficlVmGetDataStack(pVM)); @@ -232,7 +232,7 @@ ficlCopyout(ficlVm *pVM) void ficlFindfile(ficlVm *pVM) { -#ifdef STAND +#ifdef _STANDALONE char *name, *type; char *namep, *typep; int names, types; @@ -241,7 +241,7 @@ ficlFindfile(ficlVm *pVM) FICL_STACK_CHECK(ficlVmGetDataStack(pVM), 4, 1); -#ifdef STAND +#ifdef _STANDALONE types = ficlStackPopInteger(ficlVmGetDataStack(pVM)); typep = (char *)ficlStackPopPointer(ficlVmGetDataStack(pVM)); names = ficlStackPopInteger(ficlVmGetDataStack(pVM)); @@ -300,7 +300,7 @@ ficlUuidFromString(ficlVm *pVM) char *uuid_ptr; int uuid_size; uuid_t *u; -#ifdef STAND +#ifdef _STANDALONE uint32_t status; #else int status; @@ -318,7 +318,7 @@ ficlUuidFromString(ficlVm *pVM) uuid[uuid_size] = '\0'; u = ficlMalloc(sizeof (*u)); -#ifdef STAND +#ifdef _STANDALONE uuid_from_string(uuid, u, &status); ficlFree(uuid); if (status != uuid_s_ok) { @@ -341,14 +341,14 @@ ficlUuidToString(ficlVm *pVM) { char *uuid; uuid_t *u; -#ifdef STAND +#ifdef _STANDALONE uint32_t status; #endif FICL_STACK_CHECK(ficlVmGetDataStack(pVM), 1, 0); u = ficlStackPopPointer(ficlVmGetDataStack(pVM)); -#ifdef STAND +#ifdef _STANDALONE uuid_to_string(u, &uuid, &status); if (status == uuid_s_ok) { ficlStackPushPointer(ficlVmGetDataStack(pVM), uuid); @@ -476,7 +476,7 @@ pfopen(ficlVm *pVM) { int mode, fd, count; char *ptr, *name; -#ifndef STAND +#ifndef _STANDALONE char *tmp; #endif @@ -495,7 +495,7 @@ pfopen(ficlVm *pVM) name = (char *)malloc(count+1); bcopy(ptr, name, count); name[count] = 0; -#ifndef STAND +#ifndef _STANDALONE tmp = get_dev(name); free(name); name = tmp; @@ -552,7 +552,7 @@ pfread(ficlVm *pVM) */ static void pfopendir(ficlVm *pVM) { -#ifndef STAND +#ifndef _STANDALONE DIR *dir; char *tmp; #else @@ -576,7 +576,7 @@ static void pfopendir(ficlVm *pVM) name = (char *)malloc(count+1); bcopy(ptr, name, count); name[count] = 0; -#ifndef STAND +#ifndef _STANDALONE tmp = get_dev(name); free(name); name = tmp; @@ -602,7 +602,7 @@ static void pfopendir(ficlVm *pVM) ficlStackPushInteger(ficlVmGetDataStack(pVM), flag); return; #endif -#ifndef STAND +#ifndef _STANDALONE dir = opendir(name); if (dir == NULL) { ficlStackPushInteger(ficlVmGetDataStack(pVM), flag); @@ -622,7 +622,7 @@ static void pfopendir(ficlVm *pVM) static void pfreaddir(ficlVm *pVM) { -#ifndef STAND +#ifndef _STANDALONE static DIR *dir = NULL; #else int fd; @@ -634,7 +634,7 @@ pfreaddir(ficlVm *pVM) * libstand readdir does not always return . nor .. so filter * them out to have consistent behaviour. */ -#ifndef STAND +#ifndef _STANDALONE dir = ficlStackPopPointer(ficlVmGetDataStack(pVM)); if (dir != NULL) do { @@ -675,7 +675,7 @@ pfreaddir(ficlVm *pVM) static void pfclosedir(ficlVm *pVM) { -#ifndef STAND +#ifndef _STANDALONE DIR *dir; #else int fd; @@ -683,7 +683,7 @@ pfclosedir(ficlVm *pVM) FICL_STACK_CHECK(ficlVmGetDataStack(pVM), 1, 0); -#ifndef STAND +#ifndef _STANDALONE dir = ficlStackPopPointer(ficlVmGetDataStack(pVM)); /* get dir */ if (dir != NULL) closedir(dir); @@ -771,7 +771,7 @@ key(ficlVm *pVM) static void keyQuestion(ficlVm *pVM) { -#ifndef STAND +#ifndef _STANDALONE char ch = -1; struct termios oldt; struct termios newt; @@ -779,7 +779,7 @@ keyQuestion(ficlVm *pVM) FICL_STACK_CHECK(ficlVmGetDataStack(pVM), 0, 1); -#ifndef STAND +#ifndef _STANDALONE tcgetattr(STDIN_FILENO, &oldt); newt = oldt; newt.c_lflag &= ~(ICANON | ECHO); @@ -828,7 +828,7 @@ ms(ficlVm *pVM) { FICL_STACK_CHECK(ficlVmGetDataStack(pVM), 1, 0); -#ifndef STAND +#ifndef _STANDALONE usleep(ficlStackPopUnsigned(ficlVmGetDataStack(pVM)) * 1000); #else delay(ficlStackPopUnsigned(ficlVmGetDataStack(pVM)) * 1000); @@ -853,7 +853,7 @@ fkey(ficlVm *pVM) } -#ifdef STAND +#ifdef _STANDALONE #ifdef __i386__ /* @@ -907,7 +907,7 @@ ficlSystemCompilePlatform(ficlSystem *pSys) { ficlDictionary *dp = ficlSystemGetDictionary(pSys); ficlDictionary *env = ficlSystemGetEnvironment(pSys); -#ifdef STAND +#ifdef _STANDALONE ficlCompileFcn **fnpp; #endif @@ -953,7 +953,7 @@ ficlSystemCompilePlatform(ficlSystem *pSys) FICL_WORD_DEFAULT); ficlDictionarySetPrimitive(dp, "uuid-to-string", ficlUuidToString, FICL_WORD_DEFAULT); -#ifdef STAND +#ifdef _STANDALONE #ifdef __i386__ ficlDictionarySetPrimitive(dp, "outb", ficlOutb, FICL_WORD_DEFAULT); ficlDictionarySetPrimitive(dp, "inb", ficlInb, FICL_WORD_DEFAULT); -- 2.11.4.GIT