Changes in / [e2b73d4f:facebd56] in mainline


Ignore:
Files:
2 added
1 deleted
75 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    re2b73d4f rfacebd56  
    2727#
    2828
     29## Include configuration
     30#
     31
    2932CSCOPE = cscope
    3033CONFIG = tools/config.py
    31 AUTOTOOL = tools/autotool.py
    32 SANDBOX = autotool
    3334
    34 CONFIG_RULES = HelenOS.config
     35.PHONY: all config config_default distclean clean cscope precheck
    3536
    36 COMMON_MAKEFILE = Makefile.common
    37 COMMON_HEADER = common.h
    38 COMMON_HEADER_PREV = $(COMMON_HEADER).prev
    39 
    40 CONFIG_MAKEFILE = Makefile.config
    41 CONFIG_HEADER = config.h
    42 
    43 .PHONY: all precheck cscope autotool config_default config distclean clean
    44 
    45 all: $(COMMON_MAKEFILE) $(COMMON_HEADER) $(CONFIG_MAKEFILE) $(CONFIG_HEADER)
    46         cp -a $(COMMON_HEADER) $(COMMON_HEADER_PREV)
     37all: Makefile.config config.h config.defs
    4738        $(MAKE) -C kernel PRECHECK=$(PRECHECK)
    4839        $(MAKE) -C uspace PRECHECK=$(PRECHECK)
     
    5546        find kernel boot uspace -regex '^.*\.[chsS]$$' | xargs $(CSCOPE) -b -k -u -f$(CSCOPE).out
    5647
    57 $(COMMON_MAKEFILE): autotool
    58 $(COMMON_HEADER): autotool
     48Makefile.config: config_default
    5949
    60 autotool: $(CONFIG_MAKEFILE)
    61         $(AUTOTOOL)
    62         -[ -f $(COMMON_HEADER_PREV) ] && diff -q $(COMMON_HEADER_PREV) $(COMMON_HEADER) && mv -f $(COMMON_HEADER_PREV) $(COMMON_HEADER)
     50config.h: config_default
    6351
    64 $(CONFIG_MAKEFILE): config_default
    65 $(CONFIG_HEADER): config_default
     52config.defs: config_default
    6653
    67 config_default: $(CONFIG_RULES)
    68         $(CONFIG) $< default
     54config_default: HelenOS.config
     55        $(CONFIG) HelenOS.config default
    6956
    70 config: $(CONFIG_RULES)
    71         $(CONFIG) $<
     57config: HelenOS.config
     58        $(CONFIG) HelenOS.config
    7259
    7360distclean: clean
    74         rm -f $(CSCOPE).out $(COMMON_MAKEFILE) $(COMMON_HEADER) $(COMMON_HEADER_PREV) $(CONFIG_MAKEFILE) $(CONFIG_HEADER) tools/*.pyc tools/checkers/*.pyc
     61        rm -f $(CSCOPE).out Makefile.config config.h config.defs tools/*.pyc tools/checkers/*.pyc
    7562
    7663clean:
    77         rm -fr $(SANDBOX)
    7864        $(MAKE) -C kernel clean
    7965        $(MAKE) -C uspace clean
  • boot/Makefile

    re2b73d4f rfacebd56  
    3030#
    3131
    32 -include ../Makefile.common
    3332-include ../Makefile.config
     33-include ../config.defs
    3434
    3535## Paths
     
    4242.PHONY: all build clean generic_clean
    4343
    44 all: ../Makefile.common ../Makefile.config ../config.h build
     44all: ../Makefile.config ../config.h ../config.defs build
    4545
    4646-include arch/$(BARCH)/Makefile.inc
  • boot/Makefile.common

    re2b73d4f rfacebd56  
    2727#
    2828
    29 -include ../Makefile.common
    3029-include ../Makefile.config
    3130
  • boot/arch/arm32/loader/Makefile

    re2b73d4f rfacebd56  
    3232.PHONY: all clean
    3333
    34 all: ../../../../version ../../../../Makefile.common ../../../../Makefile.config ../../../../config.h
     34all: ../../../../version ../../../../Makefile.config ../../../../config.h ../../../../config.defs
    3535        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
    3636        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
  • boot/arch/arm32/loader/Makefile.build

    re2b73d4f rfacebd56  
    3232
    3333include ../../../../version
    34 include ../../../../Makefile.common
    3534include ../../../../Makefile.config
     35include ../../../../config.defs
    3636include Makefile.common
    3737include Makefile.toolchain
  • boot/arch/arm32/loader/Makefile.toolchain

    re2b73d4f rfacebd56  
    2727#
    2828
     29## Toolchain configuration
     30#
     31
     32ifndef CROSS_PREFIX
     33        CROSS_PREFIX = /usr/local
     34endif
     35
    2936BFD_NAME = elf32-littlearm
    3037BFD_ARCH = arm
     38TARGET = arm-linux-gnu
     39TOOLCHAIN_DIR = $(CROSS_PREFIX)/arm32/bin
    3140
    3241JOBFILE = ../../../../tools/jobfile.py
     42
     43ifeq ($(COMPILER),gcc_native)
     44        CC = gcc
     45        AS = as
     46        LD = ld
     47        OBJCOPY = objcopy
     48        OBJDUMP = objdump
     49endif
     50
     51ifeq ($(COMPILER),gcc_cross)
     52        CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc
     53        AS = $(TOOLCHAIN_DIR)/$(TARGET)-as
     54        LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld
     55        OBJCOPY = $(TOOLCHAIN_DIR)/$(TARGET)-objcopy
     56        OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump
     57endif
    3358
    3459CFLAGS = \
  • boot/arch/ia64/loader/Makefile

    re2b73d4f rfacebd56  
    2929
    3030include Makefile.common
    31 include ../../../../Makefile.common
    3231include ../../../../Makefile.config
    3332
    3433.PHONY: all clean
    3534
    36 all: ../../../../version ../../../../Makefile.common ../../../../Makefile.config ../../../../config.h
     35all: ../../../../version ../../../../Makefile.config ../../../../config.h ../../../../config.defs
    3736        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
    3837        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
  • boot/arch/ia64/loader/Makefile.build

    re2b73d4f rfacebd56  
    3232
    3333include ../../../../version
    34 include ../../../../Makefile.common
    3534include ../../../../Makefile.config
     35include ../../../../config.defs
    3636include Makefile.common
    3737include Makefile.toolchain
     
    6060$(OUTPUT): $(OBJECTS) $(COMPONENT_OBJECTS) $(LINK)
    6161        $(LD) -no-check-sections -N -T $(LINK) $(COMPONENT_OBJECTS) $(OBJECTS) -o $@
    62         $(MAKE) -C gefi/HelenOS
     62        $(MAKE) -C gefi/HelenOS PREFIX=$(GEFI_PREFIX)
    6363        cp gefi/HelenOS/hello.efi ../../../../
    6464        cp gefi/HelenOS/image.bin ../../../../
  • boot/arch/ia64/loader/Makefile.common

    re2b73d4f rfacebd56  
    3131#
    3232
    33 include ../../../../Makefile.common
    3433include ../../../../Makefile.config
    3534include ../../../Makefile.common
  • boot/arch/ia64/loader/Makefile.toolchain

    re2b73d4f rfacebd56  
    2727#
    2828
     29## Toolchain configuration
     30#
     31
     32ifndef CROSS_PREFIX
     33        CROSS_PREFIX = /usr/local
     34endif
     35
    2936BFD_NAME = elf64-ia64-little
    3037BFD_ARCH = ia64
     38TARGET = ia64-pc-linux-gnu
     39TOOLCHAIN_DIR = $(CROSS_PREFIX)/ia64/bin
    3140
    3241JOBFILE = ../../../../tools/jobfile.py
     42
     43ifeq ($(COMPILER),gcc_native)
     44        CC = gcc
     45        AS = as
     46        LD = ld
     47        OBJCOPY = objcopy
     48        OBJDUMP = objdump
     49        GEFI_PREFIX =
     50endif
     51
     52ifeq ($(COMPILER),icc)
     53        CC = icc
     54        AS = as
     55        LD = ld
     56        OBJCOPY = objcopy
     57        OBJDUMP = objdump
     58        GEFI_PREFIX =
     59endif
     60
     61ifeq ($(COMPILER),gcc_cross)
     62        CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc
     63        AS = $(TOOLCHAIN_DIR)/$(TARGET)-as
     64        LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld
     65        OBJCOPY = $(TOOLCHAIN_DIR)/$(TARGET)-objcopy
     66        OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump
     67        GEFI_PREFIX = $(TOOLCHAIN_DIR)/$(TARGET)-
     68endif
    3369
    3470CFLAGS = \
  • boot/arch/ia64/loader/gefi/HelenOS/Makefile

    re2b73d4f rfacebd56  
    2222#
    2323
     24prefix=$(PREFIX)
    2425include ../Make.defaults
    2526CDIR=$(TOPDIR)/..
     
    6869
    6970gefi:
    70         $(MAKE) -C ..
     71        $(MAKE) -C .. prefix=$(PREFIX)
  • boot/arch/ia64/loader/gefi/Make.defaults

    re2b73d4f rfacebd56  
    2626# lib and include under the root
    2727#
    28 
    29 include ../../../../../Makefile.common
    30 
    3128INSTALLROOT=/usr/local
    3229
     
    3431
    3532ARCH       = ia64
    36 INCDIR     = -I. -I$(CDIR)/inc -I$(CDIR)/inc/$(ARCH) -I$(CDIR)/inc/protocol
     33INCDIR     = -I. -I$(CDIR)/inc -I$(CDIR)/inc/$(ARCH) -I$(CDIR)/inc/protocol 
    3734CPPFLAGS   = -DCONFIG_$(ARCH)
    3835CFLAGS     = -O2 -fpic -Wall -fshort-wchar -fno-strict-aliasing -fno-merge-constants -frename-registers -mfixed-range=f32-f127
    3936LDFLAGS    = -nostdlib
    4037INSTALL    = install
     38
     39CC         = $(prefix)gcc
     40AS         = $(prefix)as
     41LD         = $(prefix)ld
     42AR         = $(prefix)ar
     43RANLIB     = $(prefix)ranlib
     44OBJCOPY    = $(prefix)objcopy
     45OBJDUMP    = $(prefix)objdump
  • boot/arch/mips32/loader/Makefile

    re2b73d4f rfacebd56  
    3232.PHONY: all clean
    3333
    34 all: ../../../../version ../../../../Makefile.common ../../../../Makefile.config ../../../../config.h
     34all: ../../../../version ../../../../Makefile.config ../../../../config.h ../../../../config.defs
    3535        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
    3636        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
  • boot/arch/mips32/loader/Makefile.build

    re2b73d4f rfacebd56  
    3232
    3333include ../../../../version
    34 include ../../../../Makefile.common
    3534include ../../../../Makefile.config
     35include ../../../../config.defs
    3636include Makefile.common
    3737include Makefile.toolchain
  • boot/arch/mips32/loader/Makefile.toolchain

    re2b73d4f rfacebd56  
    2727#
    2828
     29## Toolchain configuration
     30#
     31
     32ifndef CROSS_PREFIX
     33        CROSS_PREFIX = /usr/local
     34endif
     35
    2936BFD_ARCH = mips
     37TARGET = mipsel-linux-gnu
     38TOOLCHAIN_DIR = $(CROSS_PREFIX)/mips32/bin
    3039
    3140JOBFILE = ../../../../tools/jobfile.py
     
    3948        BFD_NAME = elf32-tradbigmips
    4049        BFD = ecoff-bigmips
     50        TOOLCHAIN_DIR = $(CROSS_PREFIX)/mips32eb/bin
     51        TARGET = mips-linux-gnu
    4152endif
    4253
     
    4455        BFD_NAME = elf32-tradlittlemips
    4556        BFD = binary
     57endif
     58
     59ifeq ($(COMPILER),gcc_native)
     60        CC = gcc
     61        AS = as
     62        LD = ld
     63        OBJCOPY = objcopy
     64        OBJDUMP = objdump
     65endif
     66
     67ifeq ($(COMPILER),gcc_cross)
     68        CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc
     69        AS = $(TOOLCHAIN_DIR)/$(TARGET)-as
     70        LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld
     71        OBJCOPY = $(TOOLCHAIN_DIR)/$(TARGET)-objcopy
     72        OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump
    4673endif
    4774
  • boot/arch/ppc32/loader/Makefile

    re2b73d4f rfacebd56  
    3232.PHONY: all clean
    3333
    34 all: ../../../../version ../../../../Makefile.common ../../../../Makefile.config ../../../../config.h
     34all: ../../../../version ../../../../Makefile.config ../../../../config.h ../../../../config.defs
    3535        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
    3636        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
  • boot/arch/ppc32/loader/Makefile.build

    re2b73d4f rfacebd56  
    3232
    3333include ../../../../version
    34 include ../../../../Makefile.common
    3534include ../../../../Makefile.config
     35include ../../../../config.defs
    3636include Makefile.common
    3737include Makefile.toolchain
  • boot/arch/ppc32/loader/Makefile.toolchain

    re2b73d4f rfacebd56  
    2727#
    2828
     29## Toolchain configuration
     30#
     31
     32ifndef CROSS_PREFIX
     33        CROSS_PREFIX = /usr/local
     34endif
     35
    2936BFD_NAME = elf32-powerpc
    3037BFD_ARCH = powerpc:common
     38TARGET = ppc-linux-gnu
     39TOOLCHAIN_DIR = $(CROSS_PREFIX)/ppc32/bin
    3140
    3241JOBFILE = ../../../../tools/jobfile.py
     42
     43ifeq ($(COMPILER),gcc_native)
     44        CC = gcc
     45        AS = as
     46        LD = ld
     47        OBJCOPY = objcopy
     48        OBJDUMP = objdump
     49endif
     50
     51ifeq ($(COMPILER),gcc_cross)
     52        CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc
     53        AS = $(TOOLCHAIN_DIR)/$(TARGET)-as
     54        LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld
     55        OBJCOPY = $(TOOLCHAIN_DIR)/$(TARGET)-objcopy
     56        OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump
     57endif
    3358
    3459CFLAGS = \
  • boot/arch/sparc64/loader/Makefile

    re2b73d4f rfacebd56  
    3232.PHONY: all clean
    3333
    34 all: ../../../../version ../../../../Makefile.common ../../../../Makefile.config ../../../../config.h
     34all: ../../../../version ../../../../Makefile.config ../../../../config.h ../../../../config.defs
    3535        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
    3636        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
  • boot/arch/sparc64/loader/Makefile.build

    re2b73d4f rfacebd56  
    3232
    3333include ../../../../version
    34 include ../../../../Makefile.common
    3534include ../../../../Makefile.config
     35include ../../../../config.defs
    3636include Makefile.common
    3737include Makefile.toolchain
  • boot/arch/sparc64/loader/Makefile.toolchain

    re2b73d4f rfacebd56  
    2727#
    2828
     29## Toolchain configuration
     30#
     31
     32ifndef CROSS_PREFIX
     33        CROSS_PREFIX = /usr/local
     34endif
     35
    2936BFD_NAME = elf64-sparc
    3037BFD_ARCH = sparc
     38TARGET = sparc64-linux-gnu
     39TOOLCHAIN_DIR = $(CROSS_PREFIX)/sparc64/bin
    3140
    3241JOBFILE = ../../../../tools/jobfile.py
     42
     43ifeq ($(COMPILER),gcc_native)
     44        CC = gcc
     45        AS = as
     46        LD = ld
     47        OBJCOPY = objcopy
     48        OBJDUMP = objdump
     49endif
     50
     51ifeq ($(COMPILER),gcc_cross)
     52        CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc
     53        AS = $(TOOLCHAIN_DIR)/$(TARGET)-as
     54        LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld
     55        OBJCOPY = $(TOOLCHAIN_DIR)/$(TARGET)-objcopy
     56        OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump
     57endif
    3358
    3459CFLAGS = \
  • kernel/Makefile

    re2b73d4f rfacebd56  
    2727#
    2828
    29 ## Configuration
    30 #
    31 
    32 ROOT_PATH = ..
    33 
    34 VERSION_DEF = $(ROOT_PATH)/version
    35 
    36 COMMON_MAKEFILE = $(ROOT_PATH)/Makefile.common
    37 COMMON_HEADER = $(ROOT_PATH)/common.h
    38 COMMON_HEADER_ARCH = arch/$(KARCH)/include/common.h
    39 
    40 CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config
    41 CONFIG_HEADER = $(ROOT_PATH)/config.h
    42 
    43 -include $(VERSION_DEF)
    44 -include $(COMMON_MAKEFILE)
    45 -include $(CONFIG_MAKEFILE)
    46 
    47 ## Common names
    48 #
    49 
    50 DEPEND = Makefile.depend
    51 DEPEND_PREV = $(DEPEND).prev
    52 RAW = kernel.raw
    53 BIN = kernel.bin
    54 MAP = kernel.map
    55 JOB = kernel.job
    56 MAP_PREV = $(MAP).prev
    57 DISASM = kernel.disasm
    58 DUMP = kernel.dump
    59 REAL_MAP = generic/src/debug/real_map
    60 
    61 ARCH_INCLUDE = generic/include/arch
    62 GENARCH_INCLUDE = generic/include/genarch
    63 
    64 GENMAP = tools/genmap.py
    65 JOBFILE = $(ROOT_PATH)/tools/jobfile.py
    66 
    67 LINK = arch/$(KARCH)/_link.ld
    68 EMPTY_MAP = generic/src/debug/empty_map.o
    69 SIZEOK_MAP = generic/src/debug/sizeok_map.o
    70 
    71 INCLUDES = generic/include
    72 OPTIMIZATION = 3
     29include Makefile.common
    7330
    7431.PHONY: all clean
    7532
    76 all: $(VERSION_DEF) $(COMMON_MAKEFILE) $(COMMON_HEADER) $(CONFIG_MAKEFILE) $(CONFIG_HEADER) $(BIN) $(DISASM)
    77         -[ -f $(DEPEND) ] && cp -a $(DEPEND) $(DEPEND_PREV)
     33all: ../version ../Makefile.config ../config.h ../config.defs
     34        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
     35        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
    7836
    7937clean:
    80         rm -f $(DEPEND) $(DEPEND_PREV) $(RAW) $(BIN) $(MAP) $(JOB) $(MAP_PREV) $(DISASM) $(DUMP) $(REAL_MAP).* $(ARCH_INCLUDE) $(GENARCH_INCLUDE) arch/*/_link.ld arch/*/include/common.h
     38        rm -f $(DEPEND) $(DEPEND_PREV) $(RAW) $(BIN) $(MAP) $(JOB) $(MAP_PREV) $(DISASM) $(DUMP) $(REAL_MAP).* $(ARCH_INCLUDE) $(GENARCH_INCLUDE) arch/*/_link.ld
    8139        find generic/src/ arch/*/src/ genarch/src/ test/ -name '*.o' -follow -exec rm \{\} \;
    82 
    83 ## Common compiler flags
    84 #
    85 
    86 DEFS = -DKERNEL -DRELEASE=$(RELEASE) "-DNAME=$(NAME)" -D__$(BITS)_BITS__ -D__$(ENDIANESS)__
    87 
    88 GCC_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) -imacros ../config.h \
    89         -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) \
    90         -finput-charset=UTF-8 -ffreestanding -fno-builtin -nostdlib -nostdinc \
    91         -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes \
    92         -Werror-implicit-function-declaration -Wwrite-strings \
    93         -Werror -pipe
    94 
    95 ICC_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) -imacros ../config.h \
    96         -ffreestanding -fno-builtin -nostdlib -nostdinc -Wall -Wmissing-prototypes \
    97         -Werror-implicit-function-declaration -Werror -wd170
    98 
    99 SUNCC_CFLAGS = -I$(INCLUDES) -xO$(OPTIMIZATION) \
    100         -xnolib -xc99=all -features=extensions \
    101         -erroff=E_ZERO_SIZED_STRUCT_UNION
    102 
    103 CLANG_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) -imacros ../config.h \
    104         -fexec-charset=UTF-8 -fwide-exec-charset=UTF-32$(ENDIANESS) \
    105         -finput-charset=UTF-8 -ffreestanding -fno-builtin -nostdlib -nostdinc \
    106         -Wall -Wextra -Wno-unused-parameter -Wmissing-prototypes \
    107         -Werror-implicit-function-declaration -Wwrite-strings \
    108         -pipe -arch $(CLANG_ARCH)
    109 
    110 LFLAGS = -M
    111 AFLAGS =
    112 
    113 -include arch/$(KARCH)/Makefile.inc
    114 -include genarch/Makefile.inc
    115 -include $(DEPEND)
    116 
    117 ## The at-sign
    118 #
    119 # The $(ATSIGN) variable holds the ASCII character representing the at-sign
    120 # ('@') used in various $(AS) constructs (e.g. @progbits). On architectures that
    121 # don't use '@' for starting a comment, $(ATSIGN) is merely '@'. However, on
    122 # those that do use it for starting a comment (e.g. arm32), $(ATSIGN) must be
    123 # defined as the percentile-sign ('%') in the architecture-dependent
    124 # Makefile.inc.
    125 #
    126 
    127 ATSIGN ?= @
    128 
    129 ## Cross-platform assembly to start a symtab.data section
    130 #
    131 
    132 SYMTAB_SECTION = ".section symtab.data, \"a\", $(ATSIGN)progbits;"
    133 
    134 ## Compilation options
    135 #
    136 
    137 ifeq ($(COMPILER),gcc_native)
    138         CFLAGS = $(GCC_CFLAGS)
    139         DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    140 endif
    141 
    142 ifeq ($(COMPILER),gcc_cross)
    143         CFLAGS = $(GCC_CFLAGS)
    144         DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    145 endif
    146 
    147 ifeq ($(COMPILER),icc)
    148         CFLAGS = $(ICC_CFLAGS)
    149         DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    150 endif
    151 
    152 ifeq ($(COMPILER),suncc)
    153         CFLAGS = $(SUNCC_CFLAGS)
    154         DEFS += $(CONFIG_DEFS)
    155         DEPEND_DEFS = $(DEFS)
    156 endif
    157 
    158 ifeq ($(COMPILER),clang)
    159         CFLAGS = $(CLANG_CFLAGS)
    160         DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
    161 endif
    162 
    163 ## Generic kernel sources
    164 #
    165 
    166 GENERIC_SOURCES = \
    167         generic/src/adt/avl.c \
    168         generic/src/adt/bitmap.c \
    169         generic/src/adt/btree.c \
    170         generic/src/adt/hash_table.c \
    171         generic/src/adt/list.c \
    172         generic/src/console/chardev.c \
    173         generic/src/console/console.c \
    174         generic/src/cpu/cpu.c \
    175         generic/src/ddi/ddi.c \
    176         generic/src/ddi/irq.c \
    177         generic/src/ddi/device.c \
    178         generic/src/debug/symtab.c \
    179         generic/src/debug/stacktrace.c \
    180         generic/src/interrupt/interrupt.c \
    181         generic/src/main/main.c \
    182         generic/src/main/kinit.c \
    183         generic/src/main/uinit.c \
    184         generic/src/main/version.c \
    185         generic/src/main/shutdown.c \
    186         generic/src/proc/program.c \
    187         generic/src/proc/scheduler.c \
    188         generic/src/proc/thread.c \
    189         generic/src/proc/task.c \
    190         generic/src/proc/the.c \
    191         generic/src/proc/tasklet.c \
    192         generic/src/syscall/syscall.c \
    193         generic/src/syscall/copy.c \
    194         generic/src/mm/buddy.c \
    195         generic/src/mm/frame.c \
    196         generic/src/mm/page.c \
    197         generic/src/mm/tlb.c \
    198         generic/src/mm/as.c \
    199         generic/src/mm/backend_anon.c \
    200         generic/src/mm/backend_elf.c \
    201         generic/src/mm/backend_phys.c \
    202         generic/src/mm/slab.c \
    203         generic/src/lib/func.c \
    204         generic/src/lib/memstr.c \
    205         generic/src/lib/sort.c \
    206         generic/src/lib/string.c \
    207         generic/src/lib/elf.c \
    208         generic/src/lib/rd.c \
    209         generic/src/printf/printf_core.c \
    210         generic/src/printf/printf.c \
    211         generic/src/printf/snprintf.c \
    212         generic/src/printf/vprintf.c \
    213         generic/src/printf/vsnprintf.c \
    214         generic/src/time/clock.c \
    215         generic/src/time/timeout.c \
    216         generic/src/time/delay.c \
    217         generic/src/preempt/preemption.c \
    218         generic/src/synch/spinlock.c \
    219         generic/src/synch/condvar.c \
    220         generic/src/synch/rwlock.c \
    221         generic/src/synch/mutex.c \
    222         generic/src/synch/semaphore.c \
    223         generic/src/synch/smc.c \
    224         generic/src/synch/waitq.c \
    225         generic/src/synch/futex.c \
    226         generic/src/smp/ipi.c \
    227         generic/src/smp/smp.c \
    228         generic/src/ipc/ipc.c \
    229         generic/src/ipc/sysipc.c \
    230         generic/src/ipc/ipcrsc.c \
    231         generic/src/ipc/irq.c \
    232         generic/src/ipc/event.c \
    233         generic/src/security/cap.c \
    234         generic/src/sysinfo/sysinfo.c
    235 
    236 ## Kernel console support
    237 #
    238 
    239 ifeq ($(CONFIG_KCONSOLE),y)
    240 GENERIC_SOURCES += \
    241         generic/src/console/kconsole.c \
    242         generic/src/console/cmd.c
    243 endif
    244 
    245 ## Udebug interface sources
    246 #
    247 
    248 ifeq ($(CONFIG_UDEBUG),y)
    249 GENERIC_SOURCES += \
    250         generic/src/ipc/kbox.c \
    251         generic/src/udebug/udebug.c \
    252         generic/src/udebug/udebug_ops.c \
    253         generic/src/udebug/udebug_ipc.c
    254 endif
    255 
    256 ## Test sources
    257 #
    258 
    259 ifeq ($(CONFIG_TEST),y)
    260         CFLAGS += -Itest/
    261         GENERIC_SOURCES += \
    262                 test/test.c \
    263                 test/atomic/atomic1.c \
    264                 test/btree/btree1.c \
    265                 test/avltree/avltree1.c \
    266                 test/fault/fault1.c \
    267                 test/mm/falloc1.c \
    268                 test/mm/falloc2.c \
    269                 test/mm/mapping1.c \
    270                 test/mm/slab1.c \
    271                 test/mm/slab2.c \
    272                 test/synch/rwlock1.c \
    273                 test/synch/rwlock2.c \
    274                 test/synch/rwlock3.c \
    275                 test/synch/rwlock4.c \
    276                 test/synch/rwlock5.c \
    277                 test/synch/semaphore1.c \
    278                 test/synch/semaphore2.c \
    279                 test/print/print1.c \
    280                 test/print/print2.c \
    281                 test/print/print3.c \
    282                 test/print/print4.c \
    283                 test/thread/thread1.c \
    284                 test/sysinfo/sysinfo1.c
    285        
    286         ifeq ($(KARCH),mips32)
    287                 GENERIC_SOURCES += test/debug/mips1.c
    288         else
    289                 GENERIC_SOURCES += test/debug/mips1_skip.c
    290         endif
    291        
    292         ifeq ($(KARCH),ia64)
    293                 GENERIC_SOURCES += test/mm/purge1.c
    294         else
    295                 GENERIC_SOURCES += test/mm/purge1_skip.c
    296         endif
    297        
    298         ifeq ($(CONFIG_FPU),y)
    299                 ifeq ($(KARCH),ia32)
    300                         TEST_FPU1 = y
    301                         TEST_SSE1 = y
    302                         GENERIC_SOURCES += test/fpu/fpu1_x86.c
    303                 endif
    304                
    305                 ifeq ($(KARCH),amd64)
    306                         TEST_FPU1 = y
    307                         TEST_SSE1 = y
    308                         GENERIC_SOURCES += test/fpu/fpu1_x86.c
    309                 endif
    310                
    311                 ifeq ($(KARCH),ia64)
    312                         TEST_FPU1 = y
    313                         GENERIC_SOURCES += test/fpu/fpu1_ia64.c
    314                 endif
    315                
    316                 ifeq ($(KARCH),mips32)
    317                         TEST_MIPS2 = y
    318                 endif
    319         endif
    320        
    321         ifneq ($(TEST_FPU1),y)
    322                 GENERIC_SOURCES += test/fpu/fpu1_skip.c
    323         endif
    324        
    325         ifeq ($(TEST_SSE1),y)
    326                 GENERIC_SOURCES += test/fpu/sse1.c
    327         else
    328                 GENERIC_SOURCES += test/fpu/sse1_skip.c
    329         endif
    330        
    331         ifeq ($(TEST_MIPS2),y)
    332                 GENERIC_SOURCES += test/fpu/mips2.c
    333         else
    334                 GENERIC_SOURCES += test/fpu/mips2_skip.c
    335         endif
    336        
    337 endif
    338 
    339 GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES)))
    340 ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES)))
    341 GENARCH_OBJECTS := $(addsuffix .o,$(basename $(GENARCH_SOURCES)))
    342 
    343 ifeq ($(CONFIG_SYMTAB),y)
    344         SYMTAB_OBJECTS := generic/src/debug/real_map.o
    345 else
    346         SYMTAB_OBJECTS :=
    347 endif
    348 
    349 
    350 
    351 $(BIN): $(RAW)
    352         $(OBJCOPY) -O $(BFD) $< $@
    353 
    354 $(DISASM): $(RAW)
    355         $(OBJDUMP) -d $< > $@
    356 
    357 $(RAW): $(LINK) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(SYMTAB_OBJECTS)
    358         $(LD) -T $(LINK) $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(SYMTAB_OBJECTS) -o $@ -Map $(MAP)
    359 
    360 $(LINK): $(LINK).in $(DEPEND)
    361         $(GCC) $(DEFS) $(GCC_CFLAGS) -D__ASM__ -D__LINKER__ -E -x c $< | grep -v "^\#" > $@
    362 
    363 %.o: %.S $(DEPEND)
    364         $(GCC) $(DEFS) $(GCC_CFLAGS) -D__ASM__ -c $< -o $@
    365 ifeq ($(PRECHECK),y)
    366         $(JOBFILE) $(JOB) $< $@ as asm/preproc $(DEFS) $(GCC_CFLAGS) -D__ASM__
    367 endif
    368 
    369 %.o: %.s $(DEPEND)
    370         $(AS) $(AFLAGS) $< -o $@
    371 ifeq ($(PRECHECK),y)
    372         $(JOBFILE) $(JOB) $< $@ as asm $(DEFS) $(CFLAGS) $(EXTRA_FLAGS)
    373 endif
    374 
    375 #
    376 # The FPU tests are the only objects for which we allow the compiler to generate
    377 # FPU instructions.
    378 #
    379 
    380 test/fpu/%.o: test/fpu/%.c $(DEPEND)
    381         $(CC) $(DEFS) $(CFLAGS) $(EXTRA_FLAGS) -c $< -o $@
    382 ifeq ($(PRECHECK),y)
    383         $(JOBFILE) $(JOB) $< $@ cc test $(DEFS) $(CFLAGS) $(EXTRA_FLAGS)
    384 endif
    385 
    386 #
    387 # Ordinary objects.
    388 #
    389 
    390 %.o: %.c $(DEPEND)
    391         $(CC) $(DEFS) $(CFLAGS) $(EXTRA_FLAGS) $(FPU_NO_CFLAGS) -c $< -o $@
    392 ifeq ($(PRECHECK),y)
    393         $(JOBFILE) $(JOB) $< $@ cc core $(DEFS) $(CFLAGS) $(EXTRA_FLAGS) $(FPU_NO_CFLAGS)
    394 endif
    395 
    396 $(REAL_MAP).o: $(REAL_MAP).bin
    397         echo $(SYMTAB_SECTION)" .incbin \"$<\"" | $(AS) $(AFLAGS) -o $@
    398 
    399 $(REAL_MAP).bin: $(LINK) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS)
    400         echo $(SYMTAB_SECTION) | $(AS) $(AFLAGS) -o $(EMPTY_MAP)
    401         $(LD) -T $(LINK) $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(EMPTY_MAP) -o $@ -Map $(MAP_PREV)
    402         $(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > $(DUMP)
    403         $(GENMAP) $(MAP_PREV) $(DUMP) $@
    404        
    405         # Do it once again, this time to get correct even the symbols
    406         # on architectures that have bss after symtab
    407        
    408         echo $(SYMTAB_SECTION)" .incbin \"$@\"" | $(AS) $(AFLAGS) -o $(SIZEOK_MAP)
    409         $(LD) -T $(LINK) $(LFLAGS) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(SIZEOK_MAP) -o $@ -Map $(MAP_PREV)
    410         $(OBJDUMP) -t $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) > $(DUMP)
    411         $(GENMAP) $(MAP_PREV) $(DUMP) $@
    412 
    413 $(DEPEND): $(ARCH_INCLUDE) $(GENARCH_INCLUDE) $(COMMON_HEADER_ARCH)
    414         makedepend -f - -- $(DEPEND_DEFS) $(CFLAGS) -- $(ARCH_SOURCES) $(GENARCH_SOURCES) $(GENERIC_SOURCES) > $@ 2> /dev/null
    415         -[ -f $(DEPEND_PREV) ] && diff -q $(DEPEND_PREV) $@ && mv -f $(DEPEND_PREV) $@
    416 
    417 $(ARCH_INCLUDE): arch/$(KARCH)/include/
    418         ln -sfn ../../$< $@
    419 
    420 $(GENARCH_INCLUDE): genarch/include/
    421         ln -sfn ../../$< $@
    422 
    423 $(COMMON_HEADER_ARCH): $(COMMON_HEADER)
    424         ln -sfn ../../../$< $@
  • kernel/arch/abs32le/Makefile.inc

    re2b73d4f rfacebd56  
    2727#
    2828
     29## Toolchain configuration
     30#
     31
    2932BFD = binary
    3033
    3134ifeq ($(COMPILER),gcc_cross)
     35        TOOLCHAIN_DIR = $(CROSS_PREFIX)/$(CROSS_TARGET)
     36       
    3237        ifeq ($(CROSS_TARGET),arm32)
     38                TARGET = arm-linux-gnu
    3339                ATSIGN = %
    3440        endif
    3541       
     42        ifeq ($(CROSS_TARGET),ia32)
     43                TARGET = i686-pc-linux-gnu
     44        endif
     45       
    3646        ifeq ($(CROSS_TARGET),mips32)
     47                TARGET = mipsel-linux-gnu
    3748                GCC_CFLAGS += -mno-abicalls
    3849        endif
  • kernel/arch/amd64/Makefile.inc

    re2b73d4f rfacebd56  
    2727#
    2828
     29## Toolchain configuration
     30#
     31
    2932BFD_NAME = elf64-x86-64
    3033BFD_ARCH = i386:x86-64
    3134BFD = binary
     35TARGET = amd64-linux-gnu
    3236CLANG_ARCH = x86_64
     37TOOLCHAIN_DIR = $(CROSS_PREFIX)/amd64
    3338
    3439FPU_NO_CFLAGS = -mno-sse -mno-sse2
  • kernel/arch/arm32/Makefile.inc

    re2b73d4f rfacebd56  
    2727#
    2828
     29## Toolchain configuration
     30#
     31
    2932BFD_NAME = elf32-littlearm
    3033BFD_ARCH = arm
    3134BFD = binary
     35TARGET = arm-linux-gnu
     36TOOLCHAIN_DIR = $(CROSS_PREFIX)/arm32
    3237
    3338ATSIGN = %
  • kernel/arch/arm32/src/dummy.S

    re2b73d4f rfacebd56  
    11#
    2 # Copyright (c) 2007 Michal Kebrt, Pavel Jancik, Petr Stepan
     2# Copyright (c) 2007 Michal Kebry, Pavel Jancik, Petr Stepan
    33# All rights reserved.
    44#
  • kernel/arch/ia32/Makefile.inc

    re2b73d4f rfacebd56  
    2727#
    2828
     29## Toolchain configuration
     30#
     31
    2932BFD_NAME = elf32-i386
    3033BFD_ARCH = i386
    3134BFD = binary
     35TARGET = i686-pc-linux-gnu
    3236CLANG_ARCH = i386
     37TOOLCHAIN_DIR = $(CROSS_PREFIX)/ia32
    3338
    3439BITS = 32
     
    4853        SUNCC_CFLAGS += -xarch=ssea
    4954endif
    50 
    5155ifeq ($(PROCESSOR),athlon_mp)
    5256        CMN2 = -march=athlon-mp
    5357        SUNCC_CFLAGS += xarch=ssea
    5458endif
    55 
    5659ifeq ($(PROCESSOR),pentium3)
    5760        CMN2 = -march=pentium3
    5861        SUNCC_CFLAGS += -xarch=sse
    5962endif
    60 
    6163ifeq ($(PROCESSOR),pentium4)
    6264        CMN2 = -march=pentium4
    6365        SUNCC_CFLAGS += -xarch=sse2
    6466endif
    65 
    6667ifeq ($(PROCESSOR),core)
    6768        CMN2 = -march=prescott
  • kernel/arch/ia32/include/types.h

    re2b73d4f rfacebd56  
    2727 */
    2828
    29 /** @addtogroup ia32
     29/** @addtogroup ia32   
    3030 * @{
    3131 */
     
    3636#define KERN_ia32_TYPES_H_
    3737
    38 #include <arch/common.h>
     38typedef signed char int8_t;
     39typedef signed short int16_t;
     40typedef signed long int32_t;
     41typedef signed long long int64_t;
     42
     43typedef unsigned char uint8_t;
     44typedef unsigned short uint16_t;
     45typedef unsigned long uint32_t;
     46typedef unsigned long long uint64_t;
    3947
    4048typedef uint32_t size_t;
  • kernel/arch/ia64/Makefile.inc

    re2b73d4f rfacebd56  
    2727#
    2828
     29## Toolchain configuration
     30#
     31
    2932BFD_NAME = elf64-little
    3033BFD_ARCH = ia64-elf64
     34TARGET = ia64-pc-linux-gnu
     35TOOLCHAIN_DIR = $(CROSS_PREFIX)/ia64
    3136
    3237CMN1 = -mconstant-gp -fno-unwind-tables -mfixed-range=f32-f127
  • kernel/arch/mips32/Makefile.inc

    re2b73d4f rfacebd56  
    2727#
    2828
     29## Toolchain configuration
     30#
     31
    2932BFD_ARCH = mips
    3033BFD = binary
     34TARGET = mipsel-linux-gnu
     35TOOLCHAIN_DIR = $(CROSS_PREFIX)/mips32
     36
    3137GCC_CFLAGS += -mno-abicalls -G 0 -fno-zero-initialized-in-bss -mips3
    3238
     
    4248ifeq ($(MACHINE),bgxemul)
    4349        BFD_NAME = elf32-tradbigmips
     50        TOOLCHAIN_DIR = $(CROSS_PREFIX)/mips32eb
     51        TARGET = mips-linux-gnu
    4452        ENDIANESS = BE
    4553        GCC_CFLAGS += -D__BE__
  • kernel/arch/ppc32/Makefile.inc

    re2b73d4f rfacebd56  
    2727#
    2828
     29## Toolchain configuration
     30#
     31
    2932BFD_NAME = elf32-powerpc
    3033BFD_ARCH = powerpc:common
    3134BFD = binary
     35TARGET = ppc-linux-gnu
     36TOOLCHAIN_DIR = $(CROSS_PREFIX)/ppc32
    3237
    3338GCC_CFLAGS += -mcpu=powerpc -msoft-float -m32
  • kernel/arch/sparc64/Makefile.inc

    re2b73d4f rfacebd56  
    2727#
    2828
     29## Toolchain configuration
     30#
     31
    2932BFD_NAME = elf64-sparc
    3033BFD_ARCH = sparc
    3134BFD = binary
     35TARGET = sparc64-linux-gnu
     36TOOLCHAIN_DIR = $(CROSS_PREFIX)/sparc64
    3237
    3338GCC_CFLAGS += -m64 -mcpu=ultrasparc
  • kernel/tools/genmap.py

    re2b73d4f rfacebd56  
    11#!/usr/bin/env python
    2 #
    3 # Copyright (c) 2006 Ondrej Palkovsky
    4 # All rights reserved.
    5 #
    6 # Redistribution and use in source and binary forms, with or without
    7 # modification, are permitted provided that the following conditions
    8 # are met:
    9 #
    10 # - Redistributions of source code must retain the above copyright
    11 #   notice, this list of conditions and the following disclaimer.
    12 # - Redistributions in binary form must reproduce the above copyright
    13 #   notice, this list of conditions and the following disclaimer in the
    14 #   documentation and/or other materials provided with the distribution.
    15 # - The name of the author may not be used to endorse or promote products
    16 #   derived from this software without specific prior written permission.
    17 #
    18 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
    19 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    20 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    21 # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
    22 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
    23 # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
    27 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    28 #
    29 
    30 """
    31 Create binary symbol map out of linker map file
    32 """
    332
    343import sys
     
    365import re
    376
    38 MAXSTRING = 63
    39 symtabfmt = "<Q%ds" % (MAXSTRING + 1)
     7MAXSTRING=63
     8symtabfmt = "<Q%ds" % (MAXSTRING+1)
     9
    4010
    4111funcline = re.compile(r'([0-9a-f]+)\s+[lg]\s+.\s+\.text\s+([0-9a-f]+)\s+(.*)$')
     
    4313dataline = re.compile(r'([0-9a-f]+)\s+[lg]\s+[a-zA-Z]\s+\.data\s+([0-9a-f]+)\s+(.*)$')
    4414fileexp = re.compile(r'([^\s]+):\s+file format')
     15def read_obdump(inp):
     16    funcs = {}
     17    data = {}
     18    bss ={}
     19    fname = ''
     20    for line in inp:
     21        line = line.strip()
     22        res = funcline.match(line)
     23        if res:
     24            funcs.setdefault(fname,[]).append((int(res.group(1),16),
     25                                               res.group(3)))
     26            continue
     27        res = bssline.match(line)
     28        if res:
     29            start = int(res.group(1),16)
     30            end = int(res.group(2),16)
     31            if end:
     32                bss.setdefault(fname,[]).append((start,res.group(3)))
     33        res = dataline.match(line)
     34        if res:
     35            start = int(res.group(1),16)
     36            end = int(res.group(2),16)
     37            if end:
     38                data.setdefault(fname,[]).append((start,res.group(3)))
     39        res = fileexp.match(line)
     40        if res:
     41            fname = res.group(1)
     42            continue
     43
     44    return {
     45        'text' : funcs,
     46        'bss' : bss,
     47        'data' : data
     48        }
     49
    4550startfile = re.compile(r'\.(text|bss|data)\s+(0x[0-9a-f]+)\s+0x[0-9a-f]+\s+(.*)$')
     51def generate(kmapf, obmapf, out):
     52    obdump = read_obdump(obmapf)   
    4653
    47 def read_obdump(inp):
    48         "Parse input"
    49        
    50         funcs = {}
    51         data = {}
    52         bss = {}
    53         fname = ''
    54        
    55         for line in inp:
    56                 line = line.strip()
    57                 res = funcline.match(line)
    58                 if (res):
    59                         funcs.setdefault(fname, []).append((int(res.group(1), 16), res.group(3)))
    60                         continue
    61                
    62                 res = bssline.match(line)
    63                 if (res):
    64                         start = int(res.group(1), 16)
    65                         end = int(res.group(2), 16)
    66                         if (end):
    67                                 bss.setdefault(fname, []).append((start, res.group(3)))
    68                
    69                 res = dataline.match(line)
    70                 if (res):
    71                         start = int(res.group(1), 16)
    72                         end = int(res.group(2), 16)
    73                         if (end):
    74                                 data.setdefault(fname, []).append((start, res.group(3)))
    75                
    76                 res = fileexp.match(line)
    77                 if (res):
    78                         fname = res.group(1)
    79                         continue
    80        
    81         return {'text' : funcs, 'bss' : bss, 'data' : data}
     54    def sorter(x,y):
     55        return cmp(x[0],y[0])
    8256
    83 def generate(kmapf, obmapf, out):
    84         "Generate output file"
    85        
    86         obdump = read_obdump(obmapf)
    87        
    88         def sorter(x,y):
    89                 return cmp(x[0],y[0])
    90        
    91         for line in kmapf:
    92                 line = line.strip()
    93                 res = startfile.match(line)
    94                
    95                 if ((res) and (obdump[res.group(1)].has_key(res.group(3)))):
    96                         offset = int(res.group(2), 16)
    97                         fname = res.group(3)
    98                         symbols = obdump[res.group(1)][fname]
    99                         symbols.sort(sorter)
    100                         for addr, symbol in symbols:
    101                                 value = fname + ':' + symbol
    102                                 data = struct.pack(symtabfmt, addr + offset, value[:MAXSTRING])
    103                                 out.write(data)
    104                        
    105         out.write(struct.pack(symtabfmt, 0, ''))
     57    for line in kmapf:
     58        line = line.strip()
     59        res = startfile.match(line)
     60
     61        if res and obdump[res.group(1)].has_key(res.group(3)):
     62            offset = int(res.group(2),16)
     63            fname = res.group(3)
     64            symbols = obdump[res.group(1)][fname]
     65            symbols.sort(sorter)
     66            for addr,symbol in symbols:               
     67                value = fname + ':' + symbol
     68                data = struct.pack(symtabfmt,addr+offset,value[:MAXSTRING])
     69                out.write(data)
     70               
     71    out.write(struct.pack(symtabfmt,0,''))
    10672
    10773def main():
    108         if (len(sys.argv) != 4):
    109                 print "Usage: %s <kernel.map> <nm dump> <output.bin>" % sys.argv[0]
    110                 return 1
    111        
    112         kmapf = open(sys.argv[1], 'r')
    113         obmapf = open(sys.argv[2], 'r')
    114         out = open(sys.argv[3], 'w')
    115        
    116         generate(kmapf, obmapf, out)
    117        
    118         kmapf.close()
    119         obmapf.close()
    120         out.close()
     74    if len(sys.argv) != 4:
     75        print "Usage: %s <kernel.map> <nm dump> <output.bin>" % sys.argv[0]
     76        sys.exit(1)
     77
     78    kmapf = open(sys.argv[1],'r')
     79    obmapf = open(sys.argv[2],'r')
     80    out = open(sys.argv[3],'w')
     81    generate(kmapf,obmapf,out)
     82    kmapf.close()
     83    obmapf.close()
     84    out.close()
    12185
    12286if __name__ == '__main__':
    123         sys.exit(main())
     87    main()
  • tools/config.py

    re2b73d4f rfacebd56  
    2828# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2929#
    30 
    3130"""
    3231HelenOS configuration system
    3332"""
    34 
    3533import sys
    3634import os
     
    4341MAKEFILE = 'Makefile.config'
    4442MACROS = 'config.h'
     43DEFS = 'config.defs'
    4544PRECONF = 'defaults'
    4645
     
    224223        return True
    225224
    226 def create_output(mkname, mcname, defaults, ask_names):
     225def create_output(mkname, mcname, dfname, defaults, ask_names):
    227226        "Create output configuration"
    228227       
     
    230229       
    231230        sys.stderr.write("Fetching current revision identifier ... ")
    232        
    233         try:
    234                 version = subprocess.Popen(['bzr', 'version-info', '--custom', '--template={clean}:{revno}:{revision_id}'], stdout = subprocess.PIPE).communicate()[0].split(':')
    235                 sys.stderr.write("ok\n")
    236         except:
    237                 version = [1, "unknown", "unknown"]
    238                 sys.stderr.write("failed\n")
     231        version = subprocess.Popen(['bzr', 'version-info', '--custom', '--template={clean}:{revno}:{revision_id}'], stdout = subprocess.PIPE).communicate()[0].split(':')
     232        sys.stderr.write("OK\n")
    239233       
    240234        if (len(version) == 3):
     
    248242        outmk = file(mkname, 'w')
    249243        outmc = file(mcname, 'w')
     244        outdf = file(dfname, 'w')
    250245       
    251246        outmk.write('#########################################\n')
     
    257252        outmc.write(' ***************************************/\n\n')
    258253       
    259         defs = 'CONFIG_DEFS ='
     254        outdf.write('#########################################\n')
     255        outdf.write('## AUTO-GENERATED FILE, DO NOT EDIT!!! ##\n')
     256        outdf.write('#########################################\n\n')
     257        outdf.write('CONFIG_DEFS =')
    260258       
    261259        for varname, vartype, name, choices, cond in ask_names:
     
    275273                        if (default == "y"):
    276274                                outmc.write('/* %s */\n#define %s\n\n' % (name, varname))
    277                                 defs += ' -D%s' % varname
     275                                outdf.write(' -D%s' % varname)
    278276                else:
    279277                        outmc.write('/* %s */\n#define %s %s\n#define %s_%s\n\n' % (name, varname, default, varname, default))
    280                         defs += ' -D%s=%s -D%s_%s' % (varname, default, varname, default)
     278                        outdf.write(' -D%s=%s -D%s_%s' % (varname, default, varname, default))
    281279       
    282280        if (revision is not None):
    283281                outmk.write('REVISION = %s\n' % revision)
    284282                outmc.write('#define REVISION %s\n' % revision)
    285                 defs += ' "-DREVISION=%s"' % revision
     283                outdf.write(' "-DREVISION=%s"' % revision)
    286284       
    287285        outmk.write('TIMESTAMP = %s\n' % timestamp)
    288286        outmc.write('#define TIMESTAMP %s\n' % timestamp)
    289         defs += ' "-DTIMESTAMP=%s"\n' % timestamp
    290        
    291         outmk.write(defs)
     287        outdf.write(' "-DTIMESTAMP=%s"\n' % timestamp)
    292288       
    293289        outmk.close()
    294290        outmc.close()
     291        outdf.close()
    295292
    296293def sorted_dir(root):
     
    351348        if ((len(sys.argv) >= 3) and (sys.argv[2] == 'default')):
    352349                if (check_choices(defaults, ask_names)):
    353                         create_output(MAKEFILE, MACROS, defaults, ask_names)
     350                        create_output(MAKEFILE, MACROS, DEFS, defaults, ask_names)
    354351                        return 0
    355352       
     
    469466                xtui.screen_done(screen)
    470467       
    471         create_output(MAKEFILE, MACROS, defaults, ask_names)
     468        create_output(MAKEFILE, MACROS, DEFS, defaults, ask_names)
    472469        return 0
    473470
  • tools/jobfile.py

    re2b73d4f rfacebd56  
    2727# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2828#
    29 
    3029"""
    3130Add a source/object file pair to a checker jobfile
  • tools/mkfat.py

    re2b73d4f rfacebd56  
    2727# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2828#
    29 
    3029"""
    3130FAT creator
  • tools/mkhord.py

    re2b73d4f rfacebd56  
    2727# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2828#
    29 
    3029"""
    3130HORD encapsulator
  • tools/mktmpfs.py

    re2b73d4f rfacebd56  
    2727# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2828#
    29 
    3029"""
    3130TMPFS creator
  • uspace/Makefile

    re2b73d4f rfacebd56  
    3030#
    3131
    32 -include ../Makefile.common
    3332-include ../Makefile.config
    3433
  • uspace/app/Makefile.common

    re2b73d4f rfacebd56  
    6060all: \
    6161    $(LIBC_PREFIX)/../../../version \
    62     $(LIBC_PREFIX)/../../../Makefile.common \
    6362    $(LIBC_PREFIX)/../../../Makefile.config \
    6463    $(LIBC_PREFIX)/../../../config.h \
     64    $(LIBC_PREFIX)/../../../config.defs \
    6565    $(LIBS) \
    6666    \
  • uspace/lib/Makefile.common

    re2b73d4f rfacebd56  
    5050OBJECTS = $(addsuffix .o,$(basename $(SOURCES)))
    5151
    52 -include $(USPACE_PREFIX)/../Makefile.common
    5352-include $(USPACE_PREFIX)/../Makefile.config
    5453include $(LIBC_PREFIX)/Makefile.toolchain
     
    6059all: \
    6160    $(LIBC_PREFIX)/../../../version \
    62     $(LIBC_PREFIX)/../../../Makefile.common \
    6361    $(LIBC_PREFIX)/../../../Makefile.config \
    6462    $(LIBC_PREFIX)/../../../config.h \
     63    $(LIBC_PREFIX)/../../../config.defs \
    6564    $(LIBS) \
    6665    \
  • uspace/lib/libc/Makefile

    re2b73d4f rfacebd56  
    2828#
    2929
    30 -include ../../../Makefile.common
    3130-include ../../../Makefile.config
    3231
  • uspace/lib/libc/Makefile.toolchain

    re2b73d4f rfacebd56  
    5353AFLAGS =
    5454
     55## Cross-toolchain prefix
     56#
     57
     58ifndef CROSS_PREFIX
     59        CROSS_PREFIX = /usr/local
     60endif
     61
    5562## Setup platform configuration
    5663#
    5764
    58 -include $(LIBC_PREFIX)/../../../Makefile.common
    5965-include $(LIBC_PREFIX)/../../../Makefile.config
     66-include $(LIBC_PREFIX)/../../../config.defs
    6067-include $(LIBC_PREFIX)/arch/$(UARCH)/Makefile.inc
    6168
    62 ## Compilation options
     69## Simple detection of the host system
     70#
     71HOST = $(shell uname)
     72
     73## On Solaris, some utilities have different names
     74#
     75ifeq ($(HOST),SunOS)
     76        BINUTILS_PREFIX = "g"
     77else
     78        BINUTILS_PREFIX = ""
     79endif
     80
     81## Toolchain configuration
    6382#
    6483
     
    6685
    6786ifeq ($(COMPILER),gcc_cross)
     87        CC = $(TOOLCHAIN_DIR)/$(TARGET)-gcc
     88        GCC = $(CC)
     89        AS = $(TOOLCHAIN_DIR)/$(TARGET)-as
     90        LD = $(TOOLCHAIN_DIR)/$(TARGET)-ld
     91        AR = $(TOOLCHAIN_DIR)/$(TARGET)-ar
     92        OBJCOPY = $(TOOLCHAIN_DIR)/$(TARGET)-objcopy
     93        OBJDUMP = $(TOOLCHAIN_DIR)/$(TARGET)-objdump
    6894        CFLAGS = $(GCC_CFLAGS)
    6995        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
     
    7197
    7298ifeq ($(COMPILER),gcc_native)
     99        CC = gcc
     100        GCC = $(CC)
     101        AS = $(BINUTILS_PREFIX)as
     102        LD = $(BINUTILS_PREFIX)ld
     103        AR = $(BINUTILS_PREFIX)ar
     104        OBJCOPY = $(BINUTILS_PREFIX)objcopy
     105        OBJDUMP = $(BINUTILS_PREFIX)objdump
    73106        CFLAGS = $(GCC_CFLAGS)
    74107        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
     
    76109
    77110ifeq ($(COMPILER),icc)
     111        CC = icc
     112        GCC = gcc
     113        AS = as
     114        LD = ld
     115        AR = ar
     116        OBJCOPY = objcopy
     117        OBJDUMP = objdump
    78118        CFLAGS = $(ICC_CFLAGS)
    79119        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
     
    81121
    82122ifeq ($(COMPILER),clang)
     123        CC = clang
     124        GCC = gcc
     125        AS = $(BINUTILS_PREFIX)as
     126        LD = $(BINUTILS_PREFIX)ld
     127        AR = $(BINUTILS_PREFIX)ar
     128        OBJCOPY = $(BINUTILS_PREFIX)objcopy
     129        OBJDUMP = $(BINUTILS_PREFIX)objdump
    83130        CFLAGS = $(CLANG_CFLAGS)
    84131        DEPEND_DEFS = $(DEFS) $(CONFIG_DEFS)
  • uspace/lib/libc/arch/abs32le/Makefile.inc

    re2b73d4f rfacebd56  
    2727#
    2828
     29## Toolchain configuration
     30#
     31
     32ifeq ($(COMPILER),gcc_cross)
     33        TOOLCHAIN_DIR = $(CROSS_PREFIX)/$(CROSS_TARGET)/bin
     34       
     35        ifeq ($(CROSS_TARGET),arm32)
     36                TARGET = arm-linux-gnu
     37        endif
     38       
     39        ifeq ($(CROSS_TARGET),ia32)
     40                TARGET = i686-pc-linux-gnu
     41        endif
     42       
     43        ifeq ($(CROSS_TARGET),mips32)
     44                TARGET = mipsel-linux-gnu
     45        endif
     46endif
     47
    2948ifeq ($(COMPILER),clang)
    3049        CLANG_ARCH = i386
  • uspace/lib/libc/arch/amd64/Makefile.inc

    re2b73d4f rfacebd56  
    2727#
    2828
     29## Toolchain configuration
     30#
     31
     32TARGET = amd64-linux-gnu
    2933CLANG_ARCH = x86_64
     34TOOLCHAIN_DIR = $(CROSS_PREFIX)/amd64/bin
    3035
    3136ARCH_SOURCES = \
  • uspace/lib/libc/arch/arm32/Makefile.inc

    re2b73d4f rfacebd56  
    2828#
    2929
     30## Toolchain configuration
     31#
     32
     33TARGET = arm-linux-gnu
     34TOOLCHAIN_DIR = $(CROSS_PREFIX)/arm32/bin
     35
    3036ARCH_SOURCES = \
    3137        arch/$(UARCH)/src/entry.s \
  • uspace/lib/libc/arch/ia32/Makefile.inc

    re2b73d4f rfacebd56  
    2727#
    2828
     29## Toolchain configuration
     30#
     31
     32TARGET = i686-pc-linux-gnu
    2933CLANG_ARCH = i386
     34TOOLCHAIN_DIR = $(CROSS_PREFIX)/ia32/bin
    3035
    3136ARCH_SOURCES = \
  • uspace/lib/libc/arch/ia64/Makefile.inc

    re2b73d4f rfacebd56  
    2727#
    2828
     29## Toolchain configuration
     30#
     31
     32TARGET = ia64-pc-linux-gnu
     33TOOLCHAIN_DIR = $(CROSS_PREFIX)/ia64/bin
     34
    2935ARCH_SOURCES = \
    3036        arch/$(UARCH)/src/entry.s \
  • uspace/lib/libc/arch/mips32/Makefile.inc

    re2b73d4f rfacebd56  
    2727#
    2828
     29## Toolchain configuration
     30#
     31
     32TARGET = mipsel-linux-gnu
     33TOOLCHAIN_DIR = $(CROSS_PREFIX)/mips32/bin
     34
    2935ARCH_SOURCES = \
    3036        arch/$(UARCH)/src/entry.s \
  • uspace/lib/libc/arch/mips32eb/Makefile.inc

    re2b73d4f rfacebd56  
    2727#
    2828
     29## Toolchain configuration
     30#
     31
     32TARGET = mips-linux-gnu
     33TOOLCHAIN_DIR = $(CROSS_PREFIX)/mips32eb/bin
     34
    2935ARCH_SOURCES = \
    3036        arch/$(UARCH)/src/entry.s \
  • uspace/lib/libc/arch/ppc32/Makefile.inc

    re2b73d4f rfacebd56  
    2727#
    2828
     29## Toolchain configuration
     30#
     31
     32TARGET = ppc-linux-gnu
     33TOOLCHAIN_DIR = $(CROSS_PREFIX)/ppc32/bin
     34
    2935ARCH_SOURCES = \
    3036        arch/$(UARCH)/src/entry.s \
  • uspace/lib/libc/arch/sparc64/Makefile.inc

    re2b73d4f rfacebd56  
    2727#
    2828
     29## Toolchain configuration
     30#
     31
     32TARGET = sparc64-linux-gnu
     33TOOLCHAIN_DIR = $(CROSS_PREFIX)/sparc64/bin
     34
    2935ARCH_SOURCES = \
    3036        arch/$(UARCH)/src/entry.s \
  • uspace/srv/Makefile.common

    re2b73d4f rfacebd56  
    6464all: \
    6565    $(LIBC_PREFIX)/../../../version \
    66     $(LIBC_PREFIX)/../../../Makefile.common \
    6766    $(LIBC_PREFIX)/../../../Makefile.config \
    6867    $(LIBC_PREFIX)/../../../config.h \
     68    $(LIBC_PREFIX)/../../../config.defs \
    6969    $(LIBS) \
    7070    \
     
    7777        find . -name '*.o' -follow -exec rm \{\} \;
    7878
    79 build:
     79build: 
    8080
    8181-include $(DEPEND)
  • uspace/srv/hid/char_mouse/chardev.c

    re2b73d4f rfacebd56  
    4848static int dev_phone;
    4949
    50 #define NAME "char_mouse"
     50#define NAME "kbd"
    5151
    5252int mouse_port_init(void)
  • uspace/srv/hid/char_mouse/proto/ps2.c

    re2b73d4f rfacebd56  
    3636
    3737#include <stdio.h>
    38 #include <mouse_port.h>
     38#include <mouse_proto.h>
    3939#include <char_mouse.h>
    40 #include <mouse_proto.h>
    4140
    4241#define BUFSIZE 3
    43 
    44 #define PS2_MOUSE_OUT_INIT  0xf4
    45 #define PS2_MOUSE_ACK       0xfa
    4642
    4743typedef struct {
     
    7167int mouse_proto_init(void)
    7268{
    73         mouse_port_write(PS2_MOUSE_OUT_INIT);
    7469        return 0;
    7570}
  • uspace/srv/hid/console/Makefile

    re2b73d4f rfacebd56  
    3232.PHONY: all clean
    3333
    34 all: $(LIBC_PREFIX)/../../../Makefile.common $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBS)
     34all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS)
    3535        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
    3636        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
  • uspace/srv/hid/fb/Makefile

    re2b73d4f rfacebd56  
    3232.PHONY: all clean
    3333
    34 all: $(LIBC_PREFIX)/../../../Makefile.common $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBS)
     34all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS)
    3535        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
    3636        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
  • uspace/srv/hid/kbd/Makefile

    re2b73d4f rfacebd56  
    3232.PHONY: all clean
    3333
    34 all: $(LIBC_PREFIX)/../../../Makefile.common $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBS)
     34all: $(LIBC_PREFIX)/../../../Makefile.config $(LIBC_PREFIX)/../../../config.h $(LIBC_PREFIX)/../../../config.defs $(LIBS)
    3535        -[ -f $(DEPEND) ] && mv -f $(DEPEND) $(DEPEND_PREV)
    3636        $(MAKE) -f Makefile.build PRECHECK=$(PRECHECK)
  • uspace/srv/hw/char/i8042/i8042.c

    re2b73d4f rfacebd56  
    6868#define i8042_KBD_TRANSLATE     0x40
    6969
     70/* Mouse constants */
     71#define MOUSE_OUT_INIT  0xf4
     72#define MOUSE_ACK       0xfa
    7073
    7174enum {
     
    174177        async_set_interrupt_received(i8042_irq_handler);
    175178
    176         /* Disable kbd and aux */
    177         wait_ready();
     179        /* Disable kbd, enable mouse */
    178180        pio_write_8(&i8042->status, i8042_CMD_WRITE_CMDB);
    179181        wait_ready();
    180         pio_write_8(&i8042->data, i8042_KBD_DISABLE | i8042_AUX_DISABLE);
     182        pio_write_8(&i8042->status, i8042_CMD_WRITE_CMDB);
     183        wait_ready();
     184        pio_write_8(&i8042->data, i8042_KBD_DISABLE);
     185        wait_ready();
    181186
    182187        /* Flush all current IO */
    183188        while (pio_read_8(&i8042->status) & i8042_OUTPUT_FULL)
    184189                (void) pio_read_8(&i8042->data);
     190
     191        i8042_port_write(DEVID_AUX, MOUSE_OUT_INIT);
    185192
    186193        i8042_kbd.cmds[0].addr = (void *) &((i8042_t *) i8042_kernel)->status;
     
    188195        ipc_register_irq(sysinfo_value("i8042.inr_a"), device_assign_devno(), 0, &i8042_kbd);
    189196        ipc_register_irq(sysinfo_value("i8042.inr_b"), device_assign_devno(), 0, &i8042_kbd);
    190         printf("i8042: registered for interrupts %d and %d\n",
    191             sysinfo_value("i8042.inr_a"), sysinfo_value("i8042.inr_b"));
    192 
    193         wait_ready();
     197
    194198        pio_write_8(&i8042->status, i8042_CMD_WRITE_CMDB);
    195199        wait_ready();
    196200        pio_write_8(&i8042->data, i8042_KBD_IE | i8042_KBD_TRANSLATE |
    197201            i8042_AUX_IE);
     202        wait_ready();
    198203
    199204        return 0;
     
    266271{
    267272        if (devid == DEVID_AUX) {
     273                pio_write_8(&i8042->status, i8042_CMD_WRITE_AUX);
    268274                wait_ready();
    269                 pio_write_8(&i8042->status, i8042_CMD_WRITE_AUX);
    270         }
    271         wait_ready();
     275        }
    272276        pio_write_8(&i8042->data, data);
     277        wait_ready();
    273278}
    274279
  • uspace/srv/loader/Makefile

    re2b73d4f rfacebd56  
    2828#
    2929
    30 -include ../../../Makefile.common
    3130-include ../../../Makefile.config
    3231-include arch/$(UARCH)/Makefile.inc
  • uspace/srv/net/Makefile

    re2b73d4f rfacebd56  
    2727#
    2828
    29 include ../../../Makefile.common
    3029include ../../../Makefile.config
    3130
  • uspace/srv/net/app/echo/Makefile

    re2b73d4f rfacebd56  
    3232STRUCTURES = $(NET_BASE)structures/
    3333
    34 include ../../../../../Makefile.common
    3534include ../../../../../Makefile.config
    3635
  • uspace/srv/net/app/nettest1/Makefile

    re2b73d4f rfacebd56  
    3232STRUCTURES = $(NET_BASE)structures/
    3333
    34 include ../../../../../Makefile.common
    3534include ../../../../../Makefile.config
    3635
  • uspace/srv/net/app/nettest2/Makefile

    re2b73d4f rfacebd56  
    3232STRUCTURES = $(NET_BASE)structures/
    3333
    34 include ../../../../../Makefile.common
    3534include ../../../../../Makefile.config
    3635
  • uspace/srv/net/app/ping/Makefile

    re2b73d4f rfacebd56  
    3232STRUCTURES = $(NET_BASE)structures/
    3333
    34 include ../../../../../Makefile.common
    3534include ../../../../../Makefile.config
    3635
  • uspace/srv/net/il/ip/ip.c

    re2b73d4f rfacebd56  
    895895        ip_pseudo_header_ref header;
    896896        size_t headerlen;
    897         device_id_t device_id;
    898897
    899898        *answer_count = 0;
     
    922921                case NET_IP_GET_ROUTE:
    923922                        ERROR_PROPAGATE(data_receive((void **) &addr, &addrlen));
    924                         ERROR_PROPAGATE(ip_get_route_req(0, IP_GET_PROTOCOL(call), addr, (socklen_t) addrlen,
    925                             &device_id, &header, &headerlen));
    926                         *IPC_SET_DEVICE(answer) = device_id;
     923                        ERROR_PROPAGATE(ip_get_route_req(0, IP_GET_PROTOCOL(call), addr, (socklen_t) addrlen, IPC_SET_DEVICE(answer), &header, &headerlen));
    927924                        *IP_SET_HEADERLEN(answer) = headerlen;
    928925                        *answer_count = 2;
  • uspace/srv/net/il/ip/ip_messages.h

    re2b73d4f rfacebd56  
    8282 *  @param[out] answer The message answer structure.
    8383 */
    84 #define IP_SET_HEADERLEN(answer)        (&IPC_GET_ARG2(*answer))
     84#define IP_SET_HEADERLEN(answer)        ((size_t *) &IPC_GET_ARG2(*answer))
    8585
    8686/** Returns the network mask message parameter.
  • uspace/srv/net/messages.h

    re2b73d4f rfacebd56  
    391391 *  @param[out] answer The message answer structure.
    392392 */
    393 #define IPC_SET_DEVICE(answer)  (&IPC_GET_ARG1(*answer))
     393#define IPC_SET_DEVICE(answer)  ((device_id_t *) &IPC_GET_ARG1(*answer))
    394394
    395395/** Sets the minimum address length in the message answer.
    396396 *  @param[out] answer The message answer structure.
    397397 */
    398 #define IPC_SET_ADDR(answer)            (&IPC_GET_ARG1(*answer))
     398#define IPC_SET_ADDR(answer)            ((size_t *) &IPC_GET_ARG1(*answer))
    399399
    400400/*@}*/
     
    407407 *  @param[out] answer The message answer structure.
    408408 */
    409 #define IPC_SET_PREFIX(answer)  (&IPC_GET_ARG2(*answer))
     409#define IPC_SET_PREFIX(answer)  ((size_t *) &IPC_GET_ARG2(*answer))
    410410
    411411/*@}*/
     
    418418 *  @param[out] answer The message answer structure.
    419419 */
    420 #define IPC_SET_CONTENT(answer) (&IPC_GET_ARG3(*answer))
     420#define IPC_SET_CONTENT(answer) ((size_t *) &IPC_GET_ARG3(*answer))
    421421
    422422/*@}*/
     
    429429 *  @param[out] answer The message answer structure.
    430430 */
    431 #define IPC_SET_SUFFIX(answer)  (&IPC_GET_ARG4(*answer))
     431#define IPC_SET_SUFFIX(answer)  ((size_t *) &IPC_GET_ARG4(*answer))
    432432
    433433/*@}*/
  • uspace/srv/net/net/Makefile

    re2b73d4f rfacebd56  
    3232STRUCTURES = $(NET_BASE)structures/
    3333
    34 include $(NET_BASE)../../../Makefile.common
    3534include $(NET_BASE)../../../Makefile.config
    3635
  • uspace/srv/net/net/start/Makefile

    re2b73d4f rfacebd56  
    3232STRUCTURES = $(NET_BASE)structures/
    3333
    34 include ../../../../../Makefile.common
    3534include ../../../../../Makefile.config
    3635
  • uspace/srv/net/netif/dp8390/Makefile

    re2b73d4f rfacebd56  
    3232STRUCTURES = $(NET_BASE)structures/
    3333
    34 include $(NET_BASE)../../../Makefile.common
    3534include $(NET_BASE)../../../Makefile.config
    3635
  • uspace/srv/net/netif/lo/Makefile

    re2b73d4f rfacebd56  
    3232STRUCTURES = $(NET_BASE)structures/
    3333
    34 include $(NET_BASE)../../../Makefile.common
    3534include $(NET_BASE)../../../Makefile.config
    3635
  • uspace/srv/net/socket/socket_messages.h

    re2b73d4f rfacebd56  
    115115 *  @param[out] answer The message answer structure.
    116116 */
    117 #define SOCKET_SET_SOCKET_ID(answer)            &IPC_GET_ARG1(answer)
     117#define SOCKET_SET_SOCKET_ID(answer)                    (int *) &IPC_GET_ARG1(answer)
    118118
    119119/** Returns the socket identifier message parameter.
    120120 *  @param[in] call The message call structure.
    121121 */
    122 #define SOCKET_GET_SOCKET_ID(call)              (int) IPC_GET_ARG1(call)
     122#define SOCKET_GET_SOCKET_ID(call)                      (int) IPC_GET_ARG1(call)
    123123
    124124/** Sets the read data length in the message answer.
    125125 *  @param[out] answer The message answer structure.
    126126 */
    127 #define SOCKET_SET_READ_DATA_LENGTH(answer)     &IPC_GET_ARG1(answer)
     127#define SOCKET_SET_READ_DATA_LENGTH(answer)     (int *) &IPC_GET_ARG1(answer)
    128128
    129129/** Returns the read data length message parameter.
    130130 *  @param[in] call The message call structure.
    131131 */
    132 #define SOCKET_GET_READ_DATA_LENGTH(call)       (int) IPC_GET_ARG1(call)
     132#define SOCKET_GET_READ_DATA_LENGTH(call)               (int) IPC_GET_ARG1(call)
    133133
    134134/** Returns the backlog message parameter.
    135135 *  @param[in] call The message call structure.
    136136 */
    137 #define SOCKET_GET_BACKLOG(call)                (int) IPC_GET_ARG2(call)
     137#define SOCKET_GET_BACKLOG(call)                                (int) IPC_GET_ARG2(call)
    138138
    139139/** Returns the option level message parameter.
    140140 *  @param[in] call The message call structure.
    141141 */
    142 #define SOCKET_GET_OPT_LEVEL(call)              (int) IPC_GET_ARG2(call)
     142#define SOCKET_GET_OPT_LEVEL(call)                      (int) IPC_GET_ARG2(call)
    143143
    144144/** Returns the data fragment size message parameter.
     
    150150 *  @param[out] answer The message answer structure.
    151151 */
    152 #define SOCKET_SET_DATA_FRAGMENT_SIZE(answer)   &IPC_GET_ARG2(answer)
     152#define SOCKET_SET_DATA_FRAGMENT_SIZE(answer)   (size_t *) &IPC_GET_ARG2(answer)
    153153
    154154/** Sets the address length in the message answer.
    155155 *  @param[out] answer The message answer structure.
    156156 */
    157 #define SOCKET_SET_ADDRESS_LENGTH(answer)       &IPC_GET_ARG3(answer)
     157#define SOCKET_SET_ADDRESS_LENGTH(answer)               (socklen_t *) &IPC_GET_ARG3(answer)
    158158
    159159/** Returns the address length message parameter.
     
    165165 *  @param[out] answer The message answer structure.
    166166 */
    167 #define SOCKET_SET_HEADER_SIZE(answer)          &IPC_GET_ARG3(answer)
     167#define SOCKET_SET_HEADER_SIZE(answer)          (int *) &IPC_GET_ARG3(answer)
    168168
    169169/** Returns the header size message parameter.
    170170 *  @param[in] call The message call structure.
    171171 */
    172 #define SOCKET_GET_HEADER_SIZE(call)            (size_t) IPC_GET_ARG3(call)
     172#define SOCKET_GET_HEADER_SIZE(call)                    (int) IPC_GET_ARG3(call)
    173173
    174174/** Returns the flags message parameter.
    175175 *  @param[in] call The message call structure.
    176176 */
    177 #define SOCKET_GET_FLAGS(call)                  (int) IPC_GET_ARG4(call)
     177#define SOCKET_GET_FLAGS(call)                          (int) IPC_GET_ARG4(call)
    178178
    179179/** Returns the option name message parameter.
    180180 *  @param[in] call The message call structure.
    181181 */
    182 #define SOCKET_GET_OPT_NAME(call)               (int) IPC_GET_ARG4(call)
     182#define SOCKET_GET_OPT_NAME(call)                               (int) IPC_GET_ARG4(call)
    183183
    184184/** Returns the data fragments message parameter.
  • uspace/srv/net/tl/tcp/tcp.c

    re2b73d4f rfacebd56  
    10601060        int app_phone = IPC_GET_PHONE(&call);
    10611061        struct sockaddr * addr;
    1062         int socket_id;
    10631062        size_t addrlen;
    10641063        fibril_rwlock_t lock;
     
    11051104                                        socket_data->local_sockets = &local_sockets;
    11061105                                        fibril_rwlock_write_lock(&lock);
    1107                                         socket_id = SOCKET_GET_SOCKET_ID(call);
    1108                                         res = socket_create(&local_sockets, app_phone, socket_data, &socket_id);
    1109                                         *SOCKET_SET_SOCKET_ID(answer) = socket_id;
     1106                                        *SOCKET_SET_SOCKET_ID(answer) = SOCKET_GET_SOCKET_ID(call);
     1107                                        res = socket_create(&local_sockets, app_phone, socket_data, SOCKET_SET_SOCKET_ID(answer));
    11101108                                        fibril_rwlock_write_unlock(&lock);
    11111109                                        if(res == EOK){
  • uspace/srv/net/tl/udp/udp.c

    re2b73d4f rfacebd56  
    417417        int app_phone = IPC_GET_PHONE(&call);
    418418        struct sockaddr * addr;
    419         int socket_id;
    420419        size_t addrlen;
    421420        ipc_call_t answer;
     
    452451                                break;
    453452                        case NET_SOCKET:
    454                                 socket_id = SOCKET_GET_SOCKET_ID(call);
    455                                 res = socket_create(&local_sockets, app_phone, NULL, &socket_id);
    456                                 *SOCKET_SET_SOCKET_ID(answer) = socket_id;
    457                                
     453                                *SOCKET_SET_SOCKET_ID(answer) = SOCKET_GET_SOCKET_ID(call);
     454                                res = socket_create(&local_sockets, app_phone, NULL, SOCKET_SET_SOCKET_ID(answer));
    458455                                if(res == EOK){
    459456                                        if(tl_get_ip_packet_dimension(udp_globals.ip_phone, &udp_globals.dimensions, DEVICE_INVALID_ID, &packet_dimension) == EOK){
Note: See TracChangeset for help on using the changeset viewer.