ref: f135e0f1a43183e0c25e9ed8dbbe294474c0fc2a
parent: c1a905d165f282f4f486f13ef58a1d2bad11a549
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Wed Sep 18 02:36:28 EDT 2019
[as] Add powerpc64 skeleton
--- a/src/cmd/as/Makefile
+++ b/src/cmd/as/Makefile
@@ -5,13 +5,15 @@
MORECFLAGS = -I$(INCDIR)/$(STD)
-OBJS = main.o \
- symbol.o \
- ins.o \
- parser.o \
- expr.o \
+OBJS = \
+ main.o\
+ symbol.o\
+ ins.o\
+ parser.o\
+ expr.o\
TARGET =\
+ $(LIBEXEC)/as-powerpc64\
$(LIBEXEC)/as-powerpc\
$(LIBEXEC)/as-amd64\
$(LIBEXEC)/as-i386\
@@ -27,6 +29,7 @@
clean:
rm -f target/*/*.o target/*/*tbl.c
+include target/powerpc64.mk
include target/powerpc.mk
include target/amd64.mk
include target/i386.mk
--- a/src/cmd/as/deps.mk
+++ b/src/cmd/as/deps.mk
@@ -16,6 +16,12 @@
./target/powerpc/powerpc.o: $(INCDIR)/scc/scc/scc.h
./target/powerpc/powerpc.o: ./target/powerpc/../../as.h
./target/powerpc/powerpc.o: ./target/powerpc/proc.h
+./target/powerpc/powerpc64.o: $(INCDIR)/scc/scc/scc.h
+./target/powerpc/powerpc64.o: ./target/powerpc/../../as.h
+./target/powerpc/powerpc64.o: ./target/powerpc/proc.h
+./target/powerpc/powerpc64tbl.o: $(INCDIR)/scc/scc/scc.h
+./target/powerpc/powerpc64tbl.o: ./target/powerpc/../../as.h
+./target/powerpc/powerpc64tbl.o: ./target/powerpc/../powerpc/proc.h
./target/powerpc/powerpctbl.o: $(INCDIR)/scc/scc/scc.h
./target/powerpc/powerpctbl.o: ./target/powerpc/../../as.h
./target/powerpc/powerpctbl.o: ./target/powerpc/../powerpc/proc.h
--- a/src/cmd/as/target/powerpc.mk
+++ b/src/cmd/as/target/powerpc.mk
@@ -1,9 +1,11 @@
-POWERPC_OBJ = $(OBJS) \
- target/powerpc/powerpctbl.o \
- target/powerpc/powerpc.o \
- target/powerpc/ins.o \
+POWERPC = target/powerpc
+POWERPC_OBJ =\
+ $(OBJS)\
+ $(POWERPC)/powerpctbl.o\
+ $(POWERPC)/powerpc.o\
+ $(POWERPC)/ins.o\
-target/powerpc/powerpctbl.c: target/powerpc/powerpc.dat target/powerpc/rules.dat
+$(POWERPC)/powerpctbl.c: $(POWERPC)/powerpc.dat $(POWERPC)/rules.dat
./mktbl -f powerpc -c powerpc
$(LIBEXEC)/as-powerpc: $(POWERPC_OBJ)
--- /dev/null
+++ b/src/cmd/as/target/powerpc/.gitignore
@@ -1,0 +1,2 @@
+powerpc64tbl.c
+powerpctbl.c
--- /dev/null
+++ b/src/cmd/as/target/powerpc/powerpc64.c
@@ -1,0 +1,15 @@
+#include <stdlib.h>
+
+#include <scc/scc.h>
+
+#include "../../as.h"
+
+TUINT maxaddr = 0xFFFF;
+int endian = LITTLE_ENDIAN;
+int left2right = 0;
+#include "proc.h"
+
+void
+iarch(void)
+{
+}
--- /dev/null
+++ b/src/cmd/as/target/powerpc64.mk
@@ -1,0 +1,12 @@
+POWERPC = target/powerpc
+POWERPC64_OBJ =\
+ $(OBJS)\
+ $(POWERPC)/powerpc64tbl.o\
+ $(POWERPC)/powerpc64.o\
+ $(POWERPC)/ins.o\
+
+$(POWERPC)/powerpc64tbl.c: $(POWERPC)/powerpc.dat $(POWERPC)/rules.dat
+ ./mktbl -f powerpc -c powerpc64
+
+$(LIBEXEC)/as-powerpc64: $(POWERPC64_OBJ)
+ $(CC) $(SCC_LDFLAGS) $(POWERPC64_OBJ) -lscc -o $@