Re-introduced the i686 architecture
This commit is contained in:
parent
7bf3ab327f
commit
4859f66288
4
Makefile
4
Makefile
@ -52,6 +52,7 @@ dist:
|
||||
$(PACKAGE)-$(VERSION)/src/arch/i386.c \
|
||||
$(PACKAGE)-$(VERSION)/src/arch/i386_real.c \
|
||||
$(PACKAGE)-$(VERSION)/src/arch/i486.c \
|
||||
$(PACKAGE)-$(VERSION)/src/arch/i686.c \
|
||||
$(PACKAGE)-$(VERSION)/src/arch/sparc.c \
|
||||
$(PACKAGE)-$(VERSION)/src/arch/Makefile \
|
||||
$(PACKAGE)-$(VERSION)/src/arch/common.ins \
|
||||
@ -59,6 +60,8 @@ dist:
|
||||
$(PACKAGE)-$(VERSION)/src/arch/i386.ins \
|
||||
$(PACKAGE)-$(VERSION)/src/arch/i386.reg \
|
||||
$(PACKAGE)-$(VERSION)/src/arch/i486.ins \
|
||||
$(PACKAGE)-$(VERSION)/src/arch/i686.ins \
|
||||
$(PACKAGE)-$(VERSION)/src/arch/i686.reg \
|
||||
$(PACKAGE)-$(VERSION)/src/arch/null.ins \
|
||||
$(PACKAGE)-$(VERSION)/src/arch/sparc.ins \
|
||||
$(PACKAGE)-$(VERSION)/src/arch/sparc.reg \
|
||||
@ -73,6 +76,7 @@ dist:
|
||||
$(PACKAGE)-$(VERSION)/test/i386.S \
|
||||
$(PACKAGE)-$(VERSION)/test/i386_real.S \
|
||||
$(PACKAGE)-$(VERSION)/test/i486.S \
|
||||
$(PACKAGE)-$(VERSION)/test/i686.S \
|
||||
$(PACKAGE)-$(VERSION)/test/sparc.S \
|
||||
$(PACKAGE)-$(VERSION)/test/Makefile \
|
||||
$(PACKAGE)-$(VERSION)/test/project.conf \
|
||||
|
@ -1,4 +1,4 @@
|
||||
TARGETS = i386.so i386_real.so i486.so sparc.so
|
||||
TARGETS = i386.so i386_real.so i486.so i686.so sparc.so
|
||||
PREFIX = /usr/local
|
||||
DESTDIR =
|
||||
LIBDIR = $(PREFIX)/lib
|
||||
@ -39,6 +39,13 @@ i486_LDFLAGS = $(LDFLAGSF) $(LDFLAGS)
|
||||
i486.so: $(i486_OBJS)
|
||||
$(LD) -o i486.so $(i486_OBJS) $(i486_LDFLAGS)
|
||||
|
||||
i686_OBJS = i686.o
|
||||
i686_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS)
|
||||
i686_LDFLAGS = $(LDFLAGSF) $(LDFLAGS)
|
||||
|
||||
i686.so: $(i686_OBJS)
|
||||
$(LD) -o i686.so $(i686_OBJS) $(i686_LDFLAGS)
|
||||
|
||||
sparc_OBJS = sparc.o
|
||||
sparc_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS)
|
||||
sparc_LDFLAGS = $(LDFLAGSF) $(LDFLAGS)
|
||||
@ -55,11 +62,14 @@ i386_real.o: i386_real.c common.ins null.ins i386.h i386.ins i386.reg
|
||||
i486.o: i486.c common.ins null.ins i386.h i386.ins i386.reg i486.ins
|
||||
$(CC) $(i486_CFLAGS) -c i486.c
|
||||
|
||||
i686.o: i686.c common.ins null.ins i386.h i386.ins i386.reg i486.ins i686.reg
|
||||
$(CC) $(i686_CFLAGS) -c i686.c
|
||||
|
||||
sparc.o: sparc.c common.ins null.ins sparc.ins sparc.reg
|
||||
$(CC) $(sparc_CFLAGS) -c sparc.c
|
||||
|
||||
clean:
|
||||
$(RM) -- $(i386_OBJS) $(i386_real_OBJS) $(i486_OBJS) $(sparc_OBJS)
|
||||
$(RM) -- $(i386_OBJS) $(i386_real_OBJS) $(i486_OBJS) $(i686_OBJS) $(sparc_OBJS)
|
||||
|
||||
distclean: clean
|
||||
$(RM) -- $(TARGETS)
|
||||
@ -72,12 +82,15 @@ install: $(TARGETS)
|
||||
$(MKDIR) $(DESTDIR)$(LIBDIR)/asm/arch
|
||||
$(INSTALL) -m 0644 -- i486.so $(DESTDIR)$(LIBDIR)/asm/arch/i486.so
|
||||
$(MKDIR) $(DESTDIR)$(LIBDIR)/asm/arch
|
||||
$(INSTALL) -m 0644 -- i686.so $(DESTDIR)$(LIBDIR)/asm/arch/i686.so
|
||||
$(MKDIR) $(DESTDIR)$(LIBDIR)/asm/arch
|
||||
$(INSTALL) -m 0644 -- sparc.so $(DESTDIR)$(LIBDIR)/asm/arch/sparc.so
|
||||
|
||||
uninstall:
|
||||
$(RM) -- $(DESTDIR)$(LIBDIR)/asm/arch/i386.so
|
||||
$(RM) -- $(DESTDIR)$(LIBDIR)/asm/arch/i386_real.so
|
||||
$(RM) -- $(DESTDIR)$(LIBDIR)/asm/arch/i486.so
|
||||
$(RM) -- $(DESTDIR)$(LIBDIR)/asm/arch/i686.so
|
||||
$(RM) -- $(DESTDIR)$(LIBDIR)/asm/arch/sparc.so
|
||||
|
||||
.PHONY: all clean distclean install uninstall
|
||||
|
@ -1,3 +1,4 @@
|
||||
/* $Id$ */
|
||||
REG(al, 8, 0x00)
|
||||
REG(cl, 8, 0x01)
|
||||
REG(dl, 8, 0x02)
|
||||
|
82
src/arch/i686.c
Normal file
82
src/arch/i686.c
Normal file
@ -0,0 +1,82 @@
|
||||
/* $Id$ */
|
||||
/* Copyright (c) 2011 Pierre Pronchery <khorben@defora.org> */
|
||||
/* This file is part of DeforaOS Devel asm */
|
||||
/* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
|
||||
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
#include "Asm.h"
|
||||
|
||||
|
||||
/* i686 */
|
||||
/* private */
|
||||
/* types */
|
||||
/* register sizes */
|
||||
#define REG(name, size, id) REG_ ## name ## _size = size,
|
||||
enum
|
||||
{
|
||||
#include "i386.reg"
|
||||
REG_size_count
|
||||
};
|
||||
#undef REG
|
||||
|
||||
/* register ids */
|
||||
#define REG(name, size, id) REG_ ## name ## _id = id,
|
||||
enum
|
||||
{
|
||||
#include "i386.reg"
|
||||
#include "i686.reg"
|
||||
REG_id_count
|
||||
};
|
||||
#undef REG
|
||||
|
||||
|
||||
/* variables */
|
||||
#define REG(name, size, id) { "" # name, size, id },
|
||||
static ArchRegister _i686_registers[] =
|
||||
{
|
||||
#include "i386.reg"
|
||||
#include "i686.reg"
|
||||
{ NULL, 0, 0 }
|
||||
};
|
||||
#undef REG
|
||||
|
||||
static ArchInstruction _i686_instructions[] =
|
||||
{
|
||||
#include "i386.ins"
|
||||
#include "i486.ins"
|
||||
#include "i686.ins"
|
||||
#include "common.ins"
|
||||
#include "null.ins"
|
||||
};
|
||||
|
||||
|
||||
/* functions */
|
||||
#include "i386.h"
|
||||
|
||||
|
||||
/* public */
|
||||
/* variables */
|
||||
/* plug-in */
|
||||
ArchPlugin arch_plugin =
|
||||
{
|
||||
NULL,
|
||||
"i686",
|
||||
NULL,
|
||||
_i686_registers,
|
||||
_i686_instructions,
|
||||
_i386_write,
|
||||
NULL
|
||||
};
|
20
src/arch/i686.ins
Normal file
20
src/arch/i686.ins
Normal file
@ -0,0 +1,20 @@
|
||||
/* $Id$ */
|
||||
/* Copyright (c) 2011 Pierre Pronchery <khorben@defora.org> */
|
||||
/* This file is part of DeforaOS Devel asm */
|
||||
/* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, version 3 of the License.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
|
||||
|
||||
/* instructions */
|
||||
/* EMMS 0x0f77 2 */
|
||||
{ "emms", 0x0f77, OP2F, AOT_NONE, AOT_NONE, AOT_NONE },
|
9
src/arch/i686.reg
Normal file
9
src/arch/i686.reg
Normal file
@ -0,0 +1,9 @@
|
||||
/* $Id$ */
|
||||
REG(mm0, 64, 0x08)
|
||||
REG(mm1, 64, 0x09)
|
||||
REG(mm2, 64, 0x0a)
|
||||
REG(mm3, 64, 0x0b)
|
||||
REG(mm4, 64, 0x0c)
|
||||
REG(mm5, 64, 0x0d)
|
||||
REG(mm6, 64, 0x0e)
|
||||
REG(mm7, 64, 0x0f)
|
@ -1,8 +1,8 @@
|
||||
targets=i386,i386_real,i486,sparc
|
||||
targets=i386,i386_real,i486,i686,sparc
|
||||
cppflags_force=-I ../../include
|
||||
cflags_force=-W
|
||||
cflags=-Wall -fPIC -pedantic
|
||||
dist=Makefile,common.ins,i386.h,i386.ins,i386.reg,i486.ins,null.ins,sparc.ins,sparc.reg
|
||||
dist=Makefile,common.ins,i386.h,i386.ins,i386.reg,i486.ins,i686.ins,i686.reg,null.ins,sparc.ins,sparc.reg
|
||||
|
||||
[i386]
|
||||
type=plugin
|
||||
@ -28,6 +28,14 @@ install=$(LIBDIR)/asm/arch
|
||||
[i486.c]
|
||||
depends=common.ins,null.ins,i386.h,i386.ins,i386.reg,i486.ins
|
||||
|
||||
[i686]
|
||||
type=plugin
|
||||
sources=i686.c
|
||||
install=$(LIBDIR)/asm/arch
|
||||
|
||||
[i686.c]
|
||||
depends=common.ins,null.ins,i386.h,i386.ins,i386.reg,i486.ins,i686.reg
|
||||
|
||||
[sparc]
|
||||
type=plugin
|
||||
sources=sparc.c
|
||||
|
@ -1,4 +1,4 @@
|
||||
TARGETS = i386.o i386_real.o i486.o sparc.o
|
||||
TARGETS = i386.o i386_real.o i486.o i686.o sparc.o
|
||||
PREFIX = /usr/local
|
||||
DESTDIR =
|
||||
BINDIR = $(PREFIX)/bin
|
||||
@ -21,6 +21,9 @@ i386_real.o_ASFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(ASFLAGS) -a i386_real -f flat
|
||||
i486.o_OBJS = i486.o
|
||||
i486.o_ASFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(ASFLAGS) -a i486 -f flat
|
||||
|
||||
i686.o_OBJS = i686.o
|
||||
i686.o_ASFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(ASFLAGS) -a i686 -f flat
|
||||
|
||||
sparc.o_OBJS = sparc.o
|
||||
sparc.o_ASFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(ASFLAGS) -a sparc -f flat
|
||||
|
||||
@ -33,11 +36,14 @@ i386_real.o: i386_real.S ../src/asm
|
||||
i486.o: i486.S ../src/asm
|
||||
$(AS) $(i486.o_ASFLAGS) -o i486.o i486.S
|
||||
|
||||
i686.o: i686.S ../src/asm
|
||||
$(AS) $(i686.o_ASFLAGS) -o i686.o i686.S
|
||||
|
||||
sparc.o: sparc.S ../src/asm
|
||||
$(AS) $(sparc.o_ASFLAGS) -o sparc.o sparc.S
|
||||
|
||||
clean:
|
||||
$(RM) -- $(i386.o_OBJS) $(i386_real.o_OBJS) $(i486.o_OBJS) $(sparc.o_OBJS)
|
||||
$(RM) -- $(i386.o_OBJS) $(i386_real.o_OBJS) $(i486.o_OBJS) $(i686.o_OBJS) $(sparc.o_OBJS)
|
||||
|
||||
distclean: clean
|
||||
$(RM) -- $(TARGETS)
|
||||
|
@ -1,4 +1,4 @@
|
||||
targets=i386.o,i386_real.o,i486.o,sparc.o
|
||||
targets=i386.o,i386_real.o,i486.o,i686.o,sparc.o
|
||||
as=../src/asm
|
||||
dist=Makefile
|
||||
|
||||
@ -26,6 +26,14 @@ sources=i486.S
|
||||
asflags=-a i486 -f flat
|
||||
depends=../src/asm
|
||||
|
||||
[i686.o]
|
||||
type=object
|
||||
sources=i686.S
|
||||
|
||||
[i686.S]
|
||||
asflags=-a i686 -f flat
|
||||
depends=../src/asm
|
||||
|
||||
[sparc.o]
|
||||
type=object
|
||||
sources=sparc.S
|
||||
|
Loading…
Reference in New Issue
Block a user