Changeset f27f3fd in mainline


Ignore:
Timestamp:
2014-08-27T23:27:15Z (10 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
dd8b6a8
Parents:
da904f7 (diff), 8d427a3 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge autogen support.

Files:
3 added
5 edited

Legend:

Unmodified
Added
Removed
  • kernel/Makefile

    rda904f7 rf27f3fd  
    6666SIZEOK_MAP = generic/src/debug/sizeok_map.o
    6767
    68 .PHONY: all clean
     68.PHONY: all clean autogen_clean
    6969
    7070all: $(VERSION_DEF) $(COMMON_MAKEFILE) $(COMMON_HEADER) $(CONFIG_MAKEFILE) $(CONFIG_HEADER) $(BIN) $(DISASM)
    7171        -[ -f $(DEPEND) ] && cp -a $(DEPEND) $(DEPEND_PREV)
    7272
    73 clean:
     73clean: autogen_clean
    7474        rm -f $(DEPEND) $(DEPEND_PREV) $(RAW) $(BIN) $(MAP) $(JOB) $(MAP_PREV) $(DISASM) $(DUMP) $(REAL_MAP).* arch/*/_link.ld arch/*/include/arch/common.h
    75         find generic/src/ arch/*/src/ genarch/src/ test/ -name '*.o' -follow -exec rm \{\} \;
     75        find generic/src/ arch/*/src/ genarch/src/ test/ -name '*.o' -follow -exec rm '{}' \;
    7676
    7777## Common compiler flags
     
    367367GENARCH_OBJECTS := $(addsuffix .o,$(basename $(GENARCH_SOURCES)))
    368368
     369ARCH_AUTOGENS_H := $(addsuffix .h,$(basename $(ARCH_AUTOGENS_AG)))
     370ARCH_AUTOGENS_PROBE_C := $(addsuffix .ag.probe.c,$(basename $(ARCH_AUTOGENS_AG)))
     371ARCH_AUTOGENS_PROBE_S := $(addsuffix .ag.probe.s,$(basename $(ARCH_AUTOGENS_AG)))
     372
    369373LFLAGS_LTO := $(addprefix -Xlinker ,$(LFLAGS))
    370374
     
    397401$(LINK): $(LINK).in $(DEPEND)
    398402        $(CC) $(DEFS) $(CFLAGS) -D__ASM__ -D__LINKER__ -E -x c $< | grep -v "^\#" > $@
     403
     404%.h: %.ag
     405        $(AUTOGEN) probe $< >$<.probe.c
     406        $(GCC) $(DEFS) $(GCC_CFLAGS) -S -o $<.probe.s $<.probe.c
     407        $(AUTOGEN) generate $< <$<.probe.s >$@   
    399408
    400409%.o: %.S $(DEPEND)
     
    441450        $(GENMAP) $(MAP_PREV) $(DUMP) $@
    442451
    443 $(DEPEND): $(COMMON_HEADER_ARCH)
     452$(DEPEND): $(COMMON_HEADER_ARCH) $(ARCH_AUTOGENS_H)
    444453        makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(ARCH_SOURCES) $(GENARCH_SOURCES) $(GENERIC_SOURCES) > $@ 2> /dev/null
    445454        -[ -f $(DEPEND_PREV) ] && diff -q $(DEPEND_PREV) $@ && mv -f $(DEPEND_PREV) $@
     
    447456$(COMMON_HEADER_ARCH): $(COMMON_HEADER)
    448457        ln -sfn ../../../../$< $@
     458
     459autogen_clean:
     460        -rm $(ARCH_AUTOGENS_H) $(ARCH_AUTOGENS_PROBE_C) $(ARCH_AUTOGENS_PROBE_S)
  • kernel/arch/ia32/Makefile.inc

    rda904f7 rf27f3fd  
    105105        arch/$(KARCH)/src/fpu_context.c \
    106106        arch/$(KARCH)/src/syscall.c
     107
     108ARCH_AUTOGENS_AG = \
     109        arch/$(KARCH)/include/arch/istate_struct.ag
     110
  • kernel/arch/ia32/include/arch/istate.h

    rda904f7 rf27f3fd  
    3838#include <trace.h>
    3939
    40 typedef struct istate {
    41         /*
    42          * The strange order of the GPRs is given by the requirement to use the
    43          * istate structure for both regular interrupts and exceptions as well
    44          * as for syscall handlers which use this order as an optimization.
    45          */
    46         uint32_t edx;
    47         uint32_t ecx;
    48         uint32_t ebx;
    49         uint32_t esi;
    50         uint32_t edi;
    51         uint32_t ebp;
    52         uint32_t eax;
    53        
    54         uint32_t ebp_frame;  /* imitation of frame pointer linkage */
    55         uint32_t eip_frame;  /* imitation of return address linkage */
    56        
    57         uint32_t gs;
    58         uint32_t fs;
    59         uint32_t es;
    60         uint32_t ds;
    61        
    62         uint32_t error_word;  /* real or fake error word */
    63         uint32_t eip;
    64         uint32_t cs;
    65         uint32_t eflags;
    66         uint32_t esp;         /* only if istate_t is from uspace */
    67         uint32_t ss;          /* only if istate_t is from uspace */
    68 } istate_t;
     40#ifdef KERNEL
     41#include <arch/istate_struct.h>
     42#else
     43#include <libarch/istate_struct.h>
     44#endif /* KERNEL */
    6945
    7046#define RPL_USER        3
  • kernel/arch/ia32/src/asm.S

    rda904f7 rf27f3fd  
    3434#include <arch/cpu.h>
    3535#include <arch/mm/page.h>
     36#include <arch/istate_struct.h>
    3637
    3738.text
     
    136137        ret
    137138
    138 #define ISTATE_OFFSET_EDX         0
    139 #define ISTATE_OFFSET_ECX         4
    140 #define ISTATE_OFFSET_EBX         8
    141 #define ISTATE_OFFSET_ESI         12
    142 #define ISTATE_OFFSET_EDI         16
    143 #define ISTATE_OFFSET_EBP         20
    144 #define ISTATE_OFFSET_EAX         24
    145 #define ISTATE_OFFSET_EBP_FRAME   28
    146 #define ISTATE_OFFSET_EIP_FRAME   32
    147 #define ISTATE_OFFSET_GS          36
    148 #define ISTATE_OFFSET_FS          40
    149 #define ISTATE_OFFSET_ES          44
    150 #define ISTATE_OFFSET_DS          48
    151 #define ISTATE_OFFSET_ERROR_WORD  52
    152 #define ISTATE_OFFSET_EIP         56
    153 #define ISTATE_OFFSET_CS          60
    154 #define ISTATE_OFFSET_EFLAGS      64
    155 #define ISTATE_OFFSET_ESP         68
    156 #define ISTATE_OFFSET_SS          72
    157 
    158139/*
    159140 * Size of the istate structure without the hardware-saved part
    160141 * and without the error word.
    161142 */
    162 #define ISTATE_SOFT_SIZE  52
     143#define ISTATE_SOFT_SIZE        ISTATE_SIZE - (6 * 4)
    163144
    164145/*
  • tools/autotool.py

    rda904f7 rf27f3fd  
    834834                sandbox_leave(owd)
    835835       
     836        common['AUTOGEN'] = "%s/autogen.py" % os.path.dirname(os.path.abspath(sys.argv[0]))
     837
    836838        create_makefile(MAKEFILE, common)
    837839        create_header(HEADER, maps)
Note: See TracChangeset for help on using the changeset viewer.