diff --git a/mach/mips/libem/build.lua b/mach/mips/libem/build.lua new file mode 100644 index 000000000..5ed9b52e8 --- /dev/null +++ b/mach/mips/libem/build.lua @@ -0,0 +1,17 @@ +for _, plat in ipairs(vars.plats) do + acklibrary { + name = "headers_"..plat, + } + + acklibrary { + name = "lib_"..plat, + srcs = { + "./*.s", -- dus4.s + }, + vars = { plat = plat }, + deps = { + "h+emheaders", + "+headers_"..plat, + } + } +end diff --git a/mach/mips/libend/build.lua b/mach/mips/libend/build.lua new file mode 100644 index 000000000..ca5a13c65 --- /dev/null +++ b/mach/mips/libend/build.lua @@ -0,0 +1,8 @@ +for _, plat in ipairs(vars.plats) do + acklibrary { + name = "lib_"..plat, + srcs = { "./*.s" }, + vars = { plat = plat }, + } +end + diff --git a/mach/mips/libend/edata.s b/mach/mips/libend/edata.s new file mode 100644 index 000000000..f53adc109 --- /dev/null +++ b/mach/mips/libend/edata.s @@ -0,0 +1,9 @@ +.sect .text +.sect .rom +.sect .data +.sect .bss +.define _edata +.sect .data + .align 4 + .sect .data +_edata: diff --git a/mach/mips/libend/em_end.s b/mach/mips/libend/em_end.s new file mode 100644 index 000000000..0271f09f6 --- /dev/null +++ b/mach/mips/libend/em_end.s @@ -0,0 +1,24 @@ +! $Source$ +! $State$ +! $Revision$ + +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .end ! only for declaration of _end, __end and endbss. +.define endtext, endrom, enddata, endbss, __end + + .sect .text + .align 4 +endtext: + .sect .rom + .align 4 +endrom: + .sect .data + .align 4 +enddata: + .sect .end + .align 4 +__end: +endbss: diff --git a/mach/mips/libend/end.s b/mach/mips/libend/end.s new file mode 100644 index 000000000..93a1e6e00 --- /dev/null +++ b/mach/mips/libend/end.s @@ -0,0 +1,7 @@ +.sect .text +.sect .rom +.sect .data +.sect .bss +.define _end +.sect .end ! only for declaration of _end, __end and endbss. +_end: diff --git a/mach/mips/libend/etext.s b/mach/mips/libend/etext.s new file mode 100644 index 000000000..8c7453cb4 --- /dev/null +++ b/mach/mips/libend/etext.s @@ -0,0 +1,9 @@ +.sect .text +.sect .rom +.sect .data +.sect .bss +.define _etext +.sect .text + .align 4 + .sect .text +_etext: diff --git a/plat/linuxmips/build-pkg.lua b/plat/linuxmips/build-pkg.lua index 8f9a100b2..73f73e68e 100644 --- a/plat/linuxmips/build-pkg.lua +++ b/plat/linuxmips/build-pkg.lua @@ -5,21 +5,21 @@ ackfile { srcs = { "./boot.s" }, vars = { plat = "linuxmips" } } --- ---build_plat_libs { --- name = "libs", --- arch = "powerpc", --- plat = "linuxppc", ---} + +build_plat_libs { + name = "libs", + arch = "mips", + plat = "linuxmips", +} installable { name = "pkg", map = { "+tools", --- "+libs", + "+libs", "./include+pkg", ["$(PLATIND)/linuxmips/boot.o"] = "+boot", --- ["$(PLATIND)/linuxppc/libsys.a"] = "./libsys+lib", + ["$(PLATIND)/linuxmips/libsys.a"] = "./libsys+lib", } } diff --git a/plat/linuxmips/libsys/_syscall.s b/plat/linuxmips/libsys/_syscall.s new file mode 100644 index 000000000..75c551d20 --- /dev/null +++ b/plat/linuxmips/libsys/_syscall.s @@ -0,0 +1,18 @@ +# +! Declare segments (the order is important). + +.sect .text +.sect .rom +.sect .data +.sect .bss + +.sect .text + +#define EINVAL 22 + +! Perform a Linux system call. + +.define __syscall +__syscall: + syscall 0 + diff --git a/plat/linuxmips/libsys/build.lua b/plat/linuxmips/libsys/build.lua new file mode 100644 index 000000000..2265e6869 --- /dev/null +++ b/plat/linuxmips/libsys/build.lua @@ -0,0 +1,33 @@ +acklibrary { + name = "lib", + srcs = { + "./_syscall.s", + "plat/linux/libsys/_exit.c", + "plat/linux/libsys/_hol0.s", + "plat/linux/libsys/close.c", + "plat/linux/libsys/creat.c", + "plat/linux/libsys/execve.c", + "plat/linux/libsys/getpid.c", + "plat/linux/libsys/gettimeofday.c", + "plat/linux/libsys/ioctl.c", + "plat/linux/libsys/isatty.c", + "plat/linux/libsys/kill.c", + "plat/linux/libsys/lseek.c", + "plat/linux/libsys/open.c", + "plat/linux/libsys/read.c", + "plat/linux/libsys/sbrk.c", + "plat/linux/libsys/signal.c", + "plat/linux/libsys/sigprocmask.c", + "plat/linux/libsys/unlink.c", + "plat/linux/libsys/write.c", + }, + deps = { + "plat/linux/libsys/*.h", + "lang/cem/libcc.ansi/headers+headers", + "plat/linuxmips/include+pkg", + }, + vars = { + plat = "linuxmips" + } +} +