Changeset 5af6cf3d in mainline
- Timestamp:
- 2018-03-05T15:55:34Z (7 years ago)
- Children:
- db3c8834
- Parents:
- d5e5fd1
- Files:
-
- 9 added
- 6 deleted
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
.gitignore
rd5e5fd1 r5af6cf3d 9 9 *.so.* 10 10 *.d 11 *.ag.probe.s12 *.ag.probe.c13 11 *.pyc 14 12 tag … … 16 14 common.h.new 17 15 deps.mk 18 Makefile.ag.depend19 16 /Makefile.config 20 17 /Makefile.common … … 46 43 boot/image.raw 47 44 kernel/arch/amd64/_link.ld 48 kernel/arch/amd64/include/arch/boot/memmap_struct.h49 kernel/arch/amd64/include/arch/common.h50 kernel/arch/amd64/include/arch/context_struct.h51 kernel/arch/amd64/include/arch/istate_struct.h52 kernel/arch/amd64/include/arch/kseg_struct.h53 45 kernel/arch/arm32/_link.ld 54 kernel/arch/arm32/include/arch/context_struct.h55 kernel/arch/arm32/include/arch/istate_struct.h56 46 kernel/arch/ia32/_link.ld 57 kernel/arch/ia32/include/arch/boot/memmap_struct.h58 kernel/arch/ia32/include/arch/context_struct.h59 kernel/arch/ia32/include/arch/istate_struct.h60 47 kernel/arch/ia64/_link.ld 61 kernel/arch/ia64/include/arch/context_struct.h62 kernel/arch/ia64/include/arch/istate_struct.h63 48 kernel/arch/mips32/_link.ld 64 kernel/arch/mips32/include/arch/context_struct.h65 kernel/arch/mips32/include/arch/fpu_context_struct.h66 kernel/arch/mips32/include/arch/istate_struct.h67 49 kernel/arch/ppc32/_link.ld 68 kernel/arch/ppc32/include/arch/context_struct.h69 kernel/arch/ppc32/include/arch/fpu_context_struct.h70 kernel/arch/ppc32/include/arch/istate_struct.h71 50 kernel/arch/sparc64/_link.ld 72 kernel/arch/sparc64/include/arch/context_struct.h73 kernel/arch/sparc64/include/arch/istate_struct.h74 51 kernel/arch/abs32le/_link.ld 75 kernel/genarch/include/genarch/multiboot/multiboot_info_struct.h76 kernel/genarch/include/genarch/multiboot/multiboot_memmap_struct.h77 52 kernel/generic/src/debug/real_map.bin 78 53 kernel/kernel.bin … … 344 319 uspace/lib/c/arch/amd64/_link-shlib.ld 345 320 uspace/lib/c/arch/amd64/_link.ld 346 uspace/lib/c/arch/amd64/include/libarch/common.h347 uspace/lib/c/arch/amd64/include/libarch/fibril_context.h348 uspace/lib/c/arch/amd64/include/libarch/istate_struct.h349 321 uspace/lib/c/arch/arm32/_link-dlexe.ld 350 322 uspace/lib/c/arch/arm32/_link-loader.ld 351 323 uspace/lib/c/arch/arm32/_link-shlib.ld 352 324 uspace/lib/c/arch/arm32/_link.ld 353 uspace/lib/c/arch/arm32/include/libarch/fibril_context.h354 uspace/lib/c/arch/arm32/include/libarch/istate_struct.h355 325 uspace/lib/c/arch/ia32/_link-dlexe.ld 356 326 uspace/lib/c/arch/ia32/_link-loader.ld 357 327 uspace/lib/c/arch/ia32/_link-shlib.ld 358 328 uspace/lib/c/arch/ia32/_link.ld 359 uspace/lib/c/arch/ia32/include/libarch/fibril_context.h360 uspace/lib/c/arch/ia32/include/libarch/istate_struct.h361 329 uspace/lib/c/arch/ia64/_link-dlexe.ld 362 330 uspace/lib/c/arch/ia64/_link-loader.ld 363 331 uspace/lib/c/arch/ia64/_link-shlib.ld 364 332 uspace/lib/c/arch/ia64/_link.ld 365 uspace/lib/c/arch/ia64/include/libarch/fibril_context.h366 uspace/lib/c/arch/ia64/include/libarch/istate_struct.h367 333 uspace/lib/c/arch/mips32/_link-dlexe.ld 368 334 uspace/lib/c/arch/mips32/_link-loader.ld 369 335 uspace/lib/c/arch/mips32/_link-shlib.ld 370 336 uspace/lib/c/arch/mips32/_link.ld 371 uspace/lib/c/arch/mips32/include/libarch/fibril_context.h372 uspace/lib/c/arch/mips32/include/libarch/istate_struct.h373 337 uspace/lib/c/arch/mips32eb/_link-dlexe.ld 374 338 uspace/lib/c/arch/mips32eb/_link-loader.ld 375 339 uspace/lib/c/arch/mips32eb/_link-shlib.ld 376 340 uspace/lib/c/arch/mips32eb/_link.ld 377 uspace/lib/c/arch/mips32eb/include/libarch/fibril_context.h378 uspace/lib/c/arch/mips32eb/include/libarch/istate_struct.h379 341 uspace/lib/c/arch/ppc32/_link-dlexe.ld 380 342 uspace/lib/c/arch/ppc32/_link-loader.ld 381 343 uspace/lib/c/arch/ppc32/_link-shlib.ld 382 344 uspace/lib/c/arch/ppc32/_link.ld 383 uspace/lib/c/arch/ppc32/include/libarch/fibril_context.h384 uspace/lib/c/arch/ppc32/include/libarch/istate_struct.h385 345 uspace/lib/c/arch/sparc64/_link-dlexe.ld 386 346 uspace/lib/c/arch/sparc64/_link-loader.ld 387 347 uspace/lib/c/arch/sparc64/_link-shlib.ld 388 348 uspace/lib/c/arch/sparc64/_link.ld 389 uspace/lib/c/arch/sparc64/include/libarch/fibril_context.h390 uspace/lib/c/arch/sparc64/include/libarch/istate_struct.h391 349 uspace/lib/c/arch/abs32le/_link-dlexe.ld 392 350 uspace/lib/c/arch/abs32le/_link-loader.ld -
kernel/Makefile
rd5e5fd1 r5af6cf3d 48 48 # 49 49 50 AUTOGEN = $(ROOT_PATH)/tools/autogen2.sh 50 51 AGDEPEND = Makefile.ag.depend 51 52 RAW = kernel.raw … … 73 74 74 75 .PHONY: all clean autogen_clean depend 76 .DELETE_ON_ERROR: 75 77 76 78 all: $(VERSION_DEF) $(COMMON_MAKEFILE) $(COMMON_HEADER) $(CONFIG_MAKEFILE) $(CONFIG_HEADER) $(BIN) $(DISASM) … … 354 356 GENARCH_DEPENDS := $(addsuffix .d,$(basename $(GENARCH_SOURCES))) 355 357 356 GENARCH_AUTOGENS_H := $(addsuffix .h,$(basename $(GENARCH_AUTOGENS_AG)))357 GENARCH_AUTOGENS_PROBE_C := $(addsuffix .ag.probe.c,$(basename $(GENARCH_AUTOGENS_AG)))358 GENARCH_AUTOGENS_PROBE_S := $(addsuffix .ag.probe.s,$(basename $(GENARCH_AUTOGENS_AG)))359 360 ARCH_AUTOGENS_H := $(addsuffix .h,$(basename $(ARCH_AUTOGENS_AG)))361 ARCH_AUTOGENS_PROBE_C := $(addsuffix .ag.probe.c,$(basename $(ARCH_AUTOGENS_AG)))362 ARCH_AUTOGENS_PROBE_S := $(addsuffix .ag.probe.s,$(basename $(ARCH_AUTOGENS_AG)))363 364 AUTOGENS_H := $(ARCH_AUTOGENS_H) $(GENARCH_AUTOGENS_H)365 358 AUTOGENS_AG := $(ARCH_AUTOGENS_AG) $(GENARCH_AUTOGENS_AG) 359 AUTOGEN_DEPENDS := $(addsuffix .d,$(AUTOGENS_AG)) 366 360 367 361 AS_CFLAGS := $(addprefix -Xassembler ,$(AFLAGS)) … … 371 365 -include $(ARCH_DEPENDS) 372 366 -include $(GENARCH_DEPENDS) 367 -include $(AUTOGEN_DEPENDS) 373 368 374 369 ifeq ($(COMPILER),clang) … … 402 397 $(CC) $(DEFS) $(CFLAGS) -D__ASM__ -D__LINKER__ -E -x c $< | grep -v "^\#" > $@ 403 398 404 %.h: %.ag 405 $(AUTOGEN) probe $< >$<.probe.c 406 $(CC_AUTOGEN) $(DEFS) $(CFLAGS) -S -o $<.probe.s $<.probe.c 407 $(AUTOGEN) generate $< <$<.probe.s >$@ 399 %.ag.h %.ag.s %.ag.c %.ag.d: %.h 400 CC="$(CC)" CFLAGS="$(CFLAGS)" $(AUTOGEN) $< $@ 408 401 409 402 %.o: %.S | depend … … 441 434 $(GENMAP) $(MAP_PREV) $(DUMP) $@ 442 435 443 $(AUTOGENS_H): $(AGDEPEND) 444 445 $(AGDEPEND): $(AUTOGENS_AG) 446 echo "# DO NOT EDIT" >$@ 447 for g in $^; do \ 448 h=`dirname $$g`/`basename $$g .ag`.h; \ 449 for l in `$(AUTOGEN) depend $$g`; do \ 450 echo "$$h: $$l" >>$@; \ 451 done \ 452 done 453 454 depend: $(AUTOGENS_H) 436 depend: $(AUTOGENS_AG) 455 437 456 438 autogen_clean: 457 -rm $(ARCH_AUTOGENS_H) $(ARCH_AUTOGENS_PROBE_C) $(ARCH_AUTOGENS_PROBE_S) 458 -rm $(GENARCH_AUTOGENS_H) $(GENARCH_AUTOGENS_PROBE_C) $(GENARCH_AUTOGENS_PROBE_S) 459 -rm $(AGDEPEND) 439 -rm $(AUTOGENS_AG) $(AUTOGEN_DEPENDS) $(AUTOGENS_AG) -
kernel/arch/amd64/Makefile.inc
rd5e5fd1 r5af6cf3d 86 86 87 87 ARCH_AUTOGENS_AG = \ 88 arch/$(KARCH)/include/arch/istate_struct.ag \89 arch/$(KARCH)/include/arch/context_struct.ag \90 arch/$(KARCH)/include/arch/kseg_struct.ag \91 arch/$(KARCH)/include/arch/boot/memmap_struct.ag 88 arch/$(KARCH)/include/arch/istate_struct.ag.h \ 89 arch/$(KARCH)/include/arch/context_struct.ag.h \ 90 arch/$(KARCH)/include/arch/kseg_struct.ag.h \ 91 arch/$(KARCH)/include/arch/boot/memmap_struct.ag.h -
kernel/arch/amd64/src/asm.S
rd5e5fd1 r5af6cf3d 30 30 #include <arch/pm.h> 31 31 #include <arch/mm/page.h> 32 #include <arch/istate_struct. h>33 #include <arch/kseg_struct. h>32 #include <arch/istate_struct.ag.h> 33 #include <arch/kseg_struct.ag.h> 34 34 #include <arch/cpu.h> 35 35 #include <arch/smp/apic.h> … … 541 541 ret 542 542 FUNCTION_END(early_putchar) 543 -
kernel/arch/amd64/src/boot/multiboot.S
rd5e5fd1 r5af6cf3d 720 720 status_main: 721 721 .asciz "[main] " 722 -
kernel/arch/amd64/src/context.S
rd5e5fd1 r5af6cf3d 28 28 29 29 #include <abi/asmtool.h> 30 #include <arch/context_struct. h>30 #include <arch/context_struct.ag.h> 31 31 #include <arch/vreg.h> 32 32 -
kernel/arch/amd64/src/smp/ap.S
rd5e5fd1 r5af6cf3d 39 39 #include <arch/cpu.h> 40 40 #include <arch/cpuid.h> 41 #include <arch/context_struct. h>41 #include <arch/context_struct.ag.h> 42 42 43 43 .section K_TEXT_START, "ax" -
kernel/arch/ia32/include/arch/boot/memmap.h
rd5e5fd1 r5af6cf3d 36 36 #define KERN_ia32_MEMMAP_H_ 37 37 38 #include <arch/boot/memmap_struct.h> 38 39 39 40 40 /* E820h memory range types */ … … 61 61 #define MEMMAP_E820_MAX_RECORDS 32 62 62 63 #ifndef __ASM__ 63 #ifdef __ASM__ 64 65 #include <arch/boot/memmap_struct.ag.h> 66 67 #else 64 68 65 69 #include <stdint.h> 70 #include <arch/boot/memmap_struct.h> 66 71 67 72 extern e820memmap_t e820table[MEMMAP_E820_MAX_RECORDS]; -
kernel/genarch/Makefile.inc
rd5e5fd1 r5af6cf3d 173 173 genarch/src/multiboot/multiboot2.c 174 174 GENARCH_AUTOGENS_AG += \ 175 genarch/include/genarch/multiboot/multiboot_memmap_struct.ag \176 genarch/include/genarch/multiboot/multiboot_info_struct.ag 175 genarch/include/genarch/multiboot/multiboot_memmap_struct.ag.h \ 176 genarch/include/genarch/multiboot/multiboot_info_struct.ag.h 177 177 endif 178 178 -
kernel/genarch/include/genarch/multiboot/multiboot.h
rd5e5fd1 r5af6cf3d 36 36 #define KERN_MULTIBOOT_H_ 37 37 38 #include <genarch/multiboot/multiboot_memmap_struct.h>39 #include <genarch/multiboot/multiboot_info_struct.h>40 38 41 39 #define MULTIBOOT_HEADER_MAGIC 0x1badb002 … … 52 50 #define MULTIBOOT_INFO_FLAGS_MMAP 0x40 53 51 54 #ifndef __ASM__ 52 #ifdef __ASM__ 53 54 #include <genarch/multiboot/multiboot_memmap_struct.ag.h> 55 #include <genarch/multiboot/multiboot_info_struct.ag.h> 56 57 #else 58 59 #include <genarch/multiboot/multiboot_memmap_struct.h> 60 #include <genarch/multiboot/multiboot_info_struct.h> 55 61 56 62 #include <typedefs.h> -
tools/autogen2.sh
rd5e5fd1 r5af6cf3d 1 1 #!/bin/sh 2 2 3 filename="$1" 4 struct_name="$2" 3 # There's a bunch of restriction. The script assumes that the structure definition begins with "typedef struct struct_name {", 4 # ends with "struct_name_t;", and that every word in between that ends with ";" is a struct member name with optional 5 # array subscript. Error handling is mostly omitted for simplicity, so any input that does not follow these rules will result 6 # in cryptic errors. 5 7 6 members=`cat $filename | sed -n -e "1,/typedef struct $struct_name {/d" -e "/} ${struct_name}_t;/,$$d" -e "s/.* \([^ ]\+\);/\1/p"` 8 echo $PWD 7 9 8 ustruct_name=`echo "$struct_name" | awk '{print toupper($0)}'` 9 dmembers=`echo "$members" | awk '{print "DEFINE_MEMBER(" $0 ", " toupper($0) ")" }'` 10 input="$1" 11 output="$2" 12 toolsdir="$(readlink -f $(dirname "$0"))" 13 awkscript="$toolsdir/autogen2.awk" 10 14 15 # Set default value for $CC. 11 16 if [ -z "${CC}" ]; then 12 17 CC=cc 13 18 fi 14 19 20 # If $CC is clang, we need to make sure integrated assembler is not used. 15 21 if ( ${CC} --version | grep clang > /dev/null ) ; then 16 22 CFLAGS="${CFLAGS} -no-integrated-as" 17 23 fi 18 24 19 echo "/* Autogenerated file, do not modify. */" 20 echo "#pragma once"25 # Tell the compiler to generate makefile dependencies. 26 CFLAGS="${CFLAGS} -MD -MP -MT $output -MF $output.d" 21 27 22 ( ${CC} ${CFLAGS} -w -S -x c - -o - | sed -n 's/^.* #define \([^ ]\+\) [^0-9]*\([0-9]\+\) .*/#define \1 \2/p' ) <<- EOF 28 # Generate defines 29 defs=`$awkscript -- $input || exit 1` 23 30 24 #include "$filename" 31 # Generate C file. 32 cat > $output.c <<- EOF 25 33 26 #define DEFINE_MEMBER(lc, uc) \ 27 asm volatile ("/* #define ${ustruct_name}_OFFSET_"#uc" %0 */" :: "i" (__builtin_offsetof(struct $struct_name, lc))); \ 28 asm volatile ("/* #define ${ustruct_name}_SIZE_"#uc" %0 */" :: "i" (sizeof((struct $struct_name){}.lc))); 34 #include "`basename $input`" 35 36 #define DEFINE_MEMBER(ls, us, lm, um) \ 37 asm volatile ("/* #define "#us"_OFFSET_"#um" %0 */" :: "i" (__builtin_offsetof(struct ls, lm))); \ 38 asm volatile ("/* #define "#us"_SIZE_"#um" %0 */" :: "i" (sizeof((struct ls){}.lm))); 39 40 #define DEFINE_STRUCT(ls, us) \\ 41 asm volatile ("/* #define "#us"_SIZE %0 */" :: "i" (sizeof(struct ls))); 29 42 30 43 void autogen() 31 44 { 32 $d members45 $defs 33 46 } 34 47 35 48 EOF 49 50 # Turn the C file into assembly. 51 ${CC} ${CFLAGS} -w -S -o $output.s $output.c || exit 1 52 53 # Process the output. 54 55 echo "/* Autogenerated file, do not modify. */" > $output 56 echo "#pragma once" >> $output 57 sed -n 's/^.* #define \([^ ]\+\) [^0-9]*\([0-9]\+\) .*/#define \1 \2/p' < $output.s > $output || exit 1 -
tools/autotool.py
rd5e5fd1 r5af6cf3d 681 681 sandbox_leave(owd) 682 682 683 common['AUTOGEN'] = "%s/autogen.py" % os.path.dirname(os.path.abspath(sys.argv[0]))684 685 683 create_makefile(MAKEFILE, common) 686 684 create_header(HEADER, macros)
Note:
See TracChangeset
for help on using the changeset viewer.