Subversion Repositories HelenOS-historic

Rev

Rev 329 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 329 Rev 330
1
MIPS_TARGET=mipsel-linux-gnu
1
MIPS_TARGET=mipsel-linux-gnu
2
 
2
 
3
MIPS_CC_DIR=/usr/local/mipsel/bin
3
MIPS_CC_DIR=/usr/local/mipsel/bin
4
MIPS_BINUTILS_DIR=/usr/local/mipsel/bin
4
MIPS_BINUTILS_DIR=/usr/local/mipsel/bin
5
 
5
 
6
CC=$(MIPS_CC_DIR)/$(MIPS_TARGET)-gcc
6
CC=$(MIPS_CC_DIR)/$(MIPS_TARGET)-gcc
7
AS=$(MIPS_BINUTILS_DIR)/$(MIPS_TARGET)-as
7
AS=$(MIPS_BINUTILS_DIR)/$(MIPS_TARGET)-as
8
LD=$(MIPS_BINUTILS_DIR)/$(MIPS_TARGET)-ld
8
LD=$(MIPS_BINUTILS_DIR)/$(MIPS_TARGET)-ld
9
OBJDUMP=$(MIPS_BINUTILS_DIR)/$(MIPS_TARGET)-objdump
9
OBJDUMP=$(MIPS_BINUTILS_DIR)/$(MIPS_TARGET)-objdump
10
OBJCOPY=$(MIPS_BINUTILS_DIR)/$(MIPS_TARGET)-objcopy
10
OBJCOPY=$(MIPS_BINUTILS_DIR)/$(MIPS_TARGET)-objcopy
11
BFD_NAME=elf32-tradlittlemips
11
BFD_NAME=elf32-tradlittlemips
12
BFD_ARCH=mips
12
BFD_ARCH=mips
13
 
13
 
14
DEFS=-DARCH=$(ARCH) -DMACHINE=${MACHINE} -DKERNEL_LOAD_ADDRESS=${KERNEL_LOAD_ADDRESS}
14
DEFS=-DARCH=$(ARCH) -DMACHINE=${MACHINE} -DKERNEL_LOAD_ADDRESS=${KERNEL_LOAD_ADDRESS}
15
CFLAGS=$(DEFS) -mno-abicalls -G 0 -nostdlib -fno-builtin -O2  -fno-zero-initialized-in-bss 
15
CFLAGS=$(DEFS) -mno-abicalls -G 0 -nostdlib -fno-builtin -O2  -fno-zero-initialized-in-bss 
16
LFLAGS=-M -N
16
LFLAGS=-M -N
17
 
17
 
18
# It seems that on big endian either GCC or the simulators
18
# It seems that on big endian either GCC or the simulators
19
# have the swl/swr/lwl/lwr instructions wrong. Just for sure,
19
# have the swl/swr/lwl/lwr instructions wrong. Just for sure,
20
# disable it with -mmemcpy (force calling memcpy instead of inlining)
20
# disable it with -mmemcpy (force calling memcpy instead of inlining)
21
 
21
 
22
ifeq (${MACHINE},indy)
22
ifeq (${MACHINE},indy)
23
 CFLAGS += -EB -mmemcpy -DBIG_ENDIAN -DHAVE_FPU -DFPU_LAZY -march=r4600
23
 CFLAGS += -EB -mmemcpy -DBIG_ENDIAN -DHAVE_FPU -DFPU_LAZY -march=r4600
24
 BFD = ecoff-bigmips
24
 BFD = ecoff-bigmips
25
 KERNEL_LOAD_ADDRESS = 0x88002000
25
 KERNEL_LOAD_ADDRESS = 0x88002000
26
endif
26
endif
27
 
27
 
28
ifeq (${MACHINE},lgxemul)
28
ifeq (${MACHINE},lgxemul)
29
 CFLAGS += -DHAVE_FPU -DFPU_LAZY -mips3
