From: David Given Date: Sun, 17 Jun 2018 10:19:22 +0000 (+0200) Subject: Remove the qemuppc plat, as now we have the portable linuxppc simulator we X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=5e6523695aca55475135f40cc9d5ccff66b8e3d5;p=ack.git Remove the qemuppc plat, as now we have the portable linuxppc simulator we don't need it. --- diff --git a/build.lua b/build.lua index a1fe98e80..ca10a085f 100644 --- a/build.lua +++ b/build.lua @@ -12,7 +12,6 @@ vars.plats = { "linuxppc", "osx386", "osxppc", - --"qemuppc", "pc86", "rpi", "pdpv7", @@ -22,7 +21,6 @@ vars.plats_with_tests = { "linux68k", "linux386", "linuxppc", - --"qemuppc", "pc86", } diff --git a/plat/qemuppc/README b/plat/qemuppc/README deleted file mode 100644 index 412e33ad1..000000000 --- a/plat/qemuppc/README +++ /dev/null @@ -1,42 +0,0 @@ -# $Source: /cvsroot/tack/Ack/plat/linux386/README,v $ -# $State: Exp $ -# $Revision: 1.2 $ - - -The linux386 platform -===================== - -linux386 is an i386-based BSP that produces Linux ELF executables. - -This port only implements a very limited number of system calls; basically, -just enough to make the demo apps run. Adding more is easy, but there are some -subtleties that require more thought. The port should be considered only in -proof-of-concept stage right now. - -Important note: you *can't* link access ELF shared libraries from these -executables. In other words, you have to all your work from inside ACK. - -IEEE floating point is available, but requires an FPU. - -The executables are generated with aelfslod and are extremely simple; there's -one rwx ELF section which contains all the application's code and data. This -is not optimal, but it does work. - - -Bugs -==== - -isatty() is a stub and always returns 0. - - -Example command line -==================== - -ack -mlinux386 -O -o linux386.exe examples/paranoia.c - -The file linux386.exe can then be run on a i386 Linux machine (or on an -emulation thereof). - - -David Given -dg@cowlark.com diff --git a/plat/qemuppc/boot.s b/plat/qemuppc/boot.s deleted file mode 100644 index ac3227dc9..000000000 --- a/plat/qemuppc/boot.s +++ /dev/null @@ -1,89 +0,0 @@ -# -! $Source: /cvsroot/tack/Ack/plat/linux386/boot.s,v $ -! $State: Exp $ -! $Revision: 1.3 $ - -! Declare segments (the order is important). - -.sect .text -.sect .rom -.sect .data -.sect .bss - -.sect .text - -begtext: - ! This code is the first thing that runs. The booloader - ! passes the Open Firmware pointer in r5. - ! - ! We keep the bootloader's stack. The ACK expects: - ! - ! sp+8 environment pointer - ! sp+4 argv as a pointer - ! sp argc - - li32 r3, __openfirmware_ptr - stw r5, 0(r3) - - li32 r3, envp - stwu r3, -4(sp) - - li32 r3, argv - stwu r3, -4(sp) - - li32 r3, 1 ! argc - stwu r3, -4(sp) - - bl _openfirmware_init - bl __m_a_i_n - ! falls through - -.define __exit -.define EXIT -__exit: -EXIT: - ! Halt the CPU. This code halts the default G3 emulation of - ! qemu-system-ppc. It's wrong for some other CPU models. -#define hid0 0x3f0 -#define mfmsr(r) [[31<<26]|[[r]<<21]|0x0a6] -#define mtmsr(r) [[31<<26]|[[r]<<21]|0x124] - mfspr r3, hid0 - oris r3, r3, 0x00e0 ! set DOZE, NAP, SLEEP - mtspr hid0, r3 ! in hid0 - .data4 mfmsr(3) - oris r3, r3, 0x0004 ! set POW - .data4 mtmsr(3) ! in msr - b EXIT ! If we failed to halt, then spin. - -.define _openfirmware_call -_openfirmware_call: - lwz r3, 0(sp) - li32 r4, __openfirmware_ptr - lwz r4, 0(r4) - mtspr ctr, r4 - bcctr 20, 0, 0 - -! Define symbols at the beginning of our various segments, so that we can find -! them. (Except .text, which has already been done.) - -.sect .rom; begrom: -.sect .data; begdata: -.sect .bss; begbss: - -! The argv and env arrays. - -.sect .rom -argv: .data4 exename, 0 -envp: .data4 0 -exename: .asciz 'qemuppc.img' - -! Some magic data. All EM systems need these. - -.sect .bss -.define _errno -.comm _errno, 4 ! Posix errno storage - -.define .trppc, .ignmask -.comm .trppc, 4 ! ptr to user trap handler -.comm .ignmask, 4 ! user trap ignore mask -.comm __openfirmware_ptr, 4 ! OpenFirmware entry point diff --git a/plat/qemuppc/build-pkg.lua b/plat/qemuppc/build-pkg.lua deleted file mode 100644 index 0478bbd4d..000000000 --- a/plat/qemuppc/build-pkg.lua +++ /dev/null @@ -1,26 +0,0 @@ -include("plat/build.lua") - -ackfile { - name = "boot", - srcs = { "./boot.s" }, - vars = { plat = "qemuppc" } -} - -build_plat_libs { - name = "libs", - arch = "powerpc", - plat = "qemuppc", -} - -installable { - name = "pkg", - map = { - "+tools", - "+libs", - "./include+pkg", - "util/amisc+aslod-pkg", - ["$(PLATIND)/qemuppc/boot.o"] = "+boot", - ["$(PLATIND)/qemuppc/libsys.a"] = "./libsys+lib", - } -} - diff --git a/plat/qemuppc/build-tools.lua b/plat/qemuppc/build-tools.lua deleted file mode 100644 index e4f3f534b..000000000 --- a/plat/qemuppc/build-tools.lua +++ /dev/null @@ -1,33 +0,0 @@ -include("plat/build.lua") - -build_as { - name = "as", - arch = "powerpc", -} - -build_mcg { - name = "mcg", - arch = "powerpc", -} - -build_ncg { - name = "ncg", - arch = "powerpc", -} - -build_top { - name = "top", - arch = "powerpc", -} - -return installable { - name = "tools", - map = { - ["$(PLATDEP)/qemuppc/as"] = "+as", - ["$(PLATDEP)/qemuppc/ncg"] = "+ncg", - ["$(PLATDEP)/qemuppc/mcg"] = "+mcg", - ["$(PLATDEP)/qemuppc/top"] = "+top", - ["$(PLATIND)/descr/qemuppc"] = "./descr", - "util/opt+pkg", - } -} diff --git a/plat/qemuppc/descr b/plat/qemuppc/descr deleted file mode 100644 index 9d1a80427..000000000 --- a/plat/qemuppc/descr +++ /dev/null @@ -1,87 +0,0 @@ -# plat/linuxppc/descr - -var w=4 -var wa=4 -var p={w} -var pa={w} -var s=2 -var sa={s} -var l={w} -var la={w} -var f={w} -var fa={w} -var d=8 -var da={d} -var x=8 -var xa={x} -var ARCH=powerpc -var PLATFORM=qemuppc -var PLATFORMDIR={EM}/share/ack/{PLATFORM} -var CPP_F=-D__unix -var ALIGN=-a0:4 -a1:4 -a2:4 -a3:4 -b0:0x01000000 -var MACHOPT_F=-m2 -var EGO_PLAT_FLAGS=-M{EM}/share/ack/ego/{ARCH}.descr - -# Override the setting in fe so that files compiled for qemuppc can see -# the platform-specific headers. - -var C_INCLUDES=-I{PLATFORMDIR}/include -I{EM}/share/ack/include/ansi - -name be - from .m.g - to .s - program {EM}/lib/ack/{PLATFORM}/mcg - mapflag -gdb GF=-gdb - args {GF?} < - stdout - need .e -end -name asopt - from .s - to .so - program {EM}/lib/ack/{PLATFORM}/top - args - optimizer - stdin - stdout -end -name as - from .s.so - to .o - program {EM}/lib/ack/{PLATFORM}/as - args - -o > < - prep cond -end -name led - from .o.a - to .out - program {EM}/lib/ack/em_led - mapflag -l* LNAME={PLATFORMDIR}/lib* - mapflag -fp FLOATS={EM}/{LIB}fp - args {ALIGN} {SEPID?} \ - ({RTS}:.b=-u _i_main) \ - (.e:{HEAD}={PLATFORMDIR}/boot.o) \ - ({RTS}:.ocm.bas.b={PLATFORMDIR}/c-ansi.o) \ - ({RTS}:.c={PLATFORMDIR}/c-ansi.o) \ - ({RTS}:.mod={PLATFORMDIR}/modula2.o) \ - ({RTS}:.p={PLATFORMDIR}/pascal.o) \ - -o > < \ - (.p:{TAIL}={PLATFORMDIR}/libpascal.a) \ - (.b:{TAIL}={PLATFORMDIR}/libb.a) \ - (.bas:{TAIL}={PLATFORMDIR}/libbasic.a) \ - (.mod:{TAIL}={PLATFORMDIR}/libmodula2.a) \ - (.ocm:{TAIL}={PLATFORMDIR}/liboccam.a) \ - (.ocm.bas.mod.b.c.p:{TAIL}={PLATFORMDIR}/libc.a) \ - {FLOATS?} \ - (.e:{TAIL}={PLATFORMDIR}/libem.a \ - {PLATFORMDIR}/libsys.a \ - {PLATFORMDIR}/libend.a) - linker -end -name cv - from .out - to .exe - program {EM}/bin/aslod - args < > - outfile qemuppc.img -end diff --git a/plat/qemuppc/include/ack/config.h b/plat/qemuppc/include/ack/config.h deleted file mode 100644 index f58ee3a43..000000000 --- a/plat/qemuppc/include/ack/config.h +++ /dev/null @@ -1,14 +0,0 @@ -/* $Source: /cvsroot/tack/Ack/plat/linux386/include/ack/config.h,v $ - * $State: Exp $ - * $Revision: 1.1 $ - */ - -#ifndef _ACK_CONFIG_H -#define _ACK_CONFIG_H - -/* We're providing a time() system call rather than wanting a wrapper around - * gettimeofday() in the libc. */ - -#define ACKCONF_TIME_IS_A_SYSCALL - -#endif diff --git a/plat/qemuppc/include/build.lua b/plat/qemuppc/include/build.lua deleted file mode 100644 index dc1b0bb43..000000000 --- a/plat/qemuppc/include/build.lua +++ /dev/null @@ -1,24 +0,0 @@ -include("plat/build.lua") - -headermap = {} -packagemap = {} - -local function addheader(h) - headermap[h] = "./"..h - packagemap["$(PLATIND)/qemuppc/include/"..h] = "./"..h -end - -addheader("ack/config.h") -addheader("sys/ioctl.h") -addheader("unistd.h") - -acklibrary { - name = "headers", - hdrs = headermap -} - -installable { - name = "pkg", - map = packagemap -} - diff --git a/plat/qemuppc/include/sys/ioctl.h b/plat/qemuppc/include/sys/ioctl.h deleted file mode 100644 index af41165d7..000000000 --- a/plat/qemuppc/include/sys/ioctl.h +++ /dev/null @@ -1,76 +0,0 @@ -/* $Source: /cvsroot/tack/Ack/plat/linux386/include/sys/ioctl.h,v $ - * $State: Exp $ - * $Revision: 1.1 $ - */ - -#ifndef _SYS_IOCTL_H -#define _SYS_IOCTL_H - -/* These are copied from the ioctl_list(2) man page. */ - -/* */ - -#define FIOSETOWN 0x00008901 -#define SIOCSPGRP 0x00008902 -#define FIOGETOWN 0x00008903 -#define SIOCGPGRP 0x00008904 -#define SIOCATMARK 0x00008905 -#define SIOCGSTAMP 0x00008906 - -/* */ - -#define TCGETS 0x00005401 -#define TCSETS 0x00005402 -#define TCSETSW 0x00005403 -#define TCSETSF 0x00005404 -#define TCGETA 0x00005405 -#define TCSETA 0x00005406 -#define TCSETAW 0x00005407 -#define TCSETAF 0x00005408 -#define TCSBRK 0x00005409 -#define TCXONC 0x0000540A -#define TCFLSH 0x0000540B -#define TIOCEXCL 0x0000540C -#define TIOCNXCL 0x0000540D -#define TIOCSCTTY 0x0000540E -#define TIOCGPGRP 0x0000540F -#define TIOCSPGRP 0x00005410 -#define TIOCOUTQ 0x00005411 -#define TIOCSTI 0x00005412 -#define TIOCGWINSZ 0x00005413 -#define TIOCSWINSZ 0x00005414 -#define TIOCMGET 0x00005415 -#define TIOCMBIS 0x00005416 -#define TIOCMBIC 0x00005417 -#define TIOCMSET 0x00005418 -#define TIOCGSOFTCAR 0x00005419 -#define TIOCSSOFTCAR 0x0000541A -#define FIONREAD 0x0000541B -#define TIOCINQ 0x0000541B -#define TIOCLINUX 0x0000541C -#define TIOCCONS 0x0000541D -#define TIOCGSERIAL 0x0000541E -#define TIOCSSERIAL 0x0000541F -#define TIOCPKT 0x00005420 -#define FIONBIO 0x00005421 -#define TIOCNOTTY 0x00005422 -#define TIOCSETD 0x00005423 -#define TIOCGETD 0x00005424 -#define TCSBRKP 0x00005425 -#define TIOCTTYGSTRUCT 0x00005426 -#define FIONCLEX 0x00005450 -#define FIOCLEX 0x00005451 -#define FIOASYNC 0x00005452 -#define TIOCSERCONFIG 0x00005453 -#define TIOCSERGWILD 0x00005454 -#define TIOCSERSWILD 0x00005455 -#define TIOCGLCKTRMIOS 0x00005456 -#define TIOCSLCKTRMIOS 0x00005457 -#define TIOCSERGSTRUCT 0x00005458 -#define TIOCSERGETLSR 0x00005459 -#define TIOCSERGETMULTI 0x0000545A -#define TIOCSERSETMULTI 0x0000545B - - - -#endif diff --git a/plat/qemuppc/include/unistd.h b/plat/qemuppc/include/unistd.h deleted file mode 100644 index 307192f77..000000000 --- a/plat/qemuppc/include/unistd.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * unistd.h - standard system calls - */ -/* $Id$ */ - -#ifndef _UNISTD_H -#define _UNISTD_H - -#include -#include - -/* Types */ - -typedef int pid_t; -typedef int mode_t; - -typedef long suseconds_t; - -/* Time handling. */ - -struct timeval -{ - time_t tv_sec; - suseconds_t tv_usec; -}; - -struct timezone -{ - int tz_minuteswest; - int tz_dsttime; -}; /* obsolete, unused */ - -extern int gettimeofday(struct timeval* tv, struct timezone* tz); -extern int settimeofday(const struct timeval* tv, const struct timezone* tz); - -/* File access. */ - -enum -{ - O_ACCMODE = 0x3, - - O_RDONLY = 0, - O_WRONLY = 1, - O_RDWR = 2, - - O_CREAT = 0x10, - O_TRUNC = 0x20, - O_APPEND = 0x40 -}; - -extern int open(const char* path, int access, ...); -extern int creat(const char* path, mode_t mode); -extern int close(int d); -extern int read(int fd, void* buffer, size_t count); -extern int write(int fd, void* buffer, size_t count); -extern off_t lseek(int fildes, off_t offset, int whence); -extern int fcntl(int fd, int op, ...); - -/* Special variables */ - -extern char** environ; - -/* Implemented system calls */ - -extern void _exit(int); -extern pid_t getpid(void); -extern int brk(void* ptr); -extern void* sbrk(int increment); -extern int isatty(int d); - -/* Signal handling */ - -typedef int sig_atomic_t; - -#define SIG_ERR ((sighandler_t) -1) /* Error return. */ -#define SIG_DFL ((sighandler_t) 0) /* Default action. */ -#define SIG_IGN ((sighandler_t) 1) /* Ignore signal. */ - -#define SIGHUP 1 /* Hangup (POSIX). */ -#define SIGINT 2 /* Interrupt (ANSI). */ -#define SIGQUIT 3 /* Quit (POSIX). */ -#define SIGILL 4 /* Illegal instruction (ANSI). */ -#define SIGTRAP 5 /* Trace trap (POSIX). */ -#define SIGABRT 6 /* Abort (ANSI). */ -#define SIGIOT 6 /* IOT trap (4.2 BSD). */ -#define SIGBUS 7 /* BUS error (4.2 BSD). */ -#define SIGFPE 8 /* Floating-point exception (ANSI). */ -#define SIGKILL 9 /* Kill, unblockable (POSIX). */ -#define SIGUSR1 10 /* User-defined signal 1 (POSIX). */ -#define SIGSEGV 11 /* Segmentation violation (ANSI). */ -#define SIGUSR2 12 /* User-defined signal 2 (POSIX). */ -#define SIGPIPE 13 /* Broken pipe (POSIX). */ -#define SIGALRM 14 /* Alarm clock (POSIX). */ -#define SIGTERM 15 /* Termination (ANSI). */ -#define SIGSTKFLT 16 /* Stack fault. */ -#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */ -#define SIGCHLD 17 /* Child status has changed (POSIX). */ -#define SIGCONT 18 /* Continue (POSIX). */ -#define SIGSTOP 19 /* Stop, unblockable (POSIX). */ -#define SIGTSTP 20 /* Keyboard stop (POSIX). */ -#define SIGTTIN 21 /* Background read from tty (POSIX). */ -#define SIGTTOU 22 /* Background write to tty (POSIX). */ -#define SIGURG 23 /* Urgent condition on socket (4.2 BSD). */ -#define SIGXCPU 24 /* CPU limit exceeded (4.2 BSD). */ -#define SIGXFSZ 25 /* File size limit exceeded (4.2 BSD). */ -#define SIGVTALRM 26 /* Virtual alarm clock (4.2 BSD). */ -#define SIGPROF 27 /* Profiling alarm clock (4.2 BSD). */ -#define SIGWINCH 28 /* Window size change (4.3 BSD, Sun). */ -#define SIGPOLL SIGIO /* Pollable event occurred (System V). */ -#define SIGIO 29 /* I/O now possible (4.2 BSD). */ -#define SIGPWR 30 /* Power failure restart (System V). */ -#define SIGSYS 31 /* Bad system call. */ -#define SIGUNUSED 31 - -#define _NSIG 32 /* Biggest signal number + 1 - (not including real-time signals). */ -typedef void (*sighandler_t)(int); -extern sighandler_t signal(int signum, sighandler_t handler); -extern int raise(int signum); - - - -#endif diff --git a/plat/qemuppc/libsys/_hol0.s b/plat/qemuppc/libsys/_hol0.s deleted file mode 100644 index d3d16db72..000000000 --- a/plat/qemuppc/libsys/_hol0.s +++ /dev/null @@ -1,21 +0,0 @@ -# -! $Source: /cvsroot/tack/Ack/plat/linux386/libsys/_hol0.s,v $ -! $State: Exp $ -! $Revision: 1.1 $ - -! Declare segments (the order is important). - -.sect .text -.sect .rom -.sect .data -.sect .bss - -! This data block is used to store information about the current line number -! and file. - -.define hol0 -.define .hol0 -.sect .bss -hol0: -.hol0: - .space 8 diff --git a/plat/qemuppc/libsys/brk.c b/plat/qemuppc/libsys/brk.c deleted file mode 100644 index 7d49fa960..000000000 --- a/plat/qemuppc/libsys/brk.c +++ /dev/null @@ -1,59 +0,0 @@ -/* $Source$ - * $State$ - * $Revision$ - */ - -#include -#include -#include - -#define OUT_OF_MEMORY (void*)(-1) /* sbrk returns this on failure */ -#define STACK_BUFFER 128 /* number of bytes to leave for stack */ - -extern char _end[1]; -static char* current = _end; - -int brk(void* newend) -{ - /* This variable is used to figure out the current stack pointer, - * by taking its address. */ - char dummy; - char* p = newend; - - if ((p > (&dummy - STACK_BUFFER)) || - (p < _end)) - { - errno = ENOMEM; - return -1; - } - - current = p; - return 0; -} - -void* sbrk(int increment) -{ - char* old; - char* new; - - if (increment == 0) - return current; - - old = current; - - new = old + increment; - - if ((increment > 0) && (new <= old)) - goto out_of_memory; - else if ((increment < 0) && (new >= old)) - goto out_of_memory; - - if (brk(new) < 0) - goto out_of_memory; - - return old; - -out_of_memory: - errno = ENOMEM; - return OUT_OF_MEMORY; -} diff --git a/plat/qemuppc/libsys/build.lua b/plat/qemuppc/libsys/build.lua deleted file mode 100644 index 7281bbc61..000000000 --- a/plat/qemuppc/libsys/build.lua +++ /dev/null @@ -1,16 +0,0 @@ -acklibrary { - name = "lib", - srcs = { - "./*.s", - "./*.c", - }, - deps = { - "lang/cem/libcc.ansi/headers+headers", - "plat/qemuppc/include+headers", - "mach/powerpc/libem+headers_qemuppc", - }, - vars = { - plat = "qemuppc" - } -} - \ No newline at end of file diff --git a/plat/qemuppc/libsys/close.c b/plat/qemuppc/libsys/close.c deleted file mode 100644 index 1c570029b..000000000 --- a/plat/qemuppc/libsys/close.c +++ /dev/null @@ -1,14 +0,0 @@ -/* $Source$ - * $State$ - * $Revision$ - */ - -#include -#include -#include - -int close(int fd) -{ - errno = EBADF; - return -1; -} diff --git a/plat/qemuppc/libsys/creat.c b/plat/qemuppc/libsys/creat.c deleted file mode 100644 index 34ace747c..000000000 --- a/plat/qemuppc/libsys/creat.c +++ /dev/null @@ -1,15 +0,0 @@ -/* $Source$ - * $State$ - * $Revision$ - */ - -#include -#include -#include -#include "libsys.h" - -int open(const char* path, int access, ...) -{ - errno = EACCES; - return -1; -} diff --git a/plat/qemuppc/libsys/getpid.c b/plat/qemuppc/libsys/getpid.c deleted file mode 100644 index 5e6eb003e..000000000 --- a/plat/qemuppc/libsys/getpid.c +++ /dev/null @@ -1,13 +0,0 @@ -/* $Source$ - * $State$ - * $Revision$ - */ - -#include -#include -#include - -pid_t getpid(void) -{ - return 0; -} diff --git a/plat/qemuppc/libsys/isatty.c b/plat/qemuppc/libsys/isatty.c deleted file mode 100644 index 8bee360e0..000000000 --- a/plat/qemuppc/libsys/isatty.c +++ /dev/null @@ -1,8 +0,0 @@ -#include -#include -#include - -int isatty(int fd) -{ - return 1; -} diff --git a/plat/qemuppc/libsys/kill.c b/plat/qemuppc/libsys/kill.c deleted file mode 100644 index 4a179c47c..000000000 --- a/plat/qemuppc/libsys/kill.c +++ /dev/null @@ -1,14 +0,0 @@ -/* $Source$ - * $State$ - * $Revision$ - */ - -#include -#include -#include - -int kill(pid_t pid, int sig) -{ - errno = EINVAL; - return -1; -} diff --git a/plat/qemuppc/libsys/libsys.h b/plat/qemuppc/libsys/libsys.h deleted file mode 100644 index cf9878b87..000000000 --- a/plat/qemuppc/libsys/libsys.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef LIBSYS_H -#define LIBSYS_H - -extern uint32_t openfirmware_call(void* array); - -extern void _sys_rawwrite(unsigned char b); -extern unsigned char _sys_rawread(void); - -extern void _sys_write_tty(char c); - -/* extern int _sys_ttyflags; */ - -#endif diff --git a/plat/qemuppc/libsys/lseek.c b/plat/qemuppc/libsys/lseek.c deleted file mode 100644 index ecbc4b520..000000000 --- a/plat/qemuppc/libsys/lseek.c +++ /dev/null @@ -1,14 +0,0 @@ -/* $Source$ - * $State$ - * $Revision$ - */ - -#include -#include -#include - -off_t lseek(int fd, off_t offset, int whence) -{ - errno = EINVAL; - return -1; -} diff --git a/plat/qemuppc/libsys/open.c b/plat/qemuppc/libsys/open.c deleted file mode 100644 index 8f18317c5..000000000 --- a/plat/qemuppc/libsys/open.c +++ /dev/null @@ -1,14 +0,0 @@ -/* $Source$ - * $State$ - * $Revision$ - */ - -#include -#include -#include -#include "libsys.h" - -int creat(const char* path, int mode) -{ - return open(path, O_CREAT|O_WRONLY|O_TRUNC, mode); -} diff --git a/plat/qemuppc/libsys/openfirmware.c b/plat/qemuppc/libsys/openfirmware.c deleted file mode 100644 index ad0c282ee..000000000 --- a/plat/qemuppc/libsys/openfirmware.c +++ /dev/null @@ -1,80 +0,0 @@ -#include -#include -#include -#include "libsys.h" - -static void* stdout_handle; - -static void* of_finddevice(const char* name) -{ - struct - { - const char* method; - int ins, outs; - const char* name; - void* phandle; - } args; - - args.method = "finddevice"; - args.ins = 1; - args.outs = 1; - args.name = name; - openfirmware_call(&args); - return args.phandle; -} - -static int of_getprop(void* phandle, const char* name, void* dest, int destlen) -{ - struct - { - const char* method; - int ins, outs; - void* phandle; - const char* name; - void* dest; - int destlen; - int flag; - } args; - - args.method = "getprop"; - args.ins = 4; - args.outs = 1; - args.phandle = phandle; - args.name = name; - args.dest = dest; - args.destlen = destlen; - openfirmware_call(&args); - return args.flag; -} - -void openfirmware_init(void) -{ - void* chosen = of_finddevice("/chosen"); - of_getprop(chosen, "stdout", &stdout_handle, sizeof(stdout_handle)); -} - -unsigned char _sys_rawread(void) -{ - return 0; -} - -void _sys_rawwrite(unsigned char c) -{ - struct - { - const char* method; - int ins, outs; - void* ihandle; - void* address; - int len; - int actual; - } args; - - args.method = "write"; - args.ins = 3; - args.outs = 1; - args.ihandle = stdout_handle; - args.address = &c; - args.len = 1; - openfirmware_call(&args); -} diff --git a/plat/qemuppc/libsys/read.c b/plat/qemuppc/libsys/read.c deleted file mode 100644 index 21fe90ebb..000000000 --- a/plat/qemuppc/libsys/read.c +++ /dev/null @@ -1,38 +0,0 @@ -#include -#include -#include -#include "libsys.h" - -int read(int fd, void* buffer, size_t count) -{ - char i; - - /* We're only allowed to read from fd 0, 1 or 2. */ - - if ((fd < 0) || (fd > 2)) - { - errno = EBADF; - return -1; - } - - /* Empty buffer? */ - - if (count == 0) - return 0; - - /* Read one byte. */ - - i = _sys_rawread(); -#if 0 - if ((i == '\r') && !(_sys_ttyflags & RAW)) - i = '\n'; - if (_sys_ttyflags & ECHO) - _sys_write_tty(i); -#endif - if (i == '\r') - i = '\n'; - _sys_write_tty(i); - - *(char*)buffer = i; - return 1; -} diff --git a/plat/qemuppc/libsys/signal.c b/plat/qemuppc/libsys/signal.c deleted file mode 100644 index a87b9ced2..000000000 --- a/plat/qemuppc/libsys/signal.c +++ /dev/null @@ -1,15 +0,0 @@ -/* $Source$ - * $State$ - * $Revision$ - */ - -#include -#include -#include -#include -#include "libsys.h" - -sighandler_t signal(int signum, sighandler_t handler) -{ - return SIG_DFL; -} diff --git a/plat/qemuppc/libsys/time.c b/plat/qemuppc/libsys/time.c deleted file mode 100644 index 5ef17b841..000000000 --- a/plat/qemuppc/libsys/time.c +++ /dev/null @@ -1,17 +0,0 @@ -/* $Source$ - * $State$ - * $Revision$ - */ - -#include -#include -#include -#include -#include "libsys.h" - -time_t time(time_t* t) -{ - if (t) - *t = 0; - return 0; -} diff --git a/plat/qemuppc/libsys/write.c b/plat/qemuppc/libsys/write.c deleted file mode 100644 index 8d2dd0d74..000000000 --- a/plat/qemuppc/libsys/write.c +++ /dev/null @@ -1,48 +0,0 @@ -/* $Source$ - * $State$ - * $Revision$ - */ - -#include -#include -#include -#include "libsys.h" - -void _sys_write_tty(char c) -{ - _sys_rawwrite(c); -#if 0 - if ((c == '\n') && !(_sys_ttyflags & RAW)) - _sys_rawwrite('\r'); -#endif - if (c == '\n') - _sys_rawwrite('\r'); -} - -int write(int fd, void* buffer, size_t count) -{ - int i; - char* p = buffer; - - /* We're only allowed to write to fd 0, 1 or 2. */ - - if ((fd < 0) || (fd > 2)) - { - errno = EBADF; - return -1; - } - - /* Write all data. */ - - i = 0; - while (i < count) - { - _sys_write_tty(*p++); - - i++; - } - - /* No failures. */ - - return count; -} diff --git a/plat/qemuppc/tests/build.lua b/plat/qemuppc/tests/build.lua deleted file mode 100644 index 6581d93ef..000000000 --- a/plat/qemuppc/tests/build.lua +++ /dev/null @@ -1,7 +0,0 @@ -include("tests/plat/build.lua") - -plat_testsuite { - name = "tests", - plat = "qemuppc", - method = "qemu-system-ppc" -}