From 1008ef70a71fcfdec398ff30923d5025991c85f4 Mon Sep 17 00:00:00 2001 From: Shakeeb Date: Wed, 31 Aug 2016 15:15:19 -0500 Subject: SBE code restructure: cleanup Change-Id: I354cc79ba25b843fdb1a7524a19b8d0c41bd9051 RTC:159709 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/29060 Tested-by: Jenkins Server Reviewed-by: Sachin Gupta Reviewed-by: AMIT J. TENDOLKAR --- src/build/Makefile | 89 ++--- src/build/base_ppe_header.S | 209 ----------- src/build/base_sbe_fixed.S | 67 ---- src/build/buildInfo.py | 3 +- src/build/img_defs.mk | 20 +- src/build/linkerscripts/linkloader.cmd | 3 +- src/build/linkerscripts/linksbe.cmd | 3 +- src/build/linkerscripts/linkseeprom.cmd | 3 +- src/build/p9_sbe.H | 52 --- src/build/parsAndCutElf.py | 6 +- src/build/proc_sbe_fixed.H | 211 ----------- src/build/sbe_common.H | 600 -------------------------------- src/build/sbe_link.H | 102 ------ src/build/topfiles.mk | 3 +- src/build/utils/Makefile | 43 +++ src/build/utils/base_ppe_header.S | 209 +++++++++++ src/build/utils/base_sbe_fixed.S | 67 ++++ src/build/utils/p9_sbe.H | 52 +++ src/build/utils/proc_sbe_fixed.H | 211 +++++++++++ src/build/utils/sbe_common.H | 600 ++++++++++++++++++++++++++++++++ src/build/utils/sbe_link.H | 102 ++++++ src/build/utils/utils.mk | 27 ++ 22 files changed, 1388 insertions(+), 1294 deletions(-) delete mode 100644 src/build/base_ppe_header.S delete mode 100644 src/build/base_sbe_fixed.S delete mode 100644 src/build/p9_sbe.H delete mode 100644 src/build/proc_sbe_fixed.H delete mode 100644 src/build/sbe_common.H delete mode 100644 src/build/sbe_link.H create mode 100644 src/build/utils/Makefile create mode 100644 src/build/utils/base_ppe_header.S create mode 100644 src/build/utils/base_sbe_fixed.S create mode 100644 src/build/utils/p9_sbe.H create mode 100644 src/build/utils/proc_sbe_fixed.H create mode 100644 src/build/utils/sbe_common.H create mode 100644 src/build/utils/sbe_link.H create mode 100644 src/build/utils/utils.mk (limited to 'src/build') diff --git a/src/build/Makefile b/src/build/Makefile index 89473e73..23bae9e7 100644 --- a/src/build/Makefile +++ b/src/build/Makefile @@ -27,7 +27,8 @@ #Pull in the definitions that affect all makefiles for this image include img_defs.mk -include ../boot/bootfiles.mk +include $(BOOT_SRCDIR)/bootfiles.mk +include $(BUILDDATA_SRCDIR)/utils.mk #Pull in object file names for the top directory include topfiles.mk @@ -38,6 +39,7 @@ PKLIB := $(OBJDIR)/pk/libpk.a LLIBS += -lpk SUBDIRS += $(BOOT_SRCDIR) +SUBDIRS += $(BUILDDATA_SRCDIR) SUBDIRS += ../sbefw LIB_DIRS += -L$(OBJDIR)/sbefw @@ -102,22 +104,23 @@ LIB_DIRS += -L$(OBJDIR)/pm PMLIB := $(OBJDIR)/pm/libpm.a LLIBS += -lpm -SIMICS_PPE_TAR_FILES += $(OBJDIR)/$(IMAGE_SBE_NAME).out -SIMICS_PPE_TAR_FILES += $(OBJDIR)/$(IMAGE_SBE_NAME).map -SIMICS_PPE_TAR_FILES += $(OBJDIR)/$(IMAGE_SBE_NAME).dis +SIMICS_PPE_TAR_FILES += $(IMG_DIR)/$(IMAGE_SBE_NAME).out +SIMICS_PPE_TAR_FILES += $(IMG_DIR)/$(IMAGE_SBE_NAME).map +SIMICS_PPE_TAR_FILES += $(IMG_DIR)/$(IMAGE_SBE_NAME).dis SIMICS_PPE_TAR_FILES += $(BOOT_OBJDIR)/$(IMAGE_LOADER_NAME).out SIMICS_PPE_TAR_FILES += $(BOOT_OBJDIR)/$(IMAGE_LOADER_NAME).map SIMICS_PPE_TAR_FILES += $(BOOT_OBJDIR)/$(IMAGE_LOADER_NAME).dis -SIMICS_PPE_TAR_FILES += $(OBJDIR)/$(IMAGE_SEEPROM_NAME).out -SIMICS_PPE_TAR_FILES += $(OBJDIR)/$(IMAGE_SEEPROM_NAME).map -SIMICS_PPE_TAR_FILES += $(OBJDIR)/$(IMAGE_SEEPROM_NAME).dis +SIMICS_PPE_TAR_FILES += $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).out +SIMICS_PPE_TAR_FILES += $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).map +SIMICS_PPE_TAR_FILES += $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).dis SIMICS_PPE_TAR_FILES += $(IMG_DIR)/sbe.syms SIMICS_PPE_TAR_FILES += $(TEST_SRCDIR)/*.xml SIMICS_PPE_TAR_FILES += $(TEST_SRCDIR)/*.py SIMICS_PPE_TAR_FILES += $(PPETRACEPP_DIR)/fsp-trace SIMICS_PPE_TAR_FILES += $(IMG_DIR)/sbeStringFile -SIMICS_PPE_TAR_FILES += $(OBJDIR)/ppe2fsp +SIMICS_PPE_TAR_FILES += $(PPETRACEPP_BIN_DIR)/ppe2fsp SIMICS_BB_TAR_FILES += $(SIMICSTOOLS_SRCDIR)/* +SIMICS_BB_TAR_FILES += $(DEBUGTOOLS_SRCDIR)/simics-debug-framework.py SIMICS_PPETRACEPP_TAR_FILES += $(PPETRACEPP_DIR)/cmvc/makefile SIMICS_PPETRACEPP_TAR_FILES += $(PPETRACEPP_DIR)/ppe2fsp.h SIMICS_PPETRACEPP_TAR_FILES += $(PPETRACEPP_DIR)/ppe2fsp.c @@ -127,7 +130,7 @@ SIMICS_PPETRACEPP_TAR_FILES += $(PK_SRCDIR)/trace/pk_trace.h SIMICS_PARSERPLUGINS_TAR_FILES += $(SBE_FW_DIR)/plugins/sbeUserDataParser.C SIMICS_PARSERPLUGINS_TAR_FILES += $(SBE_FW_DIR)/sbeFFDCType.H -SBE_TOOLS := $(BASE_OBJDIR)/sbe_default_tool +SBE_TOOLS := $(IMG_DIR)/sbe_default_tool P9_XIP_TOOL := $(P9_XIP_BINDIR)/p9_xip_tool @@ -137,45 +140,45 @@ LINK_OBJS = $(OBJS) OBJS := $(addprefix $(OBJDIR)/, $(TOP_OBJECTS)) LINK_OBJS += $(OBJS) $(GCCLIBS) -LINK_SCRIPT_SEEPROM = $(addprefix $(OBJDIR)/, linkscriptseeprom) -LINK_SCRIPT_SBE = $(addprefix $(OBJDIR)/, linkscriptsbe) +LINK_SCRIPT_SEEPROM = $(addprefix $(OBJDIR)/build/linkerscripts, linkscriptseeprom) +LINK_SCRIPT_SBE = $(addprefix $(OBJDIR)/build/linkerscripts, linkscriptsbe) # ---- SEEPROM Image ------ # This removes all unecessary headers from the ELF executable -$(IMG_DIR)/$(IMAGE_SEEPROM_NAME).bin $(OBJDIR)/$(IMAGE_SEEPROM_NAME).dis: $(OBJDIR)/$(IMAGE_SEEPROM_NAME).out +$(IMG_DIR)/$(IMAGE_SEEPROM_NAME).bin $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).dis: $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).out ./parsAndCutElf.py - $(OBJDUMP) -S $< > $(OBJDIR)/$(IMAGE_SEEPROM_NAME).dis + $(OBJDUMP) -S $< > $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).dis #create a linked ELF executable -$(OBJDIR)/$(IMAGE_SEEPROM_NAME).out: ppe_trace_bin buildInfo $(SUBDIRS) $(LINK_OBJS) $(LINK_SCRIPT_SEEPROM) - $(LD) -n -T$(LINK_SCRIPT_SEEPROM) -Map $(OBJDIR)/$(IMAGE_SEEPROM_NAME).map \ - -Bstatic -o $(OBJDIR)/$(IMAGE_SEEPROM_NAME).out $(BOOT_OBJDIR)/$(BOOT_OBJECTS) $(OBJS) $(LIB_DIRS) \ +$(IMG_DIR)/$(IMAGE_SEEPROM_NAME).out: ppe_trace_bin buildInfo $(SUBDIRS) $(LINK_OBJS) $(LINK_SCRIPT_SEEPROM) + $(LD) -n -T$(LINK_SCRIPT_SEEPROM) -Map $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).map \ + -Bstatic -o $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).out $(BOOT_OBJDIR)/$(BOOT_OBJECTS) $(BUILDDATA_OBJDIR)/base_ppe_header.o $(OBJS) $(LIB_DIRS) \ --start-group $(LLIBS) --end-group -leabi -lmath -lc # pass the link command file through the C preprocessor to evaluate macros # and remove comments $(LINK_SCRIPT_SEEPROM): $(LINKER_DIR)/linkseeprom.cmd - $(CPP) -I. -E -x c++ -P $(DEFS) $(LINKER_DIR)/linkseeprom.cmd -o $(LINK_SCRIPT_SEEPROM) + $(CPP) -I $(INCLUDES) -E -x c++ -P $(DEFS) $(LINKER_DIR)/linkseeprom.cmd -o $(LINK_SCRIPT_SEEPROM) # ---- PIBMEM Image ------ #This removes all unecessary headers from the ELF executable -$(IMG_DIR)/$(IMAGE_SBE_NAME).bin $(OBJDIR)/$(IMAGE_SBE_NAME).dis: $(OBJDIR)/$(IMAGE_SBE_NAME).out +$(IMG_DIR)/$(IMAGE_SBE_NAME).bin $(IMG_DIR)/$(IMAGE_SBE_NAME).dis: $(IMG_DIR)/$(IMAGE_SBE_NAME).out $(OBJCOPY) -O binary $< $(IMG_DIR)/$(IMAGE_SBE_NAME).bin --pad-to \ - 0x`/usr/bin/nm $(OBJDIR)/$(IMAGE_SBE_NAME).out | grep "A _sbe_end" \ + 0x`/usr/bin/nm $(IMG_DIR)/$(IMAGE_SBE_NAME).out | grep "A _sbe_end" \ | cut -d " " -f 1` - $(OBJDUMP) -S $< > $(OBJDIR)/$(IMAGE_SBE_NAME).dis + $(OBJDUMP) -S $< > $(IMG_DIR)/$(IMAGE_SBE_NAME).dis $(NM) $< > $(IMG_DIR)/$(IMAGE_SBE_NAME).syms # create a linked ELF executable -$(OBJDIR)/$(IMAGE_SBE_NAME).out: ppe_trace_bin buildInfo $(OBJDIR)/base_sbe_fixed.o $(SUBDIRS) $(LINK_OBJS) $(LINK_SCRIPT_SBE) - $(LD) -e __system_reset -T$(LINK_SCRIPT_SBE) -Map $(OBJDIR)/$(IMAGE_SBE_NAME).map -Bstatic -o $(OBJDIR)/$(IMAGE_SBE_NAME).out $(LIB_DIRS) $(OBJDIR)/base_sbe_fixed.o --start-group $(LLIBS) --end-group +$(IMG_DIR)/$(IMAGE_SBE_NAME).out: ppe_trace_bin buildInfo $(SUBDIRS) $(LINK_OBJS) $(LINK_SCRIPT_SBE) + $(LD) -e __system_reset -T$(LINK_SCRIPT_SBE) -Map $(IMG_DIR)/$(IMAGE_SBE_NAME).map -Bstatic -o $(IMG_DIR)/$(IMAGE_SBE_NAME).out $(LIB_DIRS) $(BUILDDATA_OBJDIR)/base_sbe_fixed.o --start-group $(LLIBS) --end-group # pass the link command file through the C preprocessor to evaluate macros and remove comments $(LINK_SCRIPT_SBE): $(LINKER_DIR)/linksbe.cmd - $(CPP) -E -x c++ -I. -P $(DEFS) $(LINKER_DIR)/linksbe.cmd -o $(LINK_SCRIPT_SBE) + $(CPP) -E -x c++ -I $(INCLUDES) -P $(DEFS) $(LINKER_DIR)/linksbe.cmd -o $(LINK_SCRIPT_SBE) -all: $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).bin $(IMG_DIR)/$(IMAGE_SBE_NAME).bin \ - $(SBE_TOOLS) normalize defaultset $(OBJDIR)/fixed.bin appendloader \ +all: $(OBJDIR) xml $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).bin $(IMG_DIR)/$(IMAGE_SBE_NAME).bin \ + $(SBE_TOOLS) normalize defaultset $(IMG_DIR)/fixed.bin appendloader \ appendoverrides add_LoaderAddr symbols tracehash buildinfo report install: all @@ -188,9 +191,9 @@ install: all @cp $(SIMICS_BB_TAR_FILES) $(OBJDIR)/simics-tar-dir @cp $(SIMICS_PPETRACEPP_TAR_FILES) $(OBJDIR)/simics-tar-dir/ppetracepp @cp $(SIMICS_PARSERPLUGINS_TAR_FILES) $(OBJDIR)/simics-tar-dir/parserplugins - @cd $(OBJDIR)/simics-tar-dir && tar -cvf simics.tar * && mv simics.tar $(OBJDIR) && cd .. + @cd $(OBJDIR)/simics-tar-dir && tar -cvf simics.tar * && mv simics.tar $(IMG_DIR) && cd .. @rm -rf $(OBJDIR)/simics-tar-dir - @echo "Generated simics.tar in Sbe Obj Directory" + @echo "Generated simics.tar in Sbe images Directory" .PHONY: all normalize defaultset appendloader add_LoaderAddr symbols report \ appendoverrides xml tracehash topfixedheaders $(SUBDIRS) @@ -201,13 +204,13 @@ buildinfo: $(P9_XIP_TOOL) $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).bin $(P9_XIP_TOOL) $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).bin set build_user `id -un` $(P9_XIP_TOOL) $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).bin set build_host `hostname` -add_LoaderAddr: $(P9_XIP_TOOL) $(OBJDIR)/$(IMAGE_SEEPROM_NAME).out - $(P9_XIP_TOOL) $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).bin set L1_LoaderAddr 0x`nm $(OBJDIR)/$(IMAGE_SEEPROM_NAME).out | grep __pmLoader | cut -f 1 -d " "` +add_LoaderAddr: $(P9_XIP_TOOL) $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).out + $(P9_XIP_TOOL) $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).bin set L1_LoaderAddr 0x`nm $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).out | grep __pmLoader | cut -f 1 -d " "` $(P9_XIP_TOOL) $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).bin set L2_LoaderAddr 0x`nm $(BOOT_OBJDIR)/$(IMAGE_LOADER_NAME).out | grep __base_loader_setup | cut -f 1 -d " "` - $(P9_XIP_TOOL) $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).bin set kernelAddr 0x`nm $(OBJDIR)/$(IMAGE_SEEPROM_NAME).out | grep __pk_boot | cut -f 1 -d " "` + $(P9_XIP_TOOL) $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).bin set kernelAddr 0x`nm $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).out | grep __pk_boot | cut -f 1 -d " "` -symbols: $(OBJDIR)/$(IMAGE_SEEPROM_NAME).out $(BOOT_OBJDIR)/$(IMAGE_LOADER_NAME).out $(OBJDIR)/$(IMAGE_SBE_NAME).out - $(NM) $(OBJDIR)/$(IMAGE_SEEPROM_NAME).out > $(IMG_DIR)/$(SBE_SYMBOLS_NAME) +symbols: $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).out $(BOOT_OBJDIR)/$(IMAGE_LOADER_NAME).out $(IMG_DIR)/$(IMAGE_SBE_NAME).out + $(NM) $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).out > $(IMG_DIR)/$(SBE_SYMBOLS_NAME) $(NM) $(BOOT_OBJDIR)/$(IMAGE_LOADER_NAME).out >> $(IMG_DIR)/$(SBE_SYMBOLS_NAME) report: $(P9_XIP_TOOL) $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).bin @@ -219,7 +222,7 @@ buildInfo: #Create an obj directory if needed -$(LINK_OBJS) $(OBJS) $(OBJS:.o=.d) $(OBJDIR)/base_sbe_fixed.o $(OBJDIR)/base_sbe_fixed.d: | $(OBJDIR) +$(LINK_OBJS) $(OBJS) $(OBJS:.o=.d) ATTRFILES += $(IMPORT_XML_DIR)/attribute_info/pervasive_attributes.xml # TODO via RTC 142708 @@ -235,12 +238,13 @@ ATTRFILES += $(BASE_FAPI2_DIR)/xml/attribute_info/chip_attributes.xml ATTRFILES += $(IMPORT_XML_DIR)/attribute_info/chip_ec_attributes.xml $(OBJDIR): + mkdir -p $(OBJDIR) + mkdir -p $(IMG_DIR) + mkdir -p $(OBJDIR)/genfiles $(TOOLS_ATTR_DIR)/ppeParseProcSbeFixed.pl . $(IMPORT_XML_DIR)/attribute_info/p9_sbe_attributes.xml $(ATTRFILES) $(TOOLS_ATTR_DIR)/ppeParseAttributeInfo.pl $(PLAT_FAPI2_DIR)/include $(IMPORT_XML_DIR)/attribute_info/p9_sbe_attributes.xml $(ATTRFILES) $(TOOLS_ATTR_DIR)/ppeCreateAttrGetSetMacros.pl --path $(TOOLS_ATTR_DIR)/src --inc $(PLAT_FAPI2_DIR)/include --src $(PLAT_FAPI2_DIR)/src $(TOOLS_ATTR_DIR)/ppeCreateIfAttrService.pl $(PLAT_FAPI2_DIR)/include $(IMPORT_XML_DIR)/attribute_info/p9_sbe_attributes.xml $(ATTRFILES) - mkdir -p $(OBJDIR) - mkdir -p $(IMG_DIR) topfixedheaders: $(TOOLS_ATTR_DIR)/ppeParseProcSbeFixed.pl . $(IMPORT_XML_DIR)/attribute_info/p9_sbe_attributes.xml $(ATTRFILES) @@ -258,26 +262,27 @@ attrserv: # Build the subdirectories $(SUBDIRS): - $(MAKE) -I $(BUILD_DIR) -C $@ -f Makefile + $(MAKE) -I $(INCLUDES) -C $@ -f Makefile #Build the SBE XIP Tools $(SBE_TOOLS): $(P9_XIP_TOOL) - $(MAKE) -I $(BUILD_DIR) -C $(TOOLS_IMAGE_DIR) -f Makefile + $(MAKE) -I $(INCLUDES) -C $(TOOLS_IMAGE_DIR) -f Makefile # Build the P9-XIP Tool $(P9_XIP_TOOL): $(MAKE) -I $(P9_XIP_SRCDIR) -C $(P9_XIP_SRCDIR) -f Makefile BINDIR=$(P9_XIP_BINDIR) + cp $(P9_XIP_TOOL) $(IMG_DIR)/ normalize: $(P9_XIP_TOOL) $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).bin $(P9_XIP_TOOL) $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).bin normalize -defaultset: $(SBE_TOOLS) $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).bin normalize - $(TOOLS_ATTR_DIR)/ppeSetFixed.pl $(BASE_OBJDIR) $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).bin $(IMPORT_XML_DIR)/attribute_info/p9_sbe_attributes.xml $(ATTRFILES) +defaultset:$(SBE_TOOLS) $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).bin normalize + $(TOOLS_ATTR_DIR)/ppeSetFixed.pl $(IMG_DIR) $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).bin $(IMPORT_XML_DIR)/attribute_info/p9_sbe_attributes.xml $(ATTRFILES) # Build the trace utilities ppe_trace_bin: - $(MAKE) -I $(BUILD_DIR) -C $(PPETRACEPP_DIR) -f Makefile #$(PK trace util) + $(MAKE) -I $(INCLUDES) -C $(PPETRACEPP_DIR) -f Makefile #$(PK trace util) # Build hwp_error_info.H. If the script fails then print the contents of @@ -290,8 +295,8 @@ xml: $(FAPI_RC) $(FAPI_RC): $(TOOLS_ATTR_DIR)/parseErrorInfo.pl $(ERROR_XML_FILES) $(TOOLS_ATTR_DIR)/parseErrorInfo.pl --local-ffdc --output-dir=. $(ERROR_XML_FILES) -$(OBJDIR)/fixed.bin: $(P9_XIP_TOOL) $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).bin - $(P9_XIP_TOOL) $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).bin extract .fixed $(BASE_OBJDIR)/fixed.bin +$(IMG_DIR)/fixed.bin: $(P9_XIP_TOOL) $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).bin + $(P9_XIP_TOOL) $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).bin extract .fixed $(IMG_DIR)/fixed.bin appendloader: $(P9_XIP_TOOL) $(IMG_DIR)/$(IMAGE_SEEPROM_NAME).bin $(IMG_DIR)/$(IMAGE_LOADER_NAME).bin diff --git a/src/build/base_ppe_header.S b/src/build/base_ppe_header.S deleted file mode 100644 index b68b9214..00000000 --- a/src/build/base_ppe_header.S +++ /dev/null @@ -1,209 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/build/base_ppe_header.S $ */ -/* */ -/* OpenPOWER sbe Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2016 */ -/* */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* IBM_PROLOG_END_TAG */ -//----------------------------------------------------------------------------- -// *! (C) Copyright International Business Machines Corp. 2014 -// *! All Rights Reserved -- Property of IBM -// *! *** IBM Confidential *** -//----------------------------------------------------------------------------- - -/// \file base_ppe_header.S -/// \brief code to create header, toc, strings, fixed and fixed_toc sections -/// -/// function P9XipHeader creates header section, function .proc_sbe_fixed -/// creates fixed, fixed_toc sections -#include "p9_xip_image.h" -#include "proc_sbe_fixed.H" - - -#define IMAGE_SPACE_UNDEFINED 0xffff -#define IMAGE_SPACE_OCI 0x8000 -#define IMAGE_SPACE_PNOR 0x800b -#define IMAGE_SPACE_OTPROM 0x0001 -#define IMAGE_SPACE_SEEPROM 0x800c -#define IMAGE_SPACE_BASE 0x0008 - - - - .macro ..checku, x:req, bits:req, err="Unsigned value too large" - - .if (((\bits) <= 0) || ((\bits) > 63)) - .error "The number of bits must be in the range 0 < bits < 64" - .endif - - .iflt (\x) - .error "An unsigned value is required here" - .endif - - .ifgt ((\x) - (0xffffffffffffffff >> (64 - (\bits)))) - .error "\err" - .endif - - .endm - - .macro ..check_u16, u16 - ..checku (\u16), 16, "Unsigned immediate is larger than 16 bits" - .endm - - - .macro ..set_default_space, s - ..check_u16 (\s) - .set _PGAS_DEFAULT_SPACE, (\s) - .endm - - .macro ..check_default_space - .if (_PGAS_DEFAULT_SPACE == IMAGE_SPACE_UNDEFINED) - .error "The PGAS default address space has not been defined" - .endif - .endm - - - .macro .quada, offset:req - ..check_default_space - .long _PGAS_DEFAULT_SPACE - .long (\offset) - .endm - - - .macro P9XipHeader, magic, link_address, entry_point, image_size - - .section .header, "a", @progbits - - - ////////////////////////////////////////////////////////////////////// - // Identification - 8-byte aligned; 8 Entries; TOC-Indexed - ////////////////////////////////////////////////////////////////////// - -__magic: - .quad (\magic) -__L1_LoaderAddr: - .quad 0 -__L2_LoaderAddr: - .quad 0 -__kernelAddr: - .quad 0 -__link_address: - .quada (\link_address) -__header_64_reserved: - .quad 0, 0, 0 - - .xip_toc magic, P9_XIP_UINT64, __magic - .xip_toc L1_LoaderAddr, P9_XIP_UINT64, __L1_LoaderAddr - .xip_toc L2_LoaderAddr, P9_XIP_UINT64, __L2_LoaderAddr - .xip_toc kernelAddr, P9_XIP_UINT64, __kernelAddr - .xip_toc link_address, P9_XIP_UINT64, __link_address - - ////////////////////////////////////////////////////////////////////// - // Section Table - Not TOC-Indexed - ////////////////////////////////////////////////////////////////////// - - .xip_section header - .xip_section fixed, 8 - .xip_section fixed_toc, 8 - .xip_section toc, 4 - .xip_section strings - .xip_section loader_text, 4 - .xip_section loader_data, 8, empty=1 - .xip_section text, 4 - .xip_section data, 8, empty=1 - .xip_section base, 4 - .xip_section baseloader, 8, empty=1 - .xip_section overrides, 8, empty=1 - .xip_section rings, 8, empty=1 - .xip_section overlay, 8, empty=1 - .xip_section hbbl, 8, empty=1 - - - ////////////////////////////////////////////////////////////////////// - // Other Information - 4-byte aligned; 8 entries; TOC-Indexed - ////////////////////////////////////////////////////////////////////// - -__image_size: - .long (\image_size) -__build_date: - .long 0 -__build_time: - .long 0 -__header_32_reserved: - .long 0, 0, 0, 0, 0 - - .xip_toc image_size, P9_XIP_UINT32, __image_size - .xip_toc build_date, P9_XIP_UINT32, __build_date - .xip_toc build_time, P9_XIP_UINT32, __build_time - - - ////////////////////////////////////////////////////////////////////// - // Other Information - 1-byte aligned; 8 entries; TOC-Indexed - ////////////////////////////////////////////////////////////////////// - -__header_version: - .byte P9_XIP_HEADER_VERSION -__toc_normalized: - .byte 0 -__toc_sorted: - .byte 0 -__header_8_reserved: - .byte 0, 0, 0, 0, 0 - - .xip_toc header_version, P9_XIP_UINT8, __header_version - .xip_toc toc_normalized, P9_XIP_UINT8, __toc_normalized - .xip_toc toc_sorted, P9_XIP_UINT8, __toc_sorted - - - ////////////////////////////////////////////////////////////////////// - // Strings; 64 characters allocated; TOC-Indexed - ////////////////////////////////////////////////////////////////////// - -__build_user: - .asciz "unknown " # 16 Characters allocated -__build_host: - .asciz "unknown " # 24 characters allocated -__header_string_reserved: - .space 24, 0 - - .xip_toc build_user, P9_XIP_STRING, __build_user - .xip_toc build_host, P9_XIP_STRING, __build_host - - - .endm - - - .section .fixed, "a", @progbits - .section .fixed_toc, "a", @progbits - .section .loader_data, "a", @progbits - .section .loader_text, "a", @progbits - - .section .toc, "a", @progbits - .section .strings, "aS", @progbits - .section .base, "a", @progbits - - ..set_default_space IMAGE_SPACE_SEEPROM - P9XipHeader P9_XIP_MAGIC_SEEPROM, 0x80000000, 0x00000000, _sbe_image_size - - // Create the .fixed section - .proc_sbe_fixed_system - .proc_sbe_fixed_proc_chip - .proc_sbe_fixed_perv - .proc_sbe_fixed_core - .proc_sbe_fixed_ex - .proc_sbe_fixed_eq diff --git a/src/build/base_sbe_fixed.S b/src/build/base_sbe_fixed.S deleted file mode 100644 index e1a53f84..00000000 --- a/src/build/base_sbe_fixed.S +++ /dev/null @@ -1,67 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/build/base_sbe_fixed.S $ */ -/* */ -/* OpenPOWER sbe Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2016 */ -/* */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* IBM_PROLOG_END_TAG */ -/// \file sbefixed.S -/// \brief code to generated fixed section in pibmem image -/// -#include "p9_xip_image.h" -#include "proc_sbe_fixed.H" - - - .macro ..checku, x:req, bits:req, err="Unsigned value too large" - - .if (((\bits) <= 0) || ((\bits) > 63)) - .error "The number of bits must be in the range 0 < bits < 64" - .endif - - .iflt (\x) - .error "An unsigned value is required here" - .endif - - .ifgt ((\x) - (0xffffffffffffffff >> (64 - (\bits)))) - .error "\err" - .endif - - .endm - - - .macro ..check_u16, u16 - ..checku (\u16), 16, "Unsigned immediate is larger than 16 bits" - .endm - - - .macro ..set_default_space, s - ..check_u16 (\s) - .set _PGAS_DEFAULT_SPACE, (\s) - .endm - - .section .fixed, "a", @progbits - - - // Create the .fixed section - .proc_sbe_fixed_system - .proc_sbe_fixed_proc_chip - .proc_sbe_fixed_perv - .proc_sbe_fixed_core - .proc_sbe_fixed_ex - .proc_sbe_fixed_eq diff --git a/src/build/buildInfo.py b/src/build/buildInfo.py index f7b109e4..4350e682 100755 --- a/src/build/buildInfo.py +++ b/src/build/buildInfo.py @@ -7,6 +7,7 @@ # OpenPOWER sbe Project # # Contributors Listed Below - COPYRIGHT 2016 +# [+] International Business Machines Corp. # # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -26,7 +27,7 @@ # This script will create header file sbe_build_info.H which will have # buld information required by SBE code. import os -buildInfoFileName = "sbe_build_info.H" +buildInfoFileName = "../../obj/genfiles/sbe_build_info.H" def buildInfo(): header = \ diff --git a/src/build/img_defs.mk b/src/build/img_defs.mk index 8d7b4184..b14ca419 100644 --- a/src/build/img_defs.mk +++ b/src/build/img_defs.mk @@ -83,6 +83,10 @@ ifndef BUILD_DIR export BUILD_DIR = $(SBE_SRC_DIR)/build endif +ifndef BUILDDATA_SRCDIR +export BUILDDATA_SRCDIR = $(BUILD_DIR)/utils +endif + ifndef LINKER_DIR export LINKER_DIR = $(BUILD_DIR)/linkerscripts endif @@ -100,7 +104,7 @@ export TOOLS_SRCDIR = $(SBE_SRC_DIR)/tools endif ifndef TEST_SRCDIR -export TEST_SRCDIR = $(SBE_SRC_DIR)/test +export TEST_SRCDIR = $(SBE_SRC_DIR)/test/testcases endif ifndef DEBUGTOOLS_SRCDIR @@ -171,6 +175,10 @@ ifndef BOOT_OBJDIR export BOOT_OBJDIR = $(BASE_OBJDIR)/boot endif +ifndef BUILDDATA_OBJDIR +export BUILDDATA_OBJDIR = $(BASE_OBJDIR)/build/utils +endif + ifndef IMG_DIR export IMG_DIR = $(SBE_ROOT_DIR)/images endif @@ -201,11 +209,15 @@ export IMPORT_COMMON_DIR = $(IMPORT_SRCDIR)/chips/p9/common endif ifndef PPETRACEPP_DIR -export PPETRACEPP_DIR = $(TOOLS_SRCDIR)/ppetracepp +export PPETRACEPP_DIR = $(TOOLS_SRCDIR)/trace endif ifndef PPETRACEPP_BIN_DIR -export PPETRACEPP_BIN_DIR = $(BASE_OBJDIR) +export PPETRACEPP_BIN_DIR = $(IMG_DIR) +endif + +ifndef GENFILES_DIR +export GENFILES_DIR = $(BASE_OBJDIR)/genfiles endif ifndef PLAT_FAPI2_DIR @@ -358,6 +370,8 @@ INCLUDES += -I$(PK_SRCDIR)/ppe INCLUDES += -I$(PK_SRCDIR)/ppe42 INCLUDES += -I$(SBE_FW_DIR) INCLUDES += -I$(BOOT_SRCDIR) +INCLUDES += -I$(GENFILES_DIR) +INCLUDES += -I$(BUILDDATA_SRCDIR) INCLUDES += -I$(PK_SRCDIR)/trace INCLUDES += -I$(PPETRACEPP_DIR) INCLUDES += -I$(IMPORT_COMMON_DIR)/include diff --git a/src/build/linkerscripts/linkloader.cmd b/src/build/linkerscripts/linkloader.cmd index 75c460d4..1e2a20e3 100755 --- a/src/build/linkerscripts/linkloader.cmd +++ b/src/build/linkerscripts/linkloader.cmd @@ -6,6 +6,7 @@ /* OpenPOWER sbe Project */ /* */ /* Contributors Listed Below - COPYRIGHT 2015,2016 */ +/* [+] International Business Machines Corp. */ /* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ @@ -28,7 +29,7 @@ #ifndef BASE_LOADER_STACK_SIZE #define BASE_LOADER_STACK_SIZE 128 #endif -#include "../sbe_link.H" +#include "sbe_link.H" OUTPUT_FORMAT(elf32-powerpc); diff --git a/src/build/linkerscripts/linksbe.cmd b/src/build/linkerscripts/linksbe.cmd index 4e1832f6..12250a9d 100644 --- a/src/build/linkerscripts/linksbe.cmd +++ b/src/build/linkerscripts/linksbe.cmd @@ -6,6 +6,7 @@ /* OpenPOWER sbe Project */ /* */ /* Contributors Listed Below - COPYRIGHT 2015,2016 */ +/* [+] International Business Machines Corp. */ /* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ @@ -28,7 +29,7 @@ #ifndef INITIAL_STACK_SIZE #define INITIAL_STACK_SIZE 256 #endif -#include +#include "sbe_link.H" OUTPUT_FORMAT(elf32-powerpc); diff --git a/src/build/linkerscripts/linkseeprom.cmd b/src/build/linkerscripts/linkseeprom.cmd index 7cbbcda4..fd1b1474 100644 --- a/src/build/linkerscripts/linkseeprom.cmd +++ b/src/build/linkerscripts/linkseeprom.cmd @@ -6,6 +6,7 @@ /* OpenPOWER sbe Project */ /* */ /* Contributors Listed Below - COPYRIGHT 2015,2016 */ +/* [+] International Business Machines Corp. */ /* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ @@ -23,7 +24,7 @@ /* IBM_PROLOG_END_TAG */ // Need to do this so that elf32-powerpc is not modified! #undef powerpc -#include +#include "sbe_link.H" OUTPUT_FORMAT(elf32-powerpc); #ifndef INITIAL_STACK_SIZE diff --git a/src/build/p9_sbe.H b/src/build/p9_sbe.H deleted file mode 100644 index 3e624d01..00000000 --- a/src/build/p9_sbe.H +++ /dev/null @@ -1,52 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/build/p9_sbe.H $ */ -/* */ -/* OpenPOWER sbe Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2016 */ -/* */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* IBM_PROLOG_END_TAG */ -#ifndef __P9_SBE_H -#define __P9_SBE_H - -/// \file p9_sbe.H -/// \brief A header to be included into all SBE assembler files and C++ -/// hardware procedures that interact with SBE images. -/// -/// This header #include-s all generally useful headers required for SBE code -/// development as well as defining other needed facilities. Note that any -/// sub-includes must be done in an assembler-safe way. - -#include "sbe_common.H" -//#include "p9_scom_addresses.H" -//#include "p9_istep_num.H" - -// The #include of fapiHwpReturnCodes.H must be made here (instead of in -// sbe_common.H) to guarantee that the P9-local copy is used. -//#include "fapiHwpReturnCodes.H" - -#ifdef __ASSEMBLER__ - - // p9_sbe.H 'recursively' inserts itself into any hook code extracted - // from an assembly context that includes p9_sbe.H. - - ##`#include "p9_sbe.H" - -#endif // __ASSEMBLER__ - -#endif // __P9_SBE_H diff --git a/src/build/parsAndCutElf.py b/src/build/parsAndCutElf.py index 934ddf97..acfe64a5 100755 --- a/src/build/parsAndCutElf.py +++ b/src/build/parsAndCutElf.py @@ -31,9 +31,9 @@ import sys # Workaround to cut SBE image from elf image. def parserElf(): - cmd = "readelf -S ../../obj/sbe_seeprom.out" + cmd = "readelf -S ../../images/sbe_seeprom.out" firstSection = ".header" - cmd1 = "nm ../../obj/sbe_seeprom.out | grep _sbe_image_size" + cmd1 = "nm ../../images/sbe_seeprom.out | grep _sbe_image_size" output = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE) i = 0; for line in output.stdout: @@ -60,7 +60,7 @@ def parserElf(): exit(-1) # cut the image - cmd1 = "dd skip=" + str(startSize) + " count=" + str(endSize) + " if=../../obj/sbe_seeprom.out of=../../images/sbe_seeprom.bin bs=1" + cmd1 = "dd skip=" + str(startSize) + " count=" + str(endSize) + " if=../../images/sbe_seeprom.out of=../../images/sbe_seeprom.bin bs=1" rc = os.system(cmd1) if ( rc ): print "ERROR running %s: %d "%( cmd1, rc ) diff --git a/src/build/proc_sbe_fixed.H b/src/build/proc_sbe_fixed.H deleted file mode 100644 index 6c3d134e..00000000 --- a/src/build/proc_sbe_fixed.H +++ /dev/null @@ -1,211 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/build/proc_sbe_fixed.H $ */ -/* */ -/* OpenPOWER sbe Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2016 */ -/* */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* IBM_PROLOG_END_TAG */ -//----------------------------------------------------------------------------- -// *! (C) Copyright International Business Machines Corp. 2014 -// *! All Rights Reserved -- Property of IBM -// *! *** IBM Confidential *** -//----------------------------------------------------------------------------- - -/// \file proc_sbe_fixed.H -/// \brief Define the layout of fixed-position data in the P9 SBE reference -/// and IPL images -/// -/// Contains struct ProcSbeFixed which contains functions, rings and -/// attributes whose pointers are stored in the fixed and fixed_toc section -/// -/// This file defines the layout of the special .fixed data section of P9 SBE -/// reference and IPL images. The .fixed section is guaranteed to appear at a -/// fixed offset from the beginning of the image, containing data required to -/// be manipulated when images are resident in non-volatile memories, thereby -/// avoiding having to search the TOC. Data manipulated during in-memory image -/// processing can always be easily located using the SBE-XIP TOC APIs. All -/// of the data stored in .fixed can also still be referenced via the SBE-XIP -/// TOC. -/// -/// This header file can be #include-ed into either C or SBE assembly language -/// source code. In C, it creates simple structures 'ProcChipAttributes', -/// 'PervAttributes', 'CoreAttributes', 'EQAttributes' and 'EXAttributes' that -/// contain attribute information that are sized per XML definition per entry. -/// -/// PPE image data is always stored big-endian, so applications on little-endian -/// hosts will need to perform the appropriate endian converison when reading or -/// writing images via this header. -/// -/// In assembler code, this header creates macros '.proc_sbe_fixed_proc_chip', -/// '.proc_sbe_fixed_perv', '.proc_sbe_fixed_core', '.proc_sbe_fixed_ex', -/// '.proc_sbe_fixed_eq', that is expanded exactly once in the file -/// 'sbe_base_header.S', creating the actual data allocation of the data -/// equivalent to the C structure. Assembler code references the data symbols -/// as normal. -/// -/// To simplify programming a 'mini-TOC' is also provided for this data in -/// the .fixed_toc section. This section is comprised of SbeXipHashedToc -/// structures. When a symbol is indedxed in .fixed, a blank SbeXipHashedToc -/// stucture is added to .fixed_toc. During image normalization the array of -/// SbeXipHashedToc is filled in as each symbol in .fixed is re-indexed into -/// .fixed_toc. - -#ifndef __PROC_SBE_FIXED_H__ -#define __PROC_SBE_FIXED_H__ - -#include "p9_sbe.H" -#include "plat_target_parms.H" -#include "fapi2AttributeIds.H" - -#ifdef __ASSEMBLER__ - .macro .proc_sbe_fixed_system - .section .fixed, "a", @progbits - .balign 8 - .global G_system_attributes -G_system_attributes: -#else - -extern "C" { -namespace fapi2attr { -typedef struct SystemAttributes_t { -#endif - -#include "proc_sbe_fixed_system.H" - -#ifdef __ASSEMBLER__ - .endm -#else -} SystemAttributes; -} // fapi2 -} // C -#endif - -#ifdef __ASSEMBLER__ - .macro .proc_sbe_fixed_proc_chip - .section .fixed, "a", @progbits - .balign 8 - .global G_proc_chip_attributes -G_proc_chip_attributes: -#else - -extern "C" { -namespace fapi2attr { -typedef struct ProcChipAttributes_t { -#endif - -#include "proc_sbe_fixed_proc_chip.H" - -#ifdef __ASSEMBLER__ - .endm -#else -} ProcChipAttributes; -} // fapi2 -} // C -#endif - -/// -/// Pervasive Target Attributes -#ifdef __ASSEMBLER__ - .macro .proc_sbe_fixed_perv - .section .fixed, "a", @progbits - .balign 8 - .global G_perv_attributes -G_perv_attributes: -#else -namespace fapi2attr { -typedef struct PervAttributes_t { -#endif - -#include "proc_sbe_fixed_perv.H" - -#ifdef __ASSEMBLER__ - .endm -#else -} PervAttributes; -} // fapi2 -#endif - -/// -/// Core (EC) Target Attributes -#ifdef __ASSEMBLER__ - .macro .proc_sbe_fixed_core - .section .fixed, "a", @progbits - .balign 8 - .global G_core_attributes -G_core_attributes: -#else -namespace fapi2attr { -typedef struct CoreAttributes_t { -#endif - -#include "proc_sbe_fixed_core.H" - -#ifdef __ASSEMBLER__ - .endm -#else -} CoreAttributes; -} // fapi2 -#endif - -/// -/// EX Target Attributes -#ifdef __ASSEMBLER__ - .macro .proc_sbe_fixed_ex - .section .fixed, "a", @progbits - .balign 8 - .global G_ex_attributes -G_ex_attributes: -#else -namespace fapi2attr { -typedef struct EXAttributes_t { -#endif - -#include "proc_sbe_fixed_ex.H" - -#ifdef __ASSEMBLER__ - .endm -#else -} EXAttributes; -} // fapi2 -#endif - -/// -/// EQ Target Attributes -#ifdef __ASSEMBLER__ - .macro .proc_sbe_fixed_eq - .section .fixed, "a", @progbits - .balign 8 - .global G_eq_attributes -G_eq_attributes: -#else -namespace fapi2attr { -typedef struct EQAttributes_t { -#endif - -#include "proc_sbe_fixed_eq.H" - -#ifdef __ASSEMBLER__ - .endm -#else -} EQAttributes; -} // fapi2 -#endif - - -#endif // __PROC_SBE_FIXED_H__ diff --git a/src/build/sbe_common.H b/src/build/sbe_common.H deleted file mode 100644 index 4fb78079..00000000 --- a/src/build/sbe_common.H +++ /dev/null @@ -1,600 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/build/sbe_common.H $ */ -/* */ -/* OpenPOWER sbe Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2016 */ -/* */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* IBM_PROLOG_END_TAG */ -#ifndef __SBE_COMMON_H -#define __SBE_COMMON_H - -// $Id: Exp $ - -/// \file sbe_common.H - -/// \brief This header contains #include-s and macro definitions common to P8 -/// and Centaur SBE code development. It is #include-ed into p8_sbe.H and -/// cen_sbe.H which have other setup specific to each environment. - - -#include "sbe_link.H" -#include "p9_xip_image.h" -//#include "sbe_xip_header.H" - -/// Macros for generating the .fixed section -/// -/// The CPP macros PROC_SBE_FIXED_UINT64[_VECTOR] generate equivalent code -/// depending on whether they are being called from assembler (where they -/// actually create the .fixed section data) or from C (where they specifiy a -/// C-structure form of the contents of the .fixed section. -/// -/// In assembler each invocation also creates space in the .fixed_toc section -/// for a fixed TOC entry. Unlike the normal TOC no data is generated for -/// .fixed_toc by the data declaration. Instead, the fixed TOC table is -/// filled in during image normalization by normalizeToc (p9_xip_image.c) -/// which requires that there be one and only one fixed TOC entery allocated -/// per TOC entry referencing the .fixed section. This means that in the -/// current implementation it is not possible to create .fixed_toc entries -/// for addresses or for data stored in sections other than .fixed. - -#ifdef __ASSEMBLER__ - - .macro proc_sbe_fixed_uint8, symbol:req, tnumber=1, elements=1 - .global \symbol -\symbol\(): - .rept ((\tnumber)*(\elements)) - .byte 0 - .endr - - .xip_toc \symbol, P9_XIP_UINT8, \symbol, ((\tnumber)*(\elements)) - - .pushsection .fixed_toc - .space 8 - .popsection - - .endm - - .macro proc_sbe_fixed_int8, symbol:req, tnumber=1, elements=1 - .global \symbol -\symbol\(): - .rept ((\tnumber)*(\elements)) - .byte 0 - .endr - - .xip_toc \symbol, P9_XIP_INT8, \symbol, ((\tnumber)*(\elements)) - - .pushsection .fixed_toc - .space 8 - .popsection - - .endm - - .macro proc_sbe_fixed_uint16, symbol:req, tnumber=1, elements=1 - .balign 2 - .global \symbol -\symbol\(): - - .rept ((\tnumber)*(\elements)) - .byte 0,0 - .endr - - .xip_toc \symbol, P9_XIP_UINT16, \symbol, ((\tnumber)*(\elements)) - - .pushsection .fixed_toc - .space 8 - .popsection - - .endm - - .macro proc_sbe_fixed_int16, symbol:req, tnumber=1, elements=1 - .balign 2 - .global \symbol -\symbol\(): - - .rept ((\tnumber)*(\elements)) - .byte 0,0 - .endr - - .xip_toc \symbol, P9_XIP_INT16, \symbol, ((\tnumber)*(\elements)) - - .pushsection .fixed_toc - .space 8 - .popsection - - .endm - - .macro proc_sbe_fixed_uint32, symbol:req, tnumber=1, elements=1 - .balign 4 - .global \symbol -\symbol\(): - - .rept ((\tnumber)*(\elements)) - .long 0 - .endr - - .xip_toc \symbol, P9_XIP_UINT32, \symbol, ((\tnumber)*(\elements)) - - .pushsection .fixed_toc - .space 8 - .popsection - - .endm - - .macro proc_sbe_fixed_int32, symbol:req, tnumber=1, elements=1 - .balign 4 - .global \symbol -\symbol\(): - - .rept ((\tnumber)*(\elements)) - .long 0 - .endr - - .xip_toc \symbol, P9_XIP_INT32, \symbol, ((\tnumber)*(\elements)) - - .pushsection .fixed_toc - .space 8 - .popsection - - .endm - - .macro proc_sbe_fixed_uint64, symbol:req, tnumber=1, elements=1 - .balign 8 - .global \symbol -\symbol\(): - .rept ((\tnumber)*(\elements)) - .quad 0 - .endr - - .xip_toc \symbol, P9_XIP_UINT64, \symbol, ((\tnumber)*(\elements)) - - .pushsection .fixed_toc - .space 8 - .popsection - - .endm - - .macro proc_sbe_fixed_int64, symbol:req, tnumber=1, elements=1 - .balign 8 - .global \symbol -\symbol\(): - .rept ((\tnumber)*(\elements)) - .quad 0 - .endr - - .xip_toc \symbol, P9_XIP_INT64, \symbol, ((\tnumber)*(\elements)) - - .pushsection .fixed_toc - .space 8 - .popsection - - .endm - - .macro proc_sbe_fixed_quadia, symbol:req, space:req, address:req - .global \symbol -\symbol\(): - .quadia (\space), (\address) - - .xip_toc \symbol, P9_XIP_UINT64, \symbol - - .pushsection .fixed_toc - .space 8 - .popsection - - .endm - - -#define PROC_SBE_FIXED_UINT8(symbol) \ - proc_sbe_fixed_uint8 symbol - -#define PROC_SBE_FIXED_INT8(symbol) \ - proc_sbe_fixed_int8 symbol - -#define PROC_SBE_FIXED_UINT16(symbol) \ - proc_sbe_fixed_uint16 symbol - -#define PROC_SBE_FIXED_INT16(symbol) \ - proc_sbe_fixed_int16 symbol - -#define PROC_SBE_FIXED_UINT32(symbol) \ - proc_sbe_fixed_uint32 symbol - -#define PROC_SBE_FIXED_INT32(symbol) \ - proc_sbe_fixed_int32 symbol - -#define PROC_SBE_FIXED_UINT64(symbol) \ - proc_sbe_fixed_uint64 symbol - -#define PROC_SBE_FIXED_INT64(symbol) \ - proc_sbe_fixed_int64 symbol - -#define PROC_SBE_FIXED_UINT8_VECTOR(symbol, elements) \ - proc_sbe_fixed_uint8 symbol, 1, elements - -#define PROC_SBE_FIXED_INT8_VECTOR(symbol, elements) \ - proc_sbe_fixed_int8 symbol, 1, elements - -#define PROC_SBE_FIXED_UINT16_VECTOR(symbol, elements) \ - proc_sbe_fixed_uint16 symbol, 1, elements - -#define PROC_SBE_FIXED_INT16_VECTOR(symbol, elements) \ - proc_sbe_fixed_int16 symbol, 1, elements - -#define PROC_SBE_FIXED_UINT32_VECTOR(symbol, elements) \ - proc_sbe_fixed_uint32 symbol, 1, elements - -#define PROC_SBE_FIXED_INT32_VECTOR(symbol, elements) \ - proc_sbe_fixed_int32 symbol, 1, elements - -#define PROC_SBE_FIXED_UINT64_VECTOR(symbol, elements) \ - proc_sbe_fixed_uint64 symbol, 1, elements - -#define PROC_SBE_FIXED_INT64_VECTOR(symbol, elements) \ - proc_sbe_fixed_int64 symbol, 1, elements - -#define PROC_SBE_FIXED_UINT8_VECTOR_2(symbol, dim1, dim2 ) \ - proc_sbe_fixed_uint8 symbol, 1, dim1 * dim2 - -#define PROC_SBE_FIXED_INT8_VECTOR_2(symbol, dim1, dim2 ) \ - proc_sbe_fixed_int8 symbol, 1, dim1 * dim2 - -#define PROC_SBE_FIXED_UINT16_VECTOR_2(symbol, dim1, dim2 ) \ - proc_sbe_fixed_uint16 symbol, 1, dim1 * dim2 - -#define PROC_SBE_FIXED_INT16_VECTOR_2(symbol, dim1, dim2 ) \ - proc_sbe_fixed_int16 symbol, 1, dim1 * dim2 - -#define PROC_SBE_FIXED_UINT32_VECTOR_2(symbol, dim1, dim2 ) \ - proc_sbe_fixed_uint32 symbol, 1, dim1 * dim2 - -#define PROC_SBE_FIXED_INT32_VECTOR_2(symbol, dim1, dim2 ) \ - proc_sbe_fixed_int32 symbol, 1, dim1 * dim2 - -#define PROC_SBE_FIXED_UINT64_VECTOR_2(symbol, dim1, dim2 ) \ - proc_sbe_fixed_uint64 symbol, 1, dim1 * dim2 - -#define PROC_SBE_FIXED_INT64_VECTOR_2(symbol, dim1, dim2 ) \ - proc_sbe_fixed_int64 symbol, 1, dim1 * dim2 - -#define PROC_SBE_FIXED_UINT8_VECTOR_3(symbol, dim1, dim2, dim3 ) \ - proc_sbe_fixed_uint8 symbol, 1, dim1 * dim2 * dim3 - -#define PROC_SBE_FIXED_INT8_VECTOR_3(symbol, dim1, dim2, dim3 ) \ - proc_sbe_fixed_uint8 symbol, 1, dim1 * dim2 * dim3 - -#define PROC_SBE_FIXED_UINT16_VECTOR_3(symbol, dim1, dim2, dim3 ) \ - proc_sbe_fixed_uint16 symbol, 1, dim1 * dim2 * dim3 - -#define PROC_SBE_FIXED_INT16_VECTOR_3(symbol, dim1, dim2, dim3 ) \ - proc_sbe_fixed_uint16 symbol, 1, dim1 * dim2 * dim3 - -#define PROC_SBE_FIXED_UINT32_VECTOR_3(symbol, dim1, dim2, dim3 ) \ - proc_sbe_fixed_uint32 symbol, 1, dim1 * dim2 * dim3 - -#define PROC_SBE_FIXED_INT32_VECTOR_3(symbol, dim1, dim2, dim3 ) \ - proc_sbe_fixed_uint32 symbol, 1, dim1 * dim2 * dim3 - -#define PROC_SBE_FIXED_UINT64_VECTOR_3(symbol, dim1, dim2, dim3 ) \ - proc_sbe_fixed_uint64 symbol, 1, dim1 * dim2 * dim3 - -#define PROC_SBE_FIXED_INT64_VECTOR_3(symbol, dim1, dim2, dim3 ) \ - proc_sbe_fixed_uint64 symbol, 1, dim1 * dim2 * dim3 - -// Non-Chip Target Attributes - -#define PROC_SBE_FIXED_TARGET_UINT8(symbol, tnumber) \ - proc_sbe_fixed_uint8 symbol, tnumber - -#define PROC_SBE_FIXED_TARGET_INT8(symbol, tnumber) \ - proc_sbe_fixed_int8 symbol, tnumber - -#define PROC_SBE_FIXED_TARGET_UINT16(symbol, tnumber) \ - proc_sbe_fixed_uint16 symbol, tnumber - -#define PROC_SBE_FIXED_TARGET_INT16(symbol, tnumber) \ - proc_sbe_fixed_int16 symbol, tnumber - -#define PROC_SBE_FIXED_TARGET_UINT32(symbol, tnumber) \ - proc_sbe_fixed_uint32 symbol, tnumber - -#define PROC_SBE_FIXED_TARGET_INT32(symbol, tnumber) \ - proc_sbe_fixed_int32 symbol, tnumber - -#define PROC_SBE_FIXED_TARGET_UINT64(symbol, tnumber) \ - proc_sbe_fixed_uint64 symbol, tnumber - -#define PROC_SBE_FIXED_TARGET_INT64(symbol, tnumber) \ - proc_sbe_fixed_int64 symbol, tnumber - -#define PROC_SBE_FIXED_TARGET_UINT8_VECTOR(symbol, tnumber, elements) \ - proc_sbe_fixed_uint8 symbol, tnumber, elements - -#define PROC_SBE_FIXED_TARGET_INT8_VECTOR(symbol, tnumber, elements) \ - proc_sbe_fixed_int8 symbol, tnumber, elements - -#define PROC_SBE_FIXED_TARGET_UINT16_VECTOR(symbol, tnumber, elements) \ - proc_sbe_fixed_uint16 symbol, tnumber, elements - -#define PROC_SBE_FIXED_TARGET_INT16_VECTOR(symbol, tnumber, elements) \ - proc_sbe_fixed_int16 symbol, tnumber, elements - -#define PROC_SBE_FIXED_TARGET_UINT32_VECTOR(symbol, tnumber, elements) \ - proc_sbe_fixed_uint32 symbol, tnumber, elements - -#define PROC_SBE_FIXED_TARGET_INT32_VECTOR(symbol, tnumber, elements) \ - proc_sbe_fixed_int32 symbol, tnumber, elements - -#define PROC_SBE_FIXED_TARGET_UINT64_VECTOR(symbol, tnumber, elements) \ - proc_sbe_fixed_uint64 symbol, tnumber, elements - -#define PROC_SBE_FIXED_TARGET_INT64_VECTOR(symbol, tnumber, elements) \ - proc_sbe_fixed_int64 symbol, tnumber, elements - -#define PROC_SBE_FIXED_TARGET_UINT8_VECTOR_2(symbol, tnumber, dim1, dim2 ) \ - proc_sbe_fixed_uint8 symbol, tnumber, dim1 * dim2 - -#define PROC_SBE_FIXED_TARGET_INT8_VECTOR_2(symbol, tnumber, dim1, dim2 ) \ - proc_sbe_fixed_int8 symbol, tnumber, dim1 * dim2 - -#define PROC_SBE_FIXED_TARGET_UINT16_VECTOR_2(symbol, tnumber, dim1, dim2 ) \ - proc_sbe_fixed_uint16 symbol, tnumber, dim1 * dim2 - -#define PROC_SBE_FIXED_TARGET_INT16_VECTOR_2(symbol, tnumber, dim1, dim2 ) \ - proc_sbe_fixed_int16 symbol, tnumber, dim1 * dim2 - -#define PROC_SBE_FIXED_TARGET_UINT32_VECTOR_2(symbol, tnumber, dim1, dim2 ) \ - proc_sbe_fixed_uint32 symbol, tnumber, dim1 * dim2 - -#define PROC_SBE_FIXED_TARGET_INT32_VECTOR_2(symbol, tnumber, dim1, dim2 ) \ - proc_sbe_fixed_int32 symbol, tnumber, dim1 * dim2 - -#define PROC_SBE_FIXED_TARGET_UINT64_VECTOR_2(symbol, tnumber, dim1, dim2 ) \ - proc_sbe_fixed_uint64 symbol, tnumber, dim1 * dim2 - -#define PROC_SBE_FIXED_TARGET_INT64_VECTOR_2(symbol, tnumber, dim1, dim2 ) \ - proc_sbe_fixed_int64 symbol, tnumber, dim1 * dim2 - -#define PROC_SBE_FIXED_TARGET_UINT8_VECTOR_3(symbol, tnumber, dim1, dim2, dim3 ) \ - proc_sbe_fixed_uint8 symbol, tnumber, dim1 * dim2 * dim3 - -#define PROC_SBE_FIXED_TARGET_INT8_VECTOR_3(symbol, tnumber, dim1, dim2, dim3 ) \ - proc_sbe_fixed_uint8 symbol, tnumber, dim1 * dim2 * dim3 - -#define PROC_SBE_FIXED_TARGET_UINT16_VECTOR_3(symbol, tnumber, dim1, dim2, dim3 ) \ - proc_sbe_fixed_uint16 symbol, tnumber, dim1 * dim2 * dim3 - -#define PROC_SBE_FIXED_TARGET_INT16_VECTOR_3(symbol, tnumber, dim1, dim2, dim3 ) \ - proc_sbe_fixed_uint16 symbol, tnumber, dim1 * dim2 * dim3 - -#define PROC_SBE_FIXED_TARGET_UINT32_VECTOR_3(symbol, tnumber, dim1, dim2, dim3 ) \ - proc_sbe_fixed_uint32 symbol, tnumber, dim1 * dim2 * dim3 - -#define PROC_SBE_FIXED_TARGET_INT32_VECTOR_3(symbol, tnumber, dim1, dim2, dim3 ) \ - proc_sbe_fixed_uint32 symbol, tnumber, dim1 * dim2 * dim3 - -#define PROC_SBE_FIXED_TARGET_UINT64_VECTOR_3(symbol, tnumber, dim1, dim2, dim3 ) \ - proc_sbe_fixed_uint64 symbol, tnumber, dim1 * dim2 * dim3 - -#define PROC_SBE_FIXED_TARGET_INT64_VECTOR_3(symbol, tnumber, dim1, dim2, dim3 ) \ - proc_sbe_fixed_uint64 symbol, tnumber, dim1 * dim2 * dim3 - -#define PROC_SBE_FIXED_QUADIA(symbol, space, address) \ - proc_sbe_fixed_quadia symbol, (space), (address) - - -#else // __ASSEMBLER__ (eg the C portion) - -#define PROC_SBE_FIXED_UINT8(symbol) \ - uint8_t symbol - -#define PROC_SBE_FIXED_INT8(symbol) \ - int8_t symbol - -#define PROC_SBE_FIXED_UINT16(symbol) \ - uint16_t symbol - -#define PROC_SBE_FIXED_INT16(symbol) \ - int16_t symbol - -#define PROC_SBE_FIXED_UINT32(symbol) \ - uint32_t symbol - -#define PROC_SBE_FIXED_INT32(symbol) \ - int32_t symbol - -#define PROC_SBE_FIXED_UINT64(symbol) \ - uint64_t symbol - -#define PROC_SBE_FIXED_INT64(symbol) \ - int64_t symbol - -#define PROC_SBE_FIXED_UINT8_VECTOR(symbol, elements) \ - uint8_t symbol[elements] - -#define PROC_SBE_FIXED_INT8_VECTOR(symbol, elements) \ - int8_t symbol[elements] - -#define PROC_SBE_FIXED_UINT16_VECTOR(symbol, elements) \ - uint16_t symbol[elements] - -#define PROC_SBE_FIXED_INT16_VECTOR(symbol, elements) \ - int16_t symbol[elements] - -#define PROC_SBE_FIXED_UINT32_VECTOR(symbol, elements) \ - uint32_t symbol[elements] - -#define PROC_SBE_FIXED_INT32_VECTOR(symbol, elements) \ - int32_t symbol[elements] - -#define PROC_SBE_FIXED_UINT64_VECTOR(symbol, elements) \ - uint64_t symbol[elements] - -#define PROC_SBE_FIXED_INT64_VECTOR(symbol, elements) \ - int64_t symbol[elements] - -#define PROC_SBE_FIXED_UINT8_VECTOR_2(symbol, dim1, dim2 ) \ - uint8_t symbol[dim1][dim2] - -#define PROC_SBE_FIXED_INT8_VECTOR_2(symbol, dim1, dim2 ) \ - int8_t symbol[dim1][dim2] - -#define PROC_SBE_FIXED_UINT16_VECTOR_2(symbol, dim1, dim2 ) \ - uint16_t symbol[dim1][dim2] - -#define PROC_SBE_FIXED_INT16_VECTOR_2(symbol, dim1, dim2 ) \ - int16_t symbol[dim1][dim2] - -#define PROC_SBE_FIXED_UINT32_VECTOR_2(symbol, dim1, dim2 ) \ - uint32_t symbol[dim1][dim2] - -#define PROC_SBE_FIXED_INT32_VECTOR_2(symbol, dim1, dim2 ) \ - int32_t symbol[dim1][dim2] - -#define PROC_SBE_FIXED_UINT64_VECTOR_2(symbol, dim1, dim2 ) \ - uint64_t symbol[dim1][dim2] - -#define PROC_SBE_FIXED_INT64_VECTOR_2(symbol, dim1, dim2 ) \ - int64_t symbol[dim1][dim2] - -#define PROC_SBE_FIXED_UINT8_VECTOR_3(symbol, dim1, dim2, dim3 ) \ - uint8_t symbol[dim1][dim2][dim3] - -#define PROC_SBE_FIXED_INT8_VECTOR_3(symbol, dim1, dim2, dim3 ) \ - int8_t symbol[dim1][dim2][dim3] - -#define PROC_SBE_FIXED_UINT16_VECTOR_3(symbol, dim1, dim2, dim3 ) \ - uint16_t symbol[dim1][dim2][dim3] - -#define PROC_SBE_FIXED_INT16_VECTOR_3(symbol, dim1, dim2, dim3 ) \ - int16_t symbol[dim1][dim2][dim3] - -#define PROC_SBE_FIXED_UINT32_VECTOR_3(symbol, dim1, dim2, dim3 ) \ - uint32_t symbol[dim1][dim2][dim3] - -#define PROC_SBE_FIXED_INT32_VECTOR_3(symbol, dim1, dim2, dim3 ) \ - int32_t symbol[dim1][dim2][dim3] - -#define PROC_SBE_FIXED_UINT64_VECTOR_3(symbol, dim1, dim2, dim3 ) \ - uint64_t symbol[dim1][dim2][dim3] - -#define PROC_SBE_FIXED_INT64_VECTOR_3(symbol, dim1, dim2, dim3 ) \ - int64_t symbol[dim1][dim2][dim3] - -// Non-Chip Target Attributes - -#define PROC_SBE_FIXED_TARGET_UINT8(symbol, tnumber) \ - uint8_t symbol[tnumber] - -#define PROC_SBE_FIXED_TARGET_INT8(symbol, tnumber) \ - int8_t symbol[tnumber] - -#define PROC_SBE_FIXED_TARGET_UINT16(symbol, tnumber) \ - uint16_t symbol[tnumber] - -#define PROC_SBE_FIXED_TARGET_INT16(symbol, tnumber) \ - int16_t symbol[tnumber] - -#define PROC_SBE_FIXED_TARGET_UINT32(symbol, tnumber) \ - uint32_t symbol[tnumber] - -#define PROC_SBE_FIXED_TARGET_INT32(symbol, tnumber) \ - int32_t symbol[tnumber] - -#define PROC_SBE_FIXED_TARGET_UINT64(symbol, tnumber) \ - uint64_t symbol[tnumber] - -#define PROC_SBE_FIXED_TARGET_INT64(symbol, tnumber) \ - int64_t symbol[tnumber] - -#define PROC_SBE_FIXED_TARGET_UINT8_VECTOR(symbol, tnumber, elements) \ - uint8_t symbol[tnumber][elements] - -#define PROC_SBE_FIXED_TARGET_INT8_VECTOR(symbol, tnumber, elements) \ - int8_t symbol[tnumber][elements] - -#define PROC_SBE_FIXED_TARGET_UINT16_VECTOR(symbol, tnumber, elements) \ - uint16_t symbol[tnumber][elements] - -#define PROC_SBE_FIXED_TARGET_INT16_VECTOR(symbol, tnumber, elements) \ - int16_t symbol[tnumber][elements] - -#define PROC_SBE_FIXED_TARGET_UINT32_VECTOR(symbol, tnumber, elements) \ - uint32_t symbol[tnumber][elements] - -#define PROC_SBE_FIXED_TARGET_INT32_VECTOR(symbol, tnumber, elements) \ - int32_t symbol[tnumber][elements] - -#define PROC_SBE_FIXED_TARGET_UINT64_VECTOR(symbol, tnumber, elements) \ - uint64_t symbol[tnumber][elements] - -#define PROC_SBE_FIXED_TARGET_INT64_VECTOR(symbol, tnumber, elements) \ - int64_t symbol[tnumber][elements] - -#define PROC_SBE_FIXED_TARGET_UINT8_VECTOR_2(symbol, tnumber, dim1, dim2 ) \ - uint8_t symbol[tnumber][dim1][dim2] - -#define PROC_SBE_FIXED_TARGET_INT8_VECTOR_2(symbol, tnumber, dim1, dim2 ) \ - int8_t symbol[tnumber][dim1][dim2] - -#define PROC_SBE_FIXED_TARGET_UINT16_VECTOR_2(symbol, tnumber, dim1, dim2 ) \ - uint16_t symbol[tnumber][dim1][dim2] - -#define PROC_SBE_FIXED_TARGET_INT16_VECTOR_2(symbol, tnumber, dim1, dim2 ) \ - int16_t symbol[tnumber][dim1][dim2] - -#define PROC_SBE_FIXED_TARGET_UINT32_VECTOR_2(symbol, tnumber, dim1, dim2 ) \ - uint32_t symbol[tnumber][dim1][dim2] - -#define PROC_SBE_FIXED_TARGET_INT32_VECTOR_2(symbol, tnumber, dim1, dim2 ) \ - int32_t symbol[tnumber][dim1][dim2] - -#define PROC_SBE_FIXED_TARGET_UINT64_VECTOR_2(symbol, tnumber, dim1, dim2 ) \ - uint64_t symbol[tnumber][dim1][dim2] - -#define PROC_SBE_FIXED_TARGET_INT64_VECTOR_2(symbol, tnumber, dim1, dim2 ) \ - int64_t symbol[tnumber][dim1][dim2] - -#define PROC_SBE_FIXED_TARGET_UINT8_VECTOR_3(symbol, tnumber, dim1, dim2, dim3 ) \ - uint8_t symbol[tnumber][dim1][dim2][dim3] - -#define PROC_SBE_FIXED_TARGET_INT8_VECTOR_3(symbol, tnumber, dim1, dim2, dim3 ) \ - int8_t symbol[tnumber][dim1][dim2][dim3] - -#define PROC_SBE_FIXED_TARGET_UINT16_VECTOR_3(symbol, tnumber, dim1, dim2, dim3 ) \ - uint16_t symbol[tnumber][dim1][dim2][dim3] - -#define PROC_SBE_FIXED_TARGET_INT16_VECTOR_3(symbol, tnumber, dim1, dim2, dim3 ) \ - int16_t symbol[tnumber][dim1][dim2][dim3] - -#define PROC_SBE_FIXED_TARGET_UINT32_VECTOR_3(symbol, tnumber, dim1, dim2, dim3 ) \ - uint32_t symbol[tnumber][dim1][dim2][dim3] - -#define PROC_SBE_FIXED_TARGET_INT32_VECTOR_3(symbol, tnumber, dim1, dim2, dim3 ) \ - int32_t symbol[tnumber][dim1][dim2][dim3] - -#define PROC_SBE_FIXED_TARGET_UINT64_VECTOR_3(symbol, tnumber, dim1, dim2, dim3 ) \ - uint64_t symbol[tnumber][dim1][dim2][dim3] - -#define PROC_SBE_FIXED_TARGET_INT64_VECTOR_3(symbol, tnumber, dim1, dim2, dim3 ) \ - int64_t symbol[tnumber][dim1][dim2][dim3] - -#define PROC_SBE_FIXED_QUADIA(symbol, space, address) uint64_t symbol - -#endif // __ASSEMBLER__ - -#endif // __SBE_COMMON_H diff --git a/src/build/sbe_link.H b/src/build/sbe_link.H deleted file mode 100644 index ad703e1a..00000000 --- a/src/build/sbe_link.H +++ /dev/null @@ -1,102 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/build/sbe_link.H $ */ -/* */ -/* OpenPOWER sbe Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2016 */ -/* */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* IBM_PROLOG_END_TAG */ -#ifndef __SBE_LINK_H -#define __SBE_LINK_H - -// $Id: Exp $ - -/// \file sbe_link.H -/// \brief Constants required for linking SBE code images -/// -/// This header contains those cpp manifest constants required for processing -/// the linker scripts used to generate SBE code images. They may also be -/// useful for PPE assembler programming so they are included in sbe.H as -/// well. -/// -/// The link address of OTPROM code as a byte-address -/// -/// The OTPROM can be addressed both as an I2C slave and as a direct PIB -/// slave. The I2C slave is at PIB local address 0x0 and the PIB memory -/// interface is at local address 0x8000. SBE/IPL uses the PIB addressing -/// mode, so the OTPROM image is linked at 0x40000 (the byte-address -/// equivalent of 0x8000). -#define OTPROM_ORIGIN 0xC0000 - -/// The amount of memory contained in each OTPROM macro -#define OTPROM_BLOCK_SIZE 1024 - -/// The amount of memory reserved for OTPROM code -/// -/// This amount is exclusive of physical OTPROM memory reserved for compressed -/// scan ring images. -#define OTPROM_CODE_SIZE (1 * OTPROM_BLOCK_SIZE) - -/// The link address of the P9 SBE Base image -#define SBE_BASE_ORIGIN 0xFFFE8000 -/// SBE base image length ( 96 KB - 512 bytes for loader) -#define SBE_BASE_LENGTH 0x17DFF - -///This Index depends upon XIP HEADER File -// Start offset of sectionTable in XIP header. There are 8 entries -// of 8 byte each. -#define SBE_XIP_TOC_OFFSET 8*8 - -/// The link address of the P9 SBE Base image -#define SBE_SEEPROM_BASE_ORIGIN 0x80000000 - -/// This Index depends upon XIP HEADER File -/// Each section table entry is 12 bytes(SIZE_OF_SBE_XIP_SECTION) size, -// Base Loader is 10 th (P9_XIP_SECTION_BASELOADER) section -#define SBE_LOADER_BASE_SECTION SBE_SEEPROM_BASE_ORIGIN + SBE_XIP_TOC_OFFSET \ - + 120 -// Base Loader start address -#define SBE_LOADER_BASE_ORIGIN 0xFFFFFE00 -// Base Loader length -#define SBE_LOADER_BASE_LENGTH 0x200 - -// Base Loader entry function offset in header -#define SBE_LOADER_ENTRY_HEADER_OFFSET 20 - -/// The physical address offset where SBE-SEEPROM code is loaded -/// -/// This address *must* be a constant known to the OTPROM code. -#define SBE_SEEPROM_LOAD_ADDRESS 0x2000 - -/// The offset (in bytes) of the .fixed section in P9 SBE-XIP images -#define SBE_XIP_FIXED_OFFSET 512 - -/// The link address of the PIBMEM image -#define PIBMEM_ORIGIN 0 - -/// The amount of space available in the PIBMEM, in bytes (96KB) -#define PIBMEM_SIZE (96 * 1024) - -/// The fixed section of Otprom -#define OTPROM_FIXED_SIZE (OTPROM_ORIGIN + 0x340) - -/// Sbe fixed sction for the pibmem repair -#define SBE_FIXED_SECTION (SBE_SEEPROM_BASE_ORIGIN + SBE_XIP_TOC_OFFSET + 12) - -#endif // __SBE_LINK_H - diff --git a/src/build/topfiles.mk b/src/build/topfiles.mk index 6c76eaaf..71732138 100644 --- a/src/build/topfiles.mk +++ b/src/build/topfiles.mk @@ -6,6 +6,7 @@ # OpenPOWER sbe Project # # Contributors Listed Below - COPYRIGHT 2015,2016 +# [+] International Business Machines Corp. # # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -23,7 +24,7 @@ # IBM_PROLOG_END_TAG TOP-C-SOURCES = TOP-CPP-SOURCES = -TOP-S-SOURCES = base_ppe_header.S +TOP-S-SOURCES = # generated by ppeParseProcSbeFixed.pl TOP-FIXED-HEADERS += $(BUILD_DIR)/proc_sbe_fixed_system.H diff --git a/src/build/utils/Makefile b/src/build/utils/Makefile new file mode 100644 index 00000000..163984cf --- /dev/null +++ b/src/build/utils/Makefile @@ -0,0 +1,43 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/build/utils/Makefile $ +# +# OpenPOWER sbe Project +# +# Contributors Listed Below - COPYRIGHT 2016 +# [+] International Business Machines Corp. +# +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. See the License for the specific language governing +# permissions and limitations under the License. +# +# IBM_PROLOG_END_TAG +export SUB_OBJDIR = /build/utils + +include img_defs.mk +include utils.mk + +OBJS := $(addprefix $(OBJDIR)/, $(BUILDDATA_OBJECTS)) +BUILDDATA_OBJECTS := $(OBJS) + +.PHONY: clean all + +all:$(OBJS) + +$(OBJS) $(OBJS:.o=.d): | $(OBJDIR) + +$(OBJDIR): + mkdir -p $(OBJDIR) + +clean: + rm -rf $(OBJDIR) diff --git a/src/build/utils/base_ppe_header.S b/src/build/utils/base_ppe_header.S new file mode 100644 index 00000000..c99cc08f --- /dev/null +++ b/src/build/utils/base_ppe_header.S @@ -0,0 +1,209 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/build/utils/base_ppe_header.S $ */ +/* */ +/* OpenPOWER sbe Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2016 */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ +//----------------------------------------------------------------------------- +// *! (C) Copyright International Business Machines Corp. 2014 +// *! All Rights Reserved -- Property of IBM +// *! *** IBM Confidential *** +//----------------------------------------------------------------------------- + +/// \file base_ppe_header.S +/// \brief code to create header, toc, strings, fixed and fixed_toc sections +/// +/// function P9XipHeader creates header section, function .proc_sbe_fixed +/// creates fixed, fixed_toc sections +#include "p9_xip_image.h" +#include "proc_sbe_fixed.H" + + +#define IMAGE_SPACE_UNDEFINED 0xffff +#define IMAGE_SPACE_OCI 0x8000 +#define IMAGE_SPACE_PNOR 0x800b +#define IMAGE_SPACE_OTPROM 0x0001 +#define IMAGE_SPACE_SEEPROM 0x800c +#define IMAGE_SPACE_BASE 0x0008 + + + + .macro ..checku, x:req, bits:req, err="Unsigned value too large" + + .if (((\bits) <= 0) || ((\bits) > 63)) + .error "The number of bits must be in the range 0 < bits < 64" + .endif + + .iflt (\x) + .error "An unsigned value is required here" + .endif + + .ifgt ((\x) - (0xffffffffffffffff >> (64 - (\bits)))) + .error "\err" + .endif + + .endm + + .macro ..check_u16, u16 + ..checku (\u16), 16, "Unsigned immediate is larger than 16 bits" + .endm + + + .macro ..set_default_space, s + ..check_u16 (\s) + .set _PGAS_DEFAULT_SPACE, (\s) + .endm + + .macro ..check_default_space + .if (_PGAS_DEFAULT_SPACE == IMAGE_SPACE_UNDEFINED) + .error "The PGAS default address space has not been defined" + .endif + .endm + + + .macro .quada, offset:req + ..check_default_space + .long _PGAS_DEFAULT_SPACE + .long (\offset) + .endm + + + .macro P9XipHeader, magic, link_address, entry_point, image_size + + .section .header, "a", @progbits + + + ////////////////////////////////////////////////////////////////////// + // Identification - 8-byte aligned; 8 Entries; TOC-Indexed + ////////////////////////////////////////////////////////////////////// + +__magic: + .quad (\magic) +__L1_LoaderAddr: + .quad 0 +__L2_LoaderAddr: + .quad 0 +__kernelAddr: + .quad 0 +__link_address: + .quada (\link_address) +__header_64_reserved: + .quad 0, 0, 0 + + .xip_toc magic, P9_XIP_UINT64, __magic + .xip_toc L1_LoaderAddr, P9_XIP_UINT64, __L1_LoaderAddr + .xip_toc L2_LoaderAddr, P9_XIP_UINT64, __L2_LoaderAddr + .xip_toc kernelAddr, P9_XIP_UINT64, __kernelAddr + .xip_toc link_address, P9_XIP_UINT64, __link_address + + ////////////////////////////////////////////////////////////////////// + // Section Table - Not TOC-Indexed + ////////////////////////////////////////////////////////////////////// + + .xip_section header + .xip_section fixed, 8 + .xip_section fixed_toc, 8 + .xip_section toc, 4 + .xip_section strings + .xip_section loader_text, 4 + .xip_section loader_data, 8, empty=1 + .xip_section text, 4 + .xip_section data, 8, empty=1 + .xip_section base, 4 + .xip_section baseloader, 8, empty=1 + .xip_section overrides, 8, empty=1 + .xip_section rings, 8, empty=1 + .xip_section overlay, 8, empty=1 + .xip_section hbbl, 8, empty=1 + + + ////////////////////////////////////////////////////////////////////// + // Other Information - 4-byte aligned; 8 entries; TOC-Indexed + ////////////////////////////////////////////////////////////////////// + +__image_size: + .long (\image_size) +__build_date: + .long 0 +__build_time: + .long 0 +__header_32_reserved: + .long 0, 0, 0, 0, 0 + + .xip_toc image_size, P9_XIP_UINT32, __image_size + .xip_toc build_date, P9_XIP_UINT32, __build_date + .xip_toc build_time, P9_XIP_UINT32, __build_time + + + ////////////////////////////////////////////////////////////////////// + // Other Information - 1-byte aligned; 8 entries; TOC-Indexed + ////////////////////////////////////////////////////////////////////// + +__header_version: + .byte P9_XIP_HEADER_VERSION +__toc_normalized: + .byte 0 +__toc_sorted: + .byte 0 +__header_8_reserved: + .byte 0, 0, 0, 0, 0 + + .xip_toc header_version, P9_XIP_UINT8, __header_version + .xip_toc toc_normalized, P9_XIP_UINT8, __toc_normalized + .xip_toc toc_sorted, P9_XIP_UINT8, __toc_sorted + + + ////////////////////////////////////////////////////////////////////// + // Strings; 64 characters allocated; TOC-Indexed + ////////////////////////////////////////////////////////////////////// + +__build_user: + .asciz "unknown " # 16 Characters allocated +__build_host: + .asciz "unknown " # 24 characters allocated +__header_string_reserved: + .space 24, 0 + + .xip_toc build_user, P9_XIP_STRING, __build_user + .xip_toc build_host, P9_XIP_STRING, __build_host + + + .endm + + + .section .fixed, "a", @progbits + .section .fixed_toc, "a", @progbits + .section .loader_data, "a", @progbits + .section .loader_text, "a", @progbits + + .section .toc, "a", @progbits + .section .strings, "aS", @progbits + .section .base, "a", @progbits + + ..set_default_space IMAGE_SPACE_SEEPROM + P9XipHeader P9_XIP_MAGIC_SEEPROM, 0x80000000, 0x00000000, _sbe_image_size + + // Create the .fixed section + .proc_sbe_fixed_system + .proc_sbe_fixed_proc_chip + .proc_sbe_fixed_perv + .proc_sbe_fixed_core + .proc_sbe_fixed_ex + .proc_sbe_fixed_eq diff --git a/src/build/utils/base_sbe_fixed.S b/src/build/utils/base_sbe_fixed.S new file mode 100644 index 00000000..7474a38b --- /dev/null +++ b/src/build/utils/base_sbe_fixed.S @@ -0,0 +1,67 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/build/utils/base_sbe_fixed.S $ */ +/* */ +/* OpenPOWER sbe Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2016 */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ +/// \file sbefixed.S +/// \brief code to generated fixed section in pibmem image +/// +#include "p9_xip_image.h" +#include "proc_sbe_fixed.H" + + + .macro ..checku, x:req, bits:req, err="Unsigned value too large" + + .if (((\bits) <= 0) || ((\bits) > 63)) + .error "The number of bits must be in the range 0 < bits < 64" + .endif + + .iflt (\x) + .error "An unsigned value is required here" + .endif + + .ifgt ((\x) - (0xffffffffffffffff >> (64 - (\bits)))) + .error "\err" + .endif + + .endm + + + .macro ..check_u16, u16 + ..checku (\u16), 16, "Unsigned immediate is larger than 16 bits" + .endm + + + .macro ..set_default_space, s + ..check_u16 (\s) + .set _PGAS_DEFAULT_SPACE, (\s) + .endm + + .section .fixed, "a", @progbits + + + // Create the .fixed section + .proc_sbe_fixed_system + .proc_sbe_fixed_proc_chip + .proc_sbe_fixed_perv + .proc_sbe_fixed_core + .proc_sbe_fixed_ex + .proc_sbe_fixed_eq diff --git a/src/build/utils/p9_sbe.H b/src/build/utils/p9_sbe.H new file mode 100644 index 00000000..36c281eb --- /dev/null +++ b/src/build/utils/p9_sbe.H @@ -0,0 +1,52 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/build/utils/p9_sbe.H $ */ +/* */ +/* OpenPOWER sbe Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2016 */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ +#ifndef __P9_SBE_H +#define __P9_SBE_H + +/// \file p9_sbe.H +/// \brief A header to be included into all SBE assembler files and C++ +/// hardware procedures that interact with SBE images. +/// +/// This header #include-s all generally useful headers required for SBE code +/// development as well as defining other needed facilities. Note that any +/// sub-includes must be done in an assembler-safe way. + +#include "sbe_common.H" +//#include "p9_scom_addresses.H" +//#include "p9_istep_num.H" + +// The #include of fapiHwpReturnCodes.H must be made here (instead of in +// sbe_common.H) to guarantee that the P9-local copy is used. +//#include "fapiHwpReturnCodes.H" + +#ifdef __ASSEMBLER__ + + // p9_sbe.H 'recursively' inserts itself into any hook code extracted + // from an assembly context that includes p9_sbe.H. + + ##`#include "p9_sbe.H" + +#endif // __ASSEMBLER__ + +#endif // __P9_SBE_H diff --git a/src/build/utils/proc_sbe_fixed.H b/src/build/utils/proc_sbe_fixed.H new file mode 100644 index 00000000..9b06fb6f --- /dev/null +++ b/src/build/utils/proc_sbe_fixed.H @@ -0,0 +1,211 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/build/utils/proc_sbe_fixed.H $ */ +/* */ +/* OpenPOWER sbe Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2016 */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ +//----------------------------------------------------------------------------- +// *! (C) Copyright International Business Machines Corp. 2014 +// *! All Rights Reserved -- Property of IBM +// *! *** IBM Confidential *** +//----------------------------------------------------------------------------- + +/// \file proc_sbe_fixed.H +/// \brief Define the layout of fixed-position data in the P9 SBE reference +/// and IPL images +/// +/// Contains struct ProcSbeFixed which contains functions, rings and +/// attributes whose pointers are stored in the fixed and fixed_toc section +/// +/// This file defines the layout of the special .fixed data section of P9 SBE +/// reference and IPL images. The .fixed section is guaranteed to appear at a +/// fixed offset from the beginning of the image, containing data required to +/// be manipulated when images are resident in non-volatile memories, thereby +/// avoiding having to search the TOC. Data manipulated during in-memory image +/// processing can always be easily located using the SBE-XIP TOC APIs. All +/// of the data stored in .fixed can also still be referenced via the SBE-XIP +/// TOC. +/// +/// This header file can be #include-ed into either C or SBE assembly language +/// source code. In C, it creates simple structures 'ProcChipAttributes', +/// 'PervAttributes', 'CoreAttributes', 'EQAttributes' and 'EXAttributes' that +/// contain attribute information that are sized per XML definition per entry. +/// +/// PPE image data is always stored big-endian, so applications on little-endian +/// hosts will need to perform the appropriate endian converison when reading or +/// writing images via this header. +/// +/// In assembler code, this header creates macros '.proc_sbe_fixed_proc_chip', +/// '.proc_sbe_fixed_perv', '.proc_sbe_fixed_core', '.proc_sbe_fixed_ex', +/// '.proc_sbe_fixed_eq', that is expanded exactly once in the file +/// 'sbe_base_header.S', creating the actual data allocation of the data +/// equivalent to the C structure. Assembler code references the data symbols +/// as normal. +/// +/// To simplify programming a 'mini-TOC' is also provided for this data in +/// the .fixed_toc section. This section is comprised of SbeXipHashedToc +/// structures. When a symbol is indedxed in .fixed, a blank SbeXipHashedToc +/// stucture is added to .fixed_toc. During image normalization the array of +/// SbeXipHashedToc is filled in as each symbol in .fixed is re-indexed into +/// .fixed_toc. + +#ifndef __PROC_SBE_FIXED_H__ +#define __PROC_SBE_FIXED_H__ + +#include "p9_sbe.H" +#include "plat_target_parms.H" +#include "fapi2AttributeIds.H" + +#ifdef __ASSEMBLER__ + .macro .proc_sbe_fixed_system + .section .fixed, "a", @progbits + .balign 8 + .global G_system_attributes +G_system_attributes: +#else + +extern "C" { +namespace fapi2attr { +typedef struct SystemAttributes_t { +#endif + +#include "proc_sbe_fixed_system.H" + +#ifdef __ASSEMBLER__ + .endm +#else +} SystemAttributes; +} // fapi2 +} // C +#endif + +#ifdef __ASSEMBLER__ + .macro .proc_sbe_fixed_proc_chip + .section .fixed, "a", @progbits + .balign 8 + .global G_proc_chip_attributes +G_proc_chip_attributes: +#else + +extern "C" { +namespace fapi2attr { +typedef struct ProcChipAttributes_t { +#endif + +#include "proc_sbe_fixed_proc_chip.H" + +#ifdef __ASSEMBLER__ + .endm +#else +} ProcChipAttributes; +} // fapi2 +} // C +#endif + +/// +/// Pervasive Target Attributes +#ifdef __ASSEMBLER__ + .macro .proc_sbe_fixed_perv + .section .fixed, "a", @progbits + .balign 8 + .global G_perv_attributes +G_perv_attributes: +#else +namespace fapi2attr { +typedef struct PervAttributes_t { +#endif + +#include "proc_sbe_fixed_perv.H" + +#ifdef __ASSEMBLER__ + .endm +#else +} PervAttributes; +} // fapi2 +#endif + +/// +/// Core (EC) Target Attributes +#ifdef __ASSEMBLER__ + .macro .proc_sbe_fixed_core + .section .fixed, "a", @progbits + .balign 8 + .global G_core_attributes +G_core_attributes: +#else +namespace fapi2attr { +typedef struct CoreAttributes_t { +#endif + +#include "proc_sbe_fixed_core.H" + +#ifdef __ASSEMBLER__ + .endm +#else +} CoreAttributes; +} // fapi2 +#endif + +/// +/// EX Target Attributes +#ifdef __ASSEMBLER__ + .macro .proc_sbe_fixed_ex + .section .fixed, "a", @progbits + .balign 8 + .global G_ex_attributes +G_ex_attributes: +#else +namespace fapi2attr { +typedef struct EXAttributes_t { +#endif + +#include "proc_sbe_fixed_ex.H" + +#ifdef __ASSEMBLER__ + .endm +#else +} EXAttributes; +} // fapi2 +#endif + +/// +/// EQ Target Attributes +#ifdef __ASSEMBLER__ + .macro .proc_sbe_fixed_eq + .section .fixed, "a", @progbits + .balign 8 + .global G_eq_attributes +G_eq_attributes: +#else +namespace fapi2attr { +typedef struct EQAttributes_t { +#endif + +#include "proc_sbe_fixed_eq.H" + +#ifdef __ASSEMBLER__ + .endm +#else +} EQAttributes; +} // fapi2 +#endif + + +#endif // __PROC_SBE_FIXED_H__ diff --git a/src/build/utils/sbe_common.H b/src/build/utils/sbe_common.H new file mode 100644 index 00000000..3cd8a0a0 --- /dev/null +++ b/src/build/utils/sbe_common.H @@ -0,0 +1,600 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/build/utils/sbe_common.H $ */ +/* */ +/* OpenPOWER sbe Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2016 */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ +#ifndef __SBE_COMMON_H +#define __SBE_COMMON_H + +// $Id: Exp $ + +/// \file sbe_common.H + +/// \brief This header contains #include-s and macro definitions common to P8 +/// and Centaur SBE code development. It is #include-ed into p8_sbe.H and +/// cen_sbe.H which have other setup specific to each environment. + + +#include "sbe_link.H" +#include "p9_xip_image.h" +//#include "sbe_xip_header.H" + +/// Macros for generating the .fixed section +/// +/// The CPP macros PROC_SBE_FIXED_UINT64[_VECTOR] generate equivalent code +/// depending on whether they are being called from assembler (where they +/// actually create the .fixed section data) or from C (where they specifiy a +/// C-structure form of the contents of the .fixed section. +/// +/// In assembler each invocation also creates space in the .fixed_toc section +/// for a fixed TOC entry. Unlike the normal TOC no data is generated for +/// .fixed_toc by the data declaration. Instead, the fixed TOC table is +/// filled in during image normalization by normalizeToc (p9_xip_image.c) +/// which requires that there be one and only one fixed TOC entery allocated +/// per TOC entry referencing the .fixed section. This means that in the +/// current implementation it is not possible to create .fixed_toc entries +/// for addresses or for data stored in sections other than .fixed. + +#ifdef __ASSEMBLER__ + + .macro proc_sbe_fixed_uint8, symbol:req, tnumber=1, elements=1 + .global \symbol +\symbol\(): + .rept ((\tnumber)*(\elements)) + .byte 0 + .endr + + .xip_toc \symbol, P9_XIP_UINT8, \symbol, ((\tnumber)*(\elements)) + + .pushsection .fixed_toc + .space 8 + .popsection + + .endm + + .macro proc_sbe_fixed_int8, symbol:req, tnumber=1, elements=1 + .global \symbol +\symbol\(): + .rept ((\tnumber)*(\elements)) + .byte 0 + .endr + + .xip_toc \symbol, P9_XIP_INT8, \symbol, ((\tnumber)*(\elements)) + + .pushsection .fixed_toc + .space 8 + .popsection + + .endm + + .macro proc_sbe_fixed_uint16, symbol:req, tnumber=1, elements=1 + .balign 2 + .global \symbol +\symbol\(): + + .rept ((\tnumber)*(\elements)) + .byte 0,0 + .endr + + .xip_toc \symbol, P9_XIP_UINT16, \symbol, ((\tnumber)*(\elements)) + + .pushsection .fixed_toc + .space 8 + .popsection + + .endm + + .macro proc_sbe_fixed_int16, symbol:req, tnumber=1, elements=1 + .balign 2 + .global \symbol +\symbol\(): + + .rept ((\tnumber)*(\elements)) + .byte 0,0 + .endr + + .xip_toc \symbol, P9_XIP_INT16, \symbol, ((\tnumber)*(\elements)) + + .pushsection .fixed_toc + .space 8 + .popsection + + .endm + + .macro proc_sbe_fixed_uint32, symbol:req, tnumber=1, elements=1 + .balign 4 + .global \symbol +\symbol\(): + + .rept ((\tnumber)*(\elements)) + .long 0 + .endr + + .xip_toc \symbol, P9_XIP_UINT32, \symbol, ((\tnumber)*(\elements)) + + .pushsection .fixed_toc + .space 8 + .popsection + + .endm + + .macro proc_sbe_fixed_int32, symbol:req, tnumber=1, elements=1 + .balign 4 + .global \symbol +\symbol\(): + + .rept ((\tnumber)*(\elements)) + .long 0 + .endr + + .xip_toc \symbol, P9_XIP_INT32, \symbol, ((\tnumber)*(\elements)) + + .pushsection .fixed_toc + .space 8 + .popsection + + .endm + + .macro proc_sbe_fixed_uint64, symbol:req, tnumber=1, elements=1 + .balign 8 + .global \symbol +\symbol\(): + .rept ((\tnumber)*(\elements)) + .quad 0 + .endr + + .xip_toc \symbol, P9_XIP_UINT64, \symbol, ((\tnumber)*(\elements)) + + .pushsection .fixed_toc + .space 8 + .popsection + + .endm + + .macro proc_sbe_fixed_int64, symbol:req, tnumber=1, elements=1 + .balign 8 + .global \symbol +\symbol\(): + .rept ((\tnumber)*(\elements)) + .quad 0 + .endr + + .xip_toc \symbol, P9_XIP_INT64, \symbol, ((\tnumber)*(\elements)) + + .pushsection .fixed_toc + .space 8 + .popsection + + .endm + + .macro proc_sbe_fixed_quadia, symbol:req, space:req, address:req + .global \symbol +\symbol\(): + .quadia (\space), (\address) + + .xip_toc \symbol, P9_XIP_UINT64, \symbol + + .pushsection .fixed_toc + .space 8 + .popsection + + .endm + + +#define PROC_SBE_FIXED_UINT8(symbol) \ + proc_sbe_fixed_uint8 symbol + +#define PROC_SBE_FIXED_INT8(symbol) \ + proc_sbe_fixed_int8 symbol + +#define PROC_SBE_FIXED_UINT16(symbol) \ + proc_sbe_fixed_uint16 symbol + +#define PROC_SBE_FIXED_INT16(symbol) \ + proc_sbe_fixed_int16 symbol + +#define PROC_SBE_FIXED_UINT32(symbol) \ + proc_sbe_fixed_uint32 symbol + +#define PROC_SBE_FIXED_INT32(symbol) \ + proc_sbe_fixed_int32 symbol + +#define PROC_SBE_FIXED_UINT64(symbol) \ + proc_sbe_fixed_uint64 symbol + +#define PROC_SBE_FIXED_INT64(symbol) \ + proc_sbe_fixed_int64 symbol + +#define PROC_SBE_FIXED_UINT8_VECTOR(symbol, elements) \ + proc_sbe_fixed_uint8 symbol, 1, elements + +#define PROC_SBE_FIXED_INT8_VECTOR(symbol, elements) \ + proc_sbe_fixed_int8 symbol, 1, elements + +#define PROC_SBE_FIXED_UINT16_VECTOR(symbol, elements) \ + proc_sbe_fixed_uint16 symbol, 1, elements + +#define PROC_SBE_FIXED_INT16_VECTOR(symbol, elements) \ + proc_sbe_fixed_int16 symbol, 1, elements + +#define PROC_SBE_FIXED_UINT32_VECTOR(symbol, elements) \ + proc_sbe_fixed_uint32 symbol, 1, elements + +#define PROC_SBE_FIXED_INT32_VECTOR(symbol, elements) \ + proc_sbe_fixed_int32 symbol, 1, elements + +#define PROC_SBE_FIXED_UINT64_VECTOR(symbol, elements) \ + proc_sbe_fixed_uint64 symbol, 1, elements + +#define PROC_SBE_FIXED_INT64_VECTOR(symbol, elements) \ + proc_sbe_fixed_int64 symbol, 1, elements + +#define PROC_SBE_FIXED_UINT8_VECTOR_2(symbol, dim1, dim2 ) \ + proc_sbe_fixed_uint8 symbol, 1, dim1 * dim2 + +#define PROC_SBE_FIXED_INT8_VECTOR_2(symbol, dim1, dim2 ) \ + proc_sbe_fixed_int8 symbol, 1, dim1 * dim2 + +#define PROC_SBE_FIXED_UINT16_VECTOR_2(symbol, dim1, dim2 ) \ + proc_sbe_fixed_uint16 symbol, 1, dim1 * dim2 + +#define PROC_SBE_FIXED_INT16_VECTOR_2(symbol, dim1, dim2 ) \ + proc_sbe_fixed_int16 symbol, 1, dim1 * dim2 + +#define PROC_SBE_FIXED_UINT32_VECTOR_2(symbol, dim1, dim2 ) \ + proc_sbe_fixed_uint32 symbol, 1, dim1 * dim2 + +#define PROC_SBE_FIXED_INT32_VECTOR_2(symbol, dim1, dim2 ) \ + proc_sbe_fixed_int32 symbol, 1, dim1 * dim2 + +#define PROC_SBE_FIXED_UINT64_VECTOR_2(symbol, dim1, dim2 ) \ + proc_sbe_fixed_uint64 symbol, 1, dim1 * dim2 + +#define PROC_SBE_FIXED_INT64_VECTOR_2(symbol, dim1, dim2 ) \ + proc_sbe_fixed_int64 symbol, 1, dim1 * dim2 + +#define PROC_SBE_FIXED_UINT8_VECTOR_3(symbol, dim1, dim2, dim3 ) \ + proc_sbe_fixed_uint8 symbol, 1, dim1 * dim2 * dim3 + +#define PROC_SBE_FIXED_INT8_VECTOR_3(symbol, dim1, dim2, dim3 ) \ + proc_sbe_fixed_uint8 symbol, 1, dim1 * dim2 * dim3 + +#define PROC_SBE_FIXED_UINT16_VECTOR_3(symbol, dim1, dim2, dim3 ) \ + proc_sbe_fixed_uint16 symbol, 1, dim1 * dim2 * dim3 + +#define PROC_SBE_FIXED_INT16_VECTOR_3(symbol, dim1, dim2, dim3 ) \ + proc_sbe_fixed_uint16 symbol, 1, dim1 * dim2 * dim3 + +#define PROC_SBE_FIXED_UINT32_VECTOR_3(symbol, dim1, dim2, dim3 ) \ + proc_sbe_fixed_uint32 symbol, 1, dim1 * dim2 * dim3 + +#define PROC_SBE_FIXED_INT32_VECTOR_3(symbol, dim1, dim2, dim3 ) \ + proc_sbe_fixed_uint32 symbol, 1, dim1 * dim2 * dim3 + +#define PROC_SBE_FIXED_UINT64_VECTOR_3(symbol, dim1, dim2, dim3 ) \ + proc_sbe_fixed_uint64 symbol, 1, dim1 * dim2 * dim3 + +#define PROC_SBE_FIXED_INT64_VECTOR_3(symbol, dim1, dim2, dim3 ) \ + proc_sbe_fixed_uint64 symbol, 1, dim1 * dim2 * dim3 + +// Non-Chip Target Attributes + +#define PROC_SBE_FIXED_TARGET_UINT8(symbol, tnumber) \ + proc_sbe_fixed_uint8 symbol, tnumber + +#define PROC_SBE_FIXED_TARGET_INT8(symbol, tnumber) \ + proc_sbe_fixed_int8 symbol, tnumber + +#define PROC_SBE_FIXED_TARGET_UINT16(symbol, tnumber) \ + proc_sbe_fixed_uint16 symbol, tnumber + +#define PROC_SBE_FIXED_TARGET_INT16(symbol, tnumber) \ + proc_sbe_fixed_int16 symbol, tnumber + +#define PROC_SBE_FIXED_TARGET_UINT32(symbol, tnumber) \ + proc_sbe_fixed_uint32 symbol, tnumber + +#define PROC_SBE_FIXED_TARGET_INT32(symbol, tnumber) \ + proc_sbe_fixed_int32 symbol, tnumber + +#define PROC_SBE_FIXED_TARGET_UINT64(symbol, tnumber) \ + proc_sbe_fixed_uint64 symbol, tnumber + +#define PROC_SBE_FIXED_TARGET_INT64(symbol, tnumber) \ + proc_sbe_fixed_int64 symbol, tnumber + +#define PROC_SBE_FIXED_TARGET_UINT8_VECTOR(symbol, tnumber, elements) \ + proc_sbe_fixed_uint8 symbol, tnumber, elements + +#define PROC_SBE_FIXED_TARGET_INT8_VECTOR(symbol, tnumber, elements) \ + proc_sbe_fixed_int8 symbol, tnumber, elements + +#define PROC_SBE_FIXED_TARGET_UINT16_VECTOR(symbol, tnumber, elements) \ + proc_sbe_fixed_uint16 symbol, tnumber, elements + +#define PROC_SBE_FIXED_TARGET_INT16_VECTOR(symbol, tnumber, elements) \ + proc_sbe_fixed_int16 symbol, tnumber, elements + +#define PROC_SBE_FIXED_TARGET_UINT32_VECTOR(symbol, tnumber, elements) \ + proc_sbe_fixed_uint32 symbol, tnumber, elements + +#define PROC_SBE_FIXED_TARGET_INT32_VECTOR(symbol, tnumber, elements) \ + proc_sbe_fixed_int32 symbol, tnumber, elements + +#define PROC_SBE_FIXED_TARGET_UINT64_VECTOR(symbol, tnumber, elements) \ + proc_sbe_fixed_uint64 symbol, tnumber, elements + +#define PROC_SBE_FIXED_TARGET_INT64_VECTOR(symbol, tnumber, elements) \ + proc_sbe_fixed_int64 symbol, tnumber, elements + +#define PROC_SBE_FIXED_TARGET_UINT8_VECTOR_2(symbol, tnumber, dim1, dim2 ) \ + proc_sbe_fixed_uint8 symbol, tnumber, dim1 * dim2 + +#define PROC_SBE_FIXED_TARGET_INT8_VECTOR_2(symbol, tnumber, dim1, dim2 ) \ + proc_sbe_fixed_int8 symbol, tnumber, dim1 * dim2 + +#define PROC_SBE_FIXED_TARGET_UINT16_VECTOR_2(symbol, tnumber, dim1, dim2 ) \ + proc_sbe_fixed_uint16 symbol, tnumber, dim1 * dim2 + +#define PROC_SBE_FIXED_TARGET_INT16_VECTOR_2(symbol, tnumber, dim1, dim2 ) \ + proc_sbe_fixed_int16 symbol, tnumber, dim1 * dim2 + +#define PROC_SBE_FIXED_TARGET_UINT32_VECTOR_2(symbol, tnumber, dim1, dim2 ) \ + proc_sbe_fixed_uint32 symbol, tnumber, dim1 * dim2 + +#define PROC_SBE_FIXED_TARGET_INT32_VECTOR_2(symbol, tnumber, dim1, dim2 ) \ + proc_sbe_fixed_int32 symbol, tnumber, dim1 * dim2 + +#define PROC_SBE_FIXED_TARGET_UINT64_VECTOR_2(symbol, tnumber, dim1, dim2 ) \ + proc_sbe_fixed_uint64 symbol, tnumber, dim1 * dim2 + +#define PROC_SBE_FIXED_TARGET_INT64_VECTOR_2(symbol, tnumber, dim1, dim2 ) \ + proc_sbe_fixed_int64 symbol, tnumber, dim1 * dim2 + +#define PROC_SBE_FIXED_TARGET_UINT8_VECTOR_3(symbol, tnumber, dim1, dim2, dim3 ) \ + proc_sbe_fixed_uint8 symbol, tnumber, dim1 * dim2 * dim3 + +#define PROC_SBE_FIXED_TARGET_INT8_VECTOR_3(symbol, tnumber, dim1, dim2, dim3 ) \ + proc_sbe_fixed_uint8 symbol, tnumber, dim1 * dim2 * dim3 + +#define PROC_SBE_FIXED_TARGET_UINT16_VECTOR_3(symbol, tnumber, dim1, dim2, dim3 ) \ + proc_sbe_fixed_uint16 symbol, tnumber, dim1 * dim2 * dim3 + +#define PROC_SBE_FIXED_TARGET_INT16_VECTOR_3(symbol, tnumber, dim1, dim2, dim3 ) \ + proc_sbe_fixed_uint16 symbol, tnumber, dim1 * dim2 * dim3 + +#define PROC_SBE_FIXED_TARGET_UINT32_VECTOR_3(symbol, tnumber, dim1, dim2, dim3 ) \ + proc_sbe_fixed_uint32 symbol, tnumber, dim1 * dim2 * dim3 + +#define PROC_SBE_FIXED_TARGET_INT32_VECTOR_3(symbol, tnumber, dim1, dim2, dim3 ) \ + proc_sbe_fixed_uint32 symbol, tnumber, dim1 * dim2 * dim3 + +#define PROC_SBE_FIXED_TARGET_UINT64_VECTOR_3(symbol, tnumber, dim1, dim2, dim3 ) \ + proc_sbe_fixed_uint64 symbol, tnumber, dim1 * dim2 * dim3 + +#define PROC_SBE_FIXED_TARGET_INT64_VECTOR_3(symbol, tnumber, dim1, dim2, dim3 ) \ + proc_sbe_fixed_uint64 symbol, tnumber, dim1 * dim2 * dim3 + +#define PROC_SBE_FIXED_QUADIA(symbol, space, address) \ + proc_sbe_fixed_quadia symbol, (space), (address) + + +#else // __ASSEMBLER__ (eg the C portion) + +#define PROC_SBE_FIXED_UINT8(symbol) \ + uint8_t symbol + +#define PROC_SBE_FIXED_INT8(symbol) \ + int8_t symbol + +#define PROC_SBE_FIXED_UINT16(symbol) \ + uint16_t symbol + +#define PROC_SBE_FIXED_INT16(symbol) \ + int16_t symbol + +#define PROC_SBE_FIXED_UINT32(symbol) \ + uint32_t symbol + +#define PROC_SBE_FIXED_INT32(symbol) \ + int32_t symbol + +#define PROC_SBE_FIXED_UINT64(symbol) \ + uint64_t symbol + +#define PROC_SBE_FIXED_INT64(symbol) \ + int64_t symbol + +#define PROC_SBE_FIXED_UINT8_VECTOR(symbol, elements) \ + uint8_t symbol[elements] + +#define PROC_SBE_FIXED_INT8_VECTOR(symbol, elements) \ + int8_t symbol[elements] + +#define PROC_SBE_FIXED_UINT16_VECTOR(symbol, elements) \ + uint16_t symbol[elements] + +#define PROC_SBE_FIXED_INT16_VECTOR(symbol, elements) \ + int16_t symbol[elements] + +#define PROC_SBE_FIXED_UINT32_VECTOR(symbol, elements) \ + uint32_t symbol[elements] + +#define PROC_SBE_FIXED_INT32_VECTOR(symbol, elements) \ + int32_t symbol[elements] + +#define PROC_SBE_FIXED_UINT64_VECTOR(symbol, elements) \ + uint64_t symbol[elements] + +#define PROC_SBE_FIXED_INT64_VECTOR(symbol, elements) \ + int64_t symbol[elements] + +#define PROC_SBE_FIXED_UINT8_VECTOR_2(symbol, dim1, dim2 ) \ + uint8_t symbol[dim1][dim2] + +#define PROC_SBE_FIXED_INT8_VECTOR_2(symbol, dim1, dim2 ) \ + int8_t symbol[dim1][dim2] + +#define PROC_SBE_FIXED_UINT16_VECTOR_2(symbol, dim1, dim2 ) \ + uint16_t symbol[dim1][dim2] + +#define PROC_SBE_FIXED_INT16_VECTOR_2(symbol, dim1, dim2 ) \ + int16_t symbol[dim1][dim2] + +#define PROC_SBE_FIXED_UINT32_VECTOR_2(symbol, dim1, dim2 ) \ + uint32_t symbol[dim1][dim2] + +#define PROC_SBE_FIXED_INT32_VECTOR_2(symbol, dim1, dim2 ) \ + int32_t symbol[dim1][dim2] + +#define PROC_SBE_FIXED_UINT64_VECTOR_2(symbol, dim1, dim2 ) \ + uint64_t symbol[dim1][dim2] + +#define PROC_SBE_FIXED_INT64_VECTOR_2(symbol, dim1, dim2 ) \ + int64_t symbol[dim1][dim2] + +#define PROC_SBE_FIXED_UINT8_VECTOR_3(symbol, dim1, dim2, dim3 ) \ + uint8_t symbol[dim1][dim2][dim3] + +#define PROC_SBE_FIXED_INT8_VECTOR_3(symbol, dim1, dim2, dim3 ) \ + int8_t symbol[dim1][dim2][dim3] + +#define PROC_SBE_FIXED_UINT16_VECTOR_3(symbol, dim1, dim2, dim3 ) \ + uint16_t symbol[dim1][dim2][dim3] + +#define PROC_SBE_FIXED_INT16_VECTOR_3(symbol, dim1, dim2, dim3 ) \ + int16_t symbol[dim1][dim2][dim3] + +#define PROC_SBE_FIXED_UINT32_VECTOR_3(symbol, dim1, dim2, dim3 ) \ + uint32_t symbol[dim1][dim2][dim3] + +#define PROC_SBE_FIXED_INT32_VECTOR_3(symbol, dim1, dim2, dim3 ) \ + int32_t symbol[dim1][dim2][dim3] + +#define PROC_SBE_FIXED_UINT64_VECTOR_3(symbol, dim1, dim2, dim3 ) \ + uint64_t symbol[dim1][dim2][dim3] + +#define PROC_SBE_FIXED_INT64_VECTOR_3(symbol, dim1, dim2, dim3 ) \ + int64_t symbol[dim1][dim2][dim3] + +// Non-Chip Target Attributes + +#define PROC_SBE_FIXED_TARGET_UINT8(symbol, tnumber) \ + uint8_t symbol[tnumber] + +#define PROC_SBE_FIXED_TARGET_INT8(symbol, tnumber) \ + int8_t symbol[tnumber] + +#define PROC_SBE_FIXED_TARGET_UINT16(symbol, tnumber) \ + uint16_t symbol[tnumber] + +#define PROC_SBE_FIXED_TARGET_INT16(symbol, tnumber) \ + int16_t symbol[tnumber] + +#define PROC_SBE_FIXED_TARGET_UINT32(symbol, tnumber) \ + uint32_t symbol[tnumber] + +#define PROC_SBE_FIXED_TARGET_INT32(symbol, tnumber) \ + int32_t symbol[tnumber] + +#define PROC_SBE_FIXED_TARGET_UINT64(symbol, tnumber) \ + uint64_t symbol[tnumber] + +#define PROC_SBE_FIXED_TARGET_INT64(symbol, tnumber) \ + int64_t symbol[tnumber] + +#define PROC_SBE_FIXED_TARGET_UINT8_VECTOR(symbol, tnumber, elements) \ + uint8_t symbol[tnumber][elements] + +#define PROC_SBE_FIXED_TARGET_INT8_VECTOR(symbol, tnumber, elements) \ + int8_t symbol[tnumber][elements] + +#define PROC_SBE_FIXED_TARGET_UINT16_VECTOR(symbol, tnumber, elements) \ + uint16_t symbol[tnumber][elements] + +#define PROC_SBE_FIXED_TARGET_INT16_VECTOR(symbol, tnumber, elements) \ + int16_t symbol[tnumber][elements] + +#define PROC_SBE_FIXED_TARGET_UINT32_VECTOR(symbol, tnumber, elements) \ + uint32_t symbol[tnumber][elements] + +#define PROC_SBE_FIXED_TARGET_INT32_VECTOR(symbol, tnumber, elements) \ + int32_t symbol[tnumber][elements] + +#define PROC_SBE_FIXED_TARGET_UINT64_VECTOR(symbol, tnumber, elements) \ + uint64_t symbol[tnumber][elements] + +#define PROC_SBE_FIXED_TARGET_INT64_VECTOR(symbol, tnumber, elements) \ + int64_t symbol[tnumber][elements] + +#define PROC_SBE_FIXED_TARGET_UINT8_VECTOR_2(symbol, tnumber, dim1, dim2 ) \ + uint8_t symbol[tnumber][dim1][dim2] + +#define PROC_SBE_FIXED_TARGET_INT8_VECTOR_2(symbol, tnumber, dim1, dim2 ) \ + int8_t symbol[tnumber][dim1][dim2] + +#define PROC_SBE_FIXED_TARGET_UINT16_VECTOR_2(symbol, tnumber, dim1, dim2 ) \ + uint16_t symbol[tnumber][dim1][dim2] + +#define PROC_SBE_FIXED_TARGET_INT16_VECTOR_2(symbol, tnumber, dim1, dim2 ) \ + int16_t symbol[tnumber][dim1][dim2] + +#define PROC_SBE_FIXED_TARGET_UINT32_VECTOR_2(symbol, tnumber, dim1, dim2 ) \ + uint32_t symbol[tnumber][dim1][dim2] + +#define PROC_SBE_FIXED_TARGET_INT32_VECTOR_2(symbol, tnumber, dim1, dim2 ) \ + int32_t symbol[tnumber][dim1][dim2] + +#define PROC_SBE_FIXED_TARGET_UINT64_VECTOR_2(symbol, tnumber, dim1, dim2 ) \ + uint64_t symbol[tnumber][dim1][dim2] + +#define PROC_SBE_FIXED_TARGET_INT64_VECTOR_2(symbol, tnumber, dim1, dim2 ) \ + int64_t symbol[tnumber][dim1][dim2] + +#define PROC_SBE_FIXED_TARGET_UINT8_VECTOR_3(symbol, tnumber, dim1, dim2, dim3 ) \ + uint8_t symbol[tnumber][dim1][dim2][dim3] + +#define PROC_SBE_FIXED_TARGET_INT8_VECTOR_3(symbol, tnumber, dim1, dim2, dim3 ) \ + int8_t symbol[tnumber][dim1][dim2][dim3] + +#define PROC_SBE_FIXED_TARGET_UINT16_VECTOR_3(symbol, tnumber, dim1, dim2, dim3 ) \ + uint16_t symbol[tnumber][dim1][dim2][dim3] + +#define PROC_SBE_FIXED_TARGET_INT16_VECTOR_3(symbol, tnumber, dim1, dim2, dim3 ) \ + int16_t symbol[tnumber][dim1][dim2][dim3] + +#define PROC_SBE_FIXED_TARGET_UINT32_VECTOR_3(symbol, tnumber, dim1, dim2, dim3 ) \ + uint32_t symbol[tnumber][dim1][dim2][dim3] + +#define PROC_SBE_FIXED_TARGET_INT32_VECTOR_3(symbol, tnumber, dim1, dim2, dim3 ) \ + int32_t symbol[tnumber][dim1][dim2][dim3] + +#define PROC_SBE_FIXED_TARGET_UINT64_VECTOR_3(symbol, tnumber, dim1, dim2, dim3 ) \ + uint64_t symbol[tnumber][dim1][dim2][dim3] + +#define PROC_SBE_FIXED_TARGET_INT64_VECTOR_3(symbol, tnumber, dim1, dim2, dim3 ) \ + int64_t symbol[tnumber][dim1][dim2][dim3] + +#define PROC_SBE_FIXED_QUADIA(symbol, space, address) uint64_t symbol + +#endif // __ASSEMBLER__ + +#endif // __SBE_COMMON_H diff --git a/src/build/utils/sbe_link.H b/src/build/utils/sbe_link.H new file mode 100644 index 00000000..0321a0a8 --- /dev/null +++ b/src/build/utils/sbe_link.H @@ -0,0 +1,102 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/build/utils/sbe_link.H $ */ +/* */ +/* OpenPOWER sbe Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2016 */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ +#ifndef __SBE_LINK_H +#define __SBE_LINK_H + +// $Id: Exp $ + +/// \file sbe_link.H +/// \brief Constants required for linking SBE code images +/// +/// This header contains those cpp manifest constants required for processing +/// the linker scripts used to generate SBE code images. They may also be +/// useful for PPE assembler programming so they are included in sbe.H as +/// well. +/// +/// The link address of OTPROM code as a byte-address +/// +/// The OTPROM can be addressed both as an I2C slave and as a direct PIB +/// slave. The I2C slave is at PIB local address 0x0 and the PIB memory +/// interface is at local address 0x8000. SBE/IPL uses the PIB addressing +/// mode, so the OTPROM image is linked at 0x40000 (the byte-address +/// equivalent of 0x8000). +#define OTPROM_ORIGIN 0xC0000 + +/// The amount of memory contained in each OTPROM macro +#define OTPROM_BLOCK_SIZE 1024 + +/// The amount of memory reserved for OTPROM code +/// +/// This amount is exclusive of physical OTPROM memory reserved for compressed +/// scan ring images. +#define OTPROM_CODE_SIZE (1 * OTPROM_BLOCK_SIZE) + +/// The link address of the P9 SBE Base image +#define SBE_BASE_ORIGIN 0xFFFE8000 +/// SBE base image length ( 96 KB - 512 bytes for loader) +#define SBE_BASE_LENGTH 0x17DFF + +///This Index depends upon XIP HEADER File +// Start offset of sectionTable in XIP header. There are 8 entries +// of 8 byte each. +#define SBE_XIP_TOC_OFFSET 8*8 + +/// The link address of the P9 SBE Base image +#define SBE_SEEPROM_BASE_ORIGIN 0x80000000 + +/// This Index depends upon XIP HEADER File +/// Each section table entry is 12 bytes(SIZE_OF_SBE_XIP_SECTION) size, +// Base Loader is 10 th (P9_XIP_SECTION_BASELOADER) section +#define SBE_LOADER_BASE_SECTION SBE_SEEPROM_BASE_ORIGIN + SBE_XIP_TOC_OFFSET \ + + 120 +// Base Loader start address +#define SBE_LOADER_BASE_ORIGIN 0xFFFFFE00 +// Base Loader length +#define SBE_LOADER_BASE_LENGTH 0x200 + +// Base Loader entry function offset in header +#define SBE_LOADER_ENTRY_HEADER_OFFSET 20 + +/// The physical address offset where SBE-SEEPROM code is loaded +/// +/// This address *must* be a constant known to the OTPROM code. +#define SBE_SEEPROM_LOAD_ADDRESS 0x2000 + +/// The offset (in bytes) of the .fixed section in P9 SBE-XIP images +#define SBE_XIP_FIXED_OFFSET 512 + +/// The link address of the PIBMEM image +#define PIBMEM_ORIGIN 0 + +/// The amount of space available in the PIBMEM, in bytes (96KB) +#define PIBMEM_SIZE (96 * 1024) + +/// The fixed section of Otprom +#define OTPROM_FIXED_SIZE (OTPROM_ORIGIN + 0x340) + +/// Sbe fixed sction for the pibmem repair +#define SBE_FIXED_SECTION (SBE_SEEPROM_BASE_ORIGIN + SBE_XIP_TOC_OFFSET + 12) + +#endif // __SBE_LINK_H + diff --git a/src/build/utils/utils.mk b/src/build/utils/utils.mk new file mode 100644 index 00000000..e1fed401 --- /dev/null +++ b/src/build/utils/utils.mk @@ -0,0 +1,27 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/build/utils/utils.mk $ +# +# OpenPOWER sbe Project +# +# Contributors Listed Below - COPYRIGHT 2015,2016 +# +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. See the License for the specific language governing +# permissions and limitations under the License. +# +# IBM_PROLOG_END_TAG +BUILDDATA-S-SOURCES = base_ppe_header.S +BUILDDATA-S-SOURCES += base_sbe_fixed.S + +BUILDDATA_OBJECTS += $(BUILDDATA-S-SOURCES:.S=.o) -- cgit v1.2.1