29
 CFLAGS += -DHAVE_FPU -DFPU_LAZY -mips3
30
 BFD = ecoff-littlemips
30
 BFD = ecoff-littlemips
31
 KERNEL_LOAD_ADDRESS = 0x80010000
31
 KERNEL_LOAD_ADDRESS = 0x80100000
32
endif
32
endif
33
 
33
 
34
ifeq (${MACHINE},bgxemul)
34
ifeq (${MACHINE},bgxemul)
35
 CFLAGS += -EB -mmemcpy -DBIG_ENDIAN -DHAVE_FPU -DFPU_LAZY -mips3
35
 CFLAGS += -EB -mmemcpy -DBIG_ENDIAN -DHAVE_FPU -DFPU_LAZY -mips3
36
 BFD = ecoff-bigmips
36
 BFD = ecoff-bigmips
37
 KERNEL_LOAD_ADDRESS = 0x80010000
37
 KERNEL_LOAD_ADDRESS = 0x80100000
38
endif
38
endif
39
 
39
 
40
# MSIM needs lwl/swl patch & 4kc instruction patch to work
40
# MSIM needs lwl/swl patch & 4kc instruction patch to work
41
# otherwise add -mmemcpy -mips3
41
# otherwise add -mmemcpy -mips3
42
ifeq (${MACHINE},msim)
42
ifeq (${MACHINE},msim)
43
 BFD = binary
43
 BFD = binary
44
 CFLAGS += -msoft-float -march=4kc 
44
 CFLAGS += -msoft-float -march=4kc 
45
 KERNEL_LOAD_ADDRESS = 0x80010000
45
 KERNEL_LOAD_ADDRESS = 0x80100000
46
endif
46
endif
47
 
47
 
48
# SIMICS 4kc emulation is broken, although for instructions
48
# SIMICS 4kc emulation is broken, although for instructions
49
# that do not bother us
49
# that do not bother us
50
ifeq (${MACHINE},simics)
50
ifeq (${MACHINE},simics)
51
 BFD = elf32-little
51
 BFD = elf32-little
52
 CFLAGS += -msoft-float -mips3
52
 CFLAGS += -msoft-float -mips3
53
 KERNEL_LOAD_ADDRESS = 0x80010000
53
 KERNEL_LOAD_ADDRESS = 0x80100000
54
endif
54
endif
55
 
55
 
56
../arch/$(ARCH)/_link.ld: ../arch/$(ARCH)/_link.ld.in
56
../arch/$(ARCH)/_link.ld: ../arch/$(ARCH)/_link.ld.in
57
	$(CC) $(CFLAGS) -C -DBFD=${BFD} -E -x c $< | grep -v "^\#" > $@
57
	$(CC) $(CFLAGS) -C -DBFD=${BFD} -E -x c $< | grep -v "^\#" > $@
58
 
58
 
59
arch_sources= \
59
arch_sources= \
60
	arch/start.S \
60
	arch/start.S \
61
	arch/context.S \
61
	arch/context.S \
62
	arch/panic.S \
62
	arch/panic.S \
63
	arch/mips.c \
63
	arch/mips.c \
64
	arch/dummy.S \
64
	arch/dummy.S \
65
	arch/console.c \
65
	arch/console.c \
66
	arch/asm.S \
66
	arch/asm.S \
67
	arch/exception.c \
67
	arch/exception.c \
68
	arch/interrupt.c \
68
	arch/interrupt.c \
69
	arch/cache.c \
69
	arch/cache.c \
70
	arch/cpu/cpu.c \
70
	arch/cpu/cpu.c \
71
	arch/mm/frame.c \
71
	arch/mm/frame.c \
72
	arch/mm/page.c \
72
	arch/mm/page.c \
73
	arch/mm/tlb.c \
73
	arch/mm/tlb.c \
74
	arch/fpu_context.c \
74
	arch/fpu_context.c \
75
	arch/fmath.c
75
	arch/fmath.c
76
 
76