Changeset 4646710 in mainline
- Timestamp:
- 2017-06-07T15:39:23Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 239e32b8
- Parents:
- 22299ed
- Files:
-
- 1 deleted
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/Makefile
r22299ed r4646710 27 27 # 28 28 29 .PHONY: all build_dist build_compsclean_dist clean29 .PHONY: all build_dist clean_dist clean 30 30 31 31 include Makefile.common 32 32 33 all: $(VERSION_DEF) $(COMMON_MAKEFILE) $(COMMON_HEADER) $(CONFIG_MAKEFILE) $(CONFIG_HEADER) $(PREBUILD) 33 all: $(VERSION_DEF) $(COMMON_MAKEFILE) $(COMMON_HEADER) $(CONFIG_MAKEFILE) $(CONFIG_HEADER) $(PREBUILD) build_dist 34 34 $(MAKE) -r -f $(BUILD) PRECHECK=$(PRECHECK) 35 35 ifneq ($(POSTBUILD),) 36 36 $(MAKE) -r -f $(POSTBUILD) PRECHECK=$(PRECHECK) 37 endif38 39 build_comps: $(COMPONENTS) $(LINK).in40 $(PACK) $(OBJCOPY) $(BFD_NAME) $(BFD_ARCH) arch/$(KARCH) $(COMPONENTS)41 42 $(INITRD).img: build_dist43 ifeq ($(RDFMT),tmpfs)44 $(MKTMPFS) $(DIST_PATH) $@45 endif46 ifeq ($(RDFMT),fat)47 $(MKFAT) 1048576 $(DIST_PATH) $@48 endif49 ifeq ($(RDFMT),ext4fs)50 $(MKEXT4) 1048576 $(DIST_PATH) $@51 37 endif 52 38 … … 132 118 $(MAKE) -r -f $(POSTBUILD) clean PRECHECK=$(PRECHECK) 133 119 endif 134 rm -fr $(SANDBOX)135 120 rm -f $(POST_OUTPUT) $(BOOT_OUTPUT) $(DEPEND) $(DEPEND_PREV) arch/*/include/common.h 136 121 find generic/src/ arch/*/src/ genarch/src/ -name '*.o' -follow -exec rm \{\} \; 137 122 138 123 clean_dist: 139 rm -f $(INITRD).img $(COMPS _H) $(COMPS_C) $(LINK) $(LINK).comp *.co124 rm -f $(INITRD).img $(COMPS).s $(COMPS).h $(COMPS)_desc.c $(COMPS).o $(COMPS)_desc.o $(COMPS).zip $(LINK) 140 125 find $(USPACE_PATH)/dist -mindepth 1 -maxdepth 1 -type f -exec rm \{\} \; 141 126 rm -f $(USPACE_PATH)/dist/srv/* -
boot/Makefile.build
r22299ed r4646710 94 94 95 95 OBJECTS := $(addsuffix .o,$(basename $(SOURCES))) 96 COMPONENT_OBJECTS := $(addsuffix .co,$(basename $(MODULES)))97 96 98 97 all: $(VERSION_DEF) $(COMMON_MAKEFILE) $(COMMON_HEADER) $(CONFIG_MAKEFILE) $(CONFIG_HEADER) $(BOOT_OUTPUT) … … 102 101 rm -f $(RAW) $(MAP) $(ARCH_INCLUDE) $(GENARCH_INCLUDE) 103 102 103 ifneq ($(MAKECMDGOALS),clean) 104 104 -include $(DEPEND) 105 endif 105 106 106 107 $(BOOT_OUTPUT): $(RAW) 107 108 $(OBJCOPY) -O $(BFD_OUTPUT) $< $@ 108 109 109 $(RAW): $(OBJECTS) $( COMPONENT_OBJECTS) $(LINK)110 $(LD) -n $(LFLAGS) -T $(LINK) -M -Map $(MAP) -o $@ $( COMPONENT_OBJECTS) $(OBJECTS)110 $(RAW): $(OBJECTS) $(LINK) 111 $(LD) -n $(LFLAGS) -T $(LINK) -M -Map $(MAP) -o $@ $(OBJECTS) 111 112 112 $(LINK): $( LINK).comp $(DEPEND)113 $(GCC) $(DEFS) $(GCC_CFLAGS) -D__ASM__ -D__LINKER__ -E -x c $(LINK). comp| grep -v "^\#" > $(LINK)113 $(LINK): $(DEPEND) 114 $(GCC) $(DEFS) $(GCC_CFLAGS) -D__ASM__ -D__LINKER__ -E -x c $(LINK).in | grep -v "^\#" > $(LINK) 114 115 115 116 %.o: %.S $(DEPEND) … … 125 126 endif 126 127 127 $(DEPEND): $(ARCH_INCLUDE) $(GENARCH_INCLUDE) $(COMMON_HEADER_ARCH) 128 %.o: %.s $(DEPEND) 129 $(AS) $(AFLAGS) -o $@ $< 130 ifeq ($(PRECHECK),y) 131 $(JOBFILE) $(JOB) $< $@ as asm 132 endif 133 134 $(DEPEND): $(ARCH_INCLUDE) $(GENARCH_INCLUDE) $(COMMON_HEADER_ARCH) $(PRE_DEPEND) 128 135 makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(SOURCES) > $@ 2> /dev/null 129 136 -[ -f $(DEPEND_PREV) ] && diff -q $(DEPEND_PREV) $@ && mv -f $(DEPEND_PREV) $@ 137 138 $(COMPS).s: $(COMPS).zip 139 unzip -p $< $@ > $@ 140 141 $(COMPS).h: $(COMPS).zip 142 unzip -p $< $@ > $@ 143 144 $(COMPS)_desc.c: $(COMPS).zip 145 unzip -p $< $@ > $@ 146 147 $(COMPS).zip: $(COMPONENTS) 148 $(MKARRAY) --deflate $(COMPS) $(COMP) "$(AS_PROLOG)" ".section .components, \"a\"" $^ 149 150 $(INITRD).img: 151 ifeq ($(RDFMT),tmpfs) 152 $(MKTMPFS) $(DIST_PATH) $@ 153 endif 154 ifeq ($(RDFMT),fat) 155 $(MKFAT) 1048576 $(DIST_PATH) $@ 156 endif 157 ifeq ($(RDFMT),ext4fs) 158 $(MKEXT4) 1048576 $(DIST_PATH) $@ 159 endif 130 160 131 161 $(ARCH_INCLUDE): arch/$(KARCH)/include/ -
boot/Makefile.common
r22299ed r4646710 52 52 DRVS_PATH = drv 53 53 54 SANDBOX = pack 55 PACK = $(TOOLS_PATH)/pack.py 54 MKARRAY = $(TOOLS_PATH)/mkarray.py 56 55 MKTMPFS = $(TOOLS_PATH)/mktmpfs.py 57 56 MKFAT = $(TOOLS_PATH)/mkfat.py … … 251 250 252 251 LINK = arch/$(BARCH)/_link.ld 253 COMP S_H = arch/$(BARCH)/include/_components.h254 COMPS _C = arch/$(BARCH)/src/_components.c252 COMP = component 253 COMPS = $(COMP)s 255 254 256 255 -include arch/$(BARCH)/Makefile.inc … … 276 275 JOB ?= image.job 277 276 MAP ?= image.map 278 PREBUILD ?= build_comps279 277 BUILD ?= Makefile.build -
boot/arch/arm32/Makefile.inc
r22299ed r4646710 96 96 arch/$(BARCH)/src/mm.c \ 97 97 arch/$(BARCH)/src/putchar.c \ 98 $(COMPS_C) \ 98 $(COMPS).s \ 99 $(COMPS)_desc.c \ 99 100 genarch/src/division.c \ 100 101 generic/src/memstr.c \ … … 105 106 generic/src/version.c \ 106 107 generic/src/inflate.c 108 109 PRE_DEPEND = $(COMPS).s $(COMPS).h $(COMPS)_desc.c -
boot/arch/arm32/_link.ld.in
r22299ed r4646710 23 23 *(.bss); /* uninitialized static variables */ 24 24 *(COMMON); /* global variables */ 25 [[COMPONENTS]] 25 *(.components); 26 26 } 27 27 bdata_end = .; -
boot/arch/arm32/src/main.c
r22299ed r4646710 37 37 #include <arch/asm.h> 38 38 #include <arch/mm.h> 39 #include <arch/_components.h>40 39 #include <halt.h> 41 40 #include <printf.h> … … 49 48 #include <inflate.h> 50 49 #include <arch/cp15.h> 50 #include "../../components.h" 51 51 52 52 #define TOP2ADDR(top) (((void *) PA2KA(BOOT_OFFSET)) + (top)) … … 99 99 100 100 for (size_t i = 0; i < COMPONENTS; i++) { 101 printf(" %p|%p: %s image (%u/%u bytes)\n", components[i]. start,102 components[i]. start, components[i].name, components[i].inflated,101 printf(" %p|%p: %s image (%u/%u bytes)\n", components[i].addr, 102 components[i].addr, components[i].name, components[i].inflated, 103 103 components[i].size); 104 104 } … … 129 129 130 130 for (size_t i = cnt; i > 0; i--) { 131 void *tail = components[i - 1]. start+ components[i - 1].size;131 void *tail = components[i - 1].addr + components[i - 1].size; 132 132 if (tail >= dest[i - 1]) { 133 133 printf("\n%s: Image too large to fit (%p >= %p), halting.\n", … … 138 138 printf("%s ", components[i - 1].name); 139 139 140 int err = inflate(components[i - 1]. start, components[i - 1].size,140 int err = inflate(components[i - 1].addr, components[i - 1].size, 141 141 dest[i - 1], components[i - 1].inflated); 142 142 if (err != EOK) { -
boot/arch/ia64/Makefile.inc
r22299ed r4646710 48 48 arch/$(BARCH)/src/pal_asm.S \ 49 49 arch/$(BARCH)/src/putchar.c \ 50 $(COMPS_C) \ 50 $(COMPS).s \ 51 $(COMPS)_desc.c \ 51 52 genarch/src/efi.c \ 52 53 genarch/src/division.c \ … … 88 89 bus/isa 89 90 91 PRE_DEPEND = $(COMPS).s $(COMPS).h $(COMPS)_desc.c -
boot/arch/ia64/_link.ld.in
r22299ed r4646710 16 16 *(.bss); /* uninitialized static variables */ 17 17 *(COMMON); 18 [[COMPONENTS]] 18 *(.components); 19 19 } 20 20 21 21 /DISCARD/ : { 22 22 *(.*); -
boot/arch/ia64/src/main.c
r22299ed r4646710 33 33 #include <arch/arch.h> 34 34 #include <arch/asm.h> 35 #include <arch/_components.h>36 35 #include <genarch/efi.h> 37 36 #include <arch/sal.h> … … 46 45 #include <errno.h> 47 46 #include <inflate.h> 47 #include "../../components.h" 48 48 49 49 #define DEFAULT_MEMORY_BASE 0x4000000ULL … … 78 78 memmap[items].size = DEFAULT_LEGACY_IO_SIZE; 79 79 memmap[items].type = MEMMAP_IO_PORTS; 80 items++; 80 items++; 81 81 } else { 82 82 char *cur, *mm_base = (char *) bootpar->efi_memmap; … … 159 159 size_t i; 160 160 for (i = 0; i < COMPONENTS; i++) 161 printf(" %p|%p: %s image (%zu/%zu bytes)\n", components[i]. start,162 components[i]. start, components[i].name,161 printf(" %p|%p: %s image (%zu/%zu bytes)\n", components[i].addr, 162 components[i].addr, components[i].name, 163 163 components[i].inflated, components[i].size); 164 164 … … 202 202 * overlap with the destination for inflate(). 203 203 */ 204 memmove((void *) top, components[i - 1]. start, components[i - 1].size);204 memmove((void *) top, components[i - 1].addr, components[i - 1].size); 205 205 206 206 int err = inflate((void *) top, components[i - 1].size, -
boot/arch/mips32/Makefile.inc
r22299ed r4646710 30 30 BITS = 32 31 31 EXTRA_CFLAGS = -msoft-float -mno-abicalls -G 0 -fno-zero-initialized-in-bss -mabi=32 32 AS_PROLOG = .module softfloat; 32 33 33 34 ifeq ($(MACHINE),msim) … … 74 75 arch/$(BARCH)/src/main.c \ 75 76 arch/$(BARCH)/src/putchar.c \ 76 $(COMPS_C) \ 77 $(COMPS).s \ 78 $(COMPS)_desc.c \ 77 79 genarch/src/division.c \ 78 80 genarch/src/multiplication.c \ … … 84 86 generic/src/version.c \ 85 87 generic/src/inflate.c 88 89 PRE_DEPEND = $(COMPS).s $(COMPS).h $(COMPS)_desc.c -
boot/arch/mips32/_link.ld.in
r22299ed r4646710 21 21 *(.bss); /* uninitialized static variables */ 22 22 *(COMMON); /* global variables */ 23 [[COMPONENTS]] 23 *(.components); 24 24 } 25 25 -
boot/arch/mips32/src/main.c
r22299ed r4646710 30 30 #include <arch/arch.h> 31 31 #include <arch/asm.h> 32 #include <arch/_components.h>33 32 #include <halt.h> 34 33 #include <printf.h> … … 40 39 #include <errno.h> 41 40 #include <inflate.h> 41 #include "../../components.h" 42 42 43 43 #define TOP2ADDR(top) (((void *) PA2KA(BOOT_OFFSET)) + (top)) … … 64 64 size_t i; 65 65 for (i = 0; i < COMPONENTS; i++) 66 printf(" %p|%p: %s image (%zu/%zu bytes)\n", components[i]. start,67 (uintptr_t) components[i]. start>= PA2KSEG(0) ?68 (void *) KSEG2PA(components[i]. start) :69 (void *) KA2PA(components[i]. start),66 printf(" %p|%p: %s image (%zu/%zu bytes)\n", components[i].addr, 67 (uintptr_t) components[i].addr >= PA2KSEG(0) ? 68 (void *) KSEG2PA(components[i].addr) : 69 (void *) KA2PA(components[i].addr), 70 70 components[i].name, components[i].inflated, 71 71 components[i].size); … … 107 107 printf("%s ", components[i - 1].name); 108 108 109 int err = inflate(components[i - 1]. start, components[i - 1].size,109 int err = inflate(components[i - 1].addr, components[i - 1].size, 110 110 dest[i - 1], components[i - 1].inflated); 111 111 -
boot/arch/ppc32/Makefile.inc
r22299ed r4646710 57 57 arch/$(BARCH)/src/main.c \ 58 58 arch/$(BARCH)/src/ofw.c \ 59 $(COMPS_C) \ 59 $(COMPS).s \ 60 $(COMPS)_desc.c \ 60 61 genarch/src/ofw.c \ 61 62 genarch/src/ofw_tree.c \ … … 70 71 generic/src/version.c \ 71 72 generic/src/inflate.c 73 74 PRE_DEPEND = $(COMPS).s $(COMPS).h $(COMPS)_desc.c -
boot/arch/ppc32/_link.ld.in
r22299ed r4646710 18 18 *(.bss); /* uninitialized static variables */ 19 19 *(COMMON); /* global variables */ 20 [[COMPONENTS]] 20 *(.components); 21 21 } 22 22 -
boot/arch/ppc32/src/main.c
r22299ed r4646710 30 30 #include <arch/arch.h> 31 31 #include <arch/asm.h> 32 #include <arch/_components.h>33 32 #include <genarch/ofw.h> 34 33 #include <genarch/ofw_tree.h> … … 42 41 #include <errno.h> 43 42 #include <inflate.h> 43 #include "../../components.h" 44 44 45 45 #define BALLOC_MAX_SIZE 131072 … … 75 75 size_t i; 76 76 for (i = 0; i < COMPONENTS; i++) 77 printf(" %p|%p: %s image (%zu/%zu bytes)\n", components[i]. start,78 ofw_translate(components[i]. start), components[i].name,77 printf(" %p|%p: %s image (%zu/%zu bytes)\n", components[i].addr, 78 ofw_translate(components[i].addr), components[i].name, 79 79 components[i].inflated, components[i].size); 80 80 … … 139 139 printf("%s ", components[i - 1].name); 140 140 141 int err = inflate(components[i - 1]. start, components[i - 1].size,141 int err = inflate(components[i - 1].addr, components[i - 1].size, 142 142 inflate_base + dest[i - 1], components[i - 1].inflated); 143 143 -
boot/arch/riscv64/_link.ld.in
r22299ed r4646710 17 17 *(.bss); /* uninitialized static variables */ 18 18 *(COMMON); /* global variables */ 19 [[COMPONENTS]]20 19 } 21 20 -
boot/arch/sparc64/Makefile.inc
r22299ed r4646710 57 57 arch/$(BARCH)/src/main.c \ 58 58 arch/$(BARCH)/src/ofw.c \ 59 $(COMPS_C) \ 59 $(COMPS).s \ 60 $(COMPS)_desc.c \ 60 61 genarch/src/ofw.c \ 61 62 genarch/src/ofw_tree.c \ … … 68 69 generic/src/version.c \ 69 70 generic/src/inflate.c 71 72 PRE_DEPEND = $(COMPS).s $(COMPS).h $(COMPS)_desc.c -
boot/arch/sparc64/_link.ld.in
r22299ed r4646710 15 15 *(.bss); /* uninitialized static variables */ 16 16 *(COMMON); /* global variables */ 17 [[COMPONENTS]] 17 *(.components); 18 18 } 19 19 -
boot/arch/sparc64/src/main.c
r22299ed r4646710 32 32 #include <arch/asm.h> 33 33 #include <arch/ofw.h> 34 #include <arch/_components.h>35 34 #include <genarch/ofw.h> 36 35 #include <genarch/ofw_tree.h> … … 44 43 #include <errno.h> 45 44 #include <inflate.h> 45 #include "../../components.h" 46 46 47 47 /* The lowest ID (read from the VER register) of some US3 CPU model */ … … 220 220 size_t i; 221 221 for (i = 0; i < COMPONENTS; i++) 222 printf(" %p|%p: %s image (%zu/%zu bytes)\n", components[i]. start,223 ofw_translate(components[i]. start), components[i].name,222 printf(" %p|%p: %s image (%zu/%zu bytes)\n", components[i].addr, 223 ofw_translate(components[i].addr), components[i].name, 224 224 components[i].inflated, components[i].size); 225 225 … … 267 267 ALIGN_UP(components[i - 1].inflated, PAGE_SIZE), -1); 268 268 269 int err = inflate(components[i - 1]. start, components[i - 1].size,269 int err = inflate(components[i - 1].addr, components[i - 1].size, 270 270 dest[i - 1], components[i - 1].inflated); 271 271
Note:
See TracChangeset
for help on using the changeset viewer.