Added library skeletons.

This commit is contained in:
David Given 2018-09-05 00:07:07 +02:00
parent 98afb42095
commit 26fe3f7530
9 changed files with 133 additions and 8 deletions

17
mach/mips/libem/build.lua Normal file
View file

@ -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

View file

@ -0,0 +1,8 @@
for _, plat in ipairs(vars.plats) do
acklibrary {
name = "lib_"..plat,
srcs = { "./*.s" },
vars = { plat = plat },
}
end

9
mach/mips/libend/edata.s Normal file
View file

@ -0,0 +1,9 @@
.sect .text
.sect .rom
.sect .data
.sect .bss
.define _edata
.sect .data
.align 4
.sect .data
_edata:

24
mach/mips/libend/em_end.s Normal file
View file

@ -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:

7
mach/mips/libend/end.s Normal file
View file

@ -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:

9
mach/mips/libend/etext.s Normal file
View file

@ -0,0 +1,9 @@
.sect .text
.sect .rom
.sect .data
.sect .bss
.define _etext
.sect .text
.align 4
.sect .text
_etext:

View file

@ -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",
}
}

View file

@ -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

View file

@ -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"
}
}