ARM_CPUNAME = gerneric-armv7
-CC = arm-elf-gcc -mcpu=$(ARM_CPUNAME)
-AS = arm-elf-gcc -mcpu=$(ARM_CPUNAME) -c
-LD = arm-elf-ld
+CC = arm-eabi-gcc -mcpu=$(ARM_CPUNAME)
+AS = arm-eabi-gcc -mcpu=$(ARM_CPUNAME) -c
+LD = arm-eabi-ld
OBJDUMP = arm-elf-objdump
DISASM = $(OBJDUMP) -d -S
ARCHDIR = armv7
@echo BUILD_NUM = $$(( $(BUILD_NUM) + 1 )) > Makefile.BuildNum.$(ARCH)
$(POSTBUILD)
@cp $(BIN) $(BIN)_
- @-$(STRIP) $(BIN)_
+ @$(STRIP) $(BIN)_ || true
@gzip -c $(BIN)_ > $(GZBIN)
@$(RM) $(BIN)_
// === PROTOTYPES ===
Uint64 __divmod64(Uint64 Num, Uint64 Den, Uint64 *Rem);
Uint32 __divmod32(Uint32 Num, Uint32 Den, Uint32 *Rem);
+#if 0
Uint64 __udivdi3(Uint64 Num, Uint64 Den);
Uint64 __umoddi3(Uint64 Num, Uint64 Den);
Uint32 __udivsi3(Uint32 Num, Uint32 Den);
Uint32 __umodsi3(Uint32 Num, Uint32 Den);
Sint32 __divsi3(Sint32 Num, Sint32 Den);
Sint32 __modsi3(Sint32 Num, Sint32 Den);
+#endif
+void abort(void);
// === CODE ===
void *memcpy(void *_dest, const void *_src, size_t _length)
return ret;
}
+#if 0
// Unsigned Divide 64-bit Integer
Uint64 __udivdi3(Uint64 Num, Uint64 Den)
{
DivMod32S(Num, Den, &rem);
return rem;
}
+#endif
+
+void abort(void)
+{
+ for(;;);
+}
*(.usertext)
}
. += gUsertextPhysStart + _kernel_base - _usertext_vbase;
-
+
+ /DISCARD/ : { *(.ARM.extab.init .ARM.exidx.init) }
+ .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) }
+ PROVIDE_HIDDEN ( __exidx_start = . );
+ .ARM.exidx : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) }
+ PROVIDE_HIDDEN ( __exidx_end = . );
+ .eh_frame_hdr : { *(.eh_frame_hdr) }
+ .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
+ .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
+
/* 0x4000 (4 pages) alignment needed for root table */
- .data ALIGN(0x4000) : AT( ADDR(.data) - _kernel_base )
+ . = ALIGN(0x4000);
+ .data : AT( ADDR(.data) - _kernel_base )
{
*(.padata)
*(.data*)
*(KMODULES)
gKernelModulesEnd = .;
}
- .bss : AT( ADDR(.bss) - _kernel_base )
+ .bss ALIGN(0x1000) : AT( ADDR(.bss) - _kernel_base )
{
bss_start = .;
*(.bss*)
}
// --- Exports ---
-tPAddr MM_GetPhysAddr(tVAddr VAddr)
+tPAddr MM_GetPhysAddr(const void *Ptr)
{
tMM_PageInfo pi;
- if( MM_int_GetPageInfo(VAddr, &pi) )
+ if( MM_int_GetPageInfo((tVAddr)Ptr, &pi) )
return 0;
- return pi.PhysAddr | (VAddr & ((1 << pi.Size)-1));
+ return pi.PhysAddr | ((tVAddr)Ptr & ((1 << pi.Size)-1));
}
Uint MM_GetFlags(tVAddr VAddr)
*(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
}
+ __exidx_start = .;
.text : AT(ADDR(.text)) {
code = .;
*(.text)
*(.rodata*)
}
+ __exidx_end = .;
.data ALIGN (0x1000) : AT(ADDR(.data)) {
data = .;
#define O_RD (OPENFLAG_READ)
#define O_CREAT (OPENFLAG_CREATE)
-typedef intptr_t ssize_t;
+//typedef intptr_t ssize_t;
#include "acess/sys.h"
#endif\r
for(;;);\r
}\r
+\r
+void abort(void)\r
+{\r
+ _exit(-4);\r
+}\r