Changes to support FreeBSD (patch submitted by Doug Rabson)
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
* macros for creating assembler offset files
|
||||
*----------------------------------------------------------------------*/
|
||||
|
||||
#ifndef __linux__
|
||||
#if !defined(__linux__) && !defined(__FreeBSD__)
|
||||
#define NEWLINE printf("\n")
|
||||
#define COMMENT printf(";----------------------------------------------------------------------\n")
|
||||
|
||||
|
||||
@@ -19,6 +19,9 @@
|
||||
**
|
||||
** $Header$
|
||||
** $Log$
|
||||
** Revision 1.1.1.1 1999/11/24 21:44:56 joseph
|
||||
** Initial checkin for SourceForge
|
||||
**
|
||||
**
|
||||
** 7 4/24/99 11:17a Atai
|
||||
** check if we have valid gc and lostcontext pointer
|
||||
@@ -282,7 +285,7 @@ GR_ENTRY(grDrawTriangle, void, (const void *a, const void *b, const void *c))
|
||||
}
|
||||
lostContext: ; /* <-- my, that's odd, but MSVC was insistent */
|
||||
}
|
||||
#elif defined( __linux__ )
|
||||
#elif defined( __linux__ ) || defined(__FreeBSD__)
|
||||
{
|
||||
GR_BEGIN_NOFIFOCHECK("grDrawTriangle",92);
|
||||
TRISETUP(a, b, c);
|
||||
|
||||
@@ -20,6 +20,9 @@
|
||||
**
|
||||
** $Header$
|
||||
** $Log$
|
||||
** Revision 1.1.1.1 1999/11/24 21:44:56 joseph
|
||||
** Initial checkin for SourceForge
|
||||
**
|
||||
**
|
||||
** 4 4/06/99 3:54p Dow
|
||||
** Alt tab again.
|
||||
@@ -234,7 +237,7 @@ int _guHeapCheck( void )
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef __linux__
|
||||
#if !defined(__linux__) && !defined(__FreeBSD__)
|
||||
void
|
||||
i3(void)
|
||||
{
|
||||
|
||||
@@ -19,6 +19,9 @@
|
||||
**
|
||||
** $Header$
|
||||
** $Log$
|
||||
** Revision 1.1.1.1 1999/11/24 21:44:57 joseph
|
||||
** Initial checkin for SourceForge
|
||||
**
|
||||
**
|
||||
** 4 4/06/99 3:54p Dow
|
||||
** Alt tab again.
|
||||
@@ -101,7 +104,7 @@ n** -----------------------------------------------------------------------
|
||||
#endif
|
||||
|
||||
/* Check for OS */
|
||||
#if defined(__IRIX__) || defined(__sparc__) || defined(__linux__)
|
||||
#if defined(__IRIX__) || defined(__sparc__) || defined(__linux__) || defined(__FreeBSD__)
|
||||
# define GLIDE_OS GLIDE_OS_UNIX
|
||||
#elif defined(__DOS__)
|
||||
# define GLIDE_OS GLIDE_OS_DOS32
|
||||
|
||||
@@ -144,7 +144,7 @@ void endCriticalSection(void)
|
||||
{
|
||||
}
|
||||
|
||||
#elif defined(__linux__)
|
||||
#elif defined(__linux__) || defined(__FreeBSD__)
|
||||
|
||||
|
||||
#include <3dfx.h>
|
||||
|
||||
@@ -20,7 +20,10 @@
|
||||
|
||||
/* $Header$ */
|
||||
/* $Revision$ */
|
||||
/* $Log$ */
|
||||
/* $Log$
|
||||
/* Revision 1.1.1.1 1999/11/24 21:44:58 joseph
|
||||
/* Initial checkin for SourceForge
|
||||
/* */
|
||||
/* */
|
||||
/* 4 4/06/99 3:54p Dow */
|
||||
/* Alt tab again. */
|
||||
@@ -361,8 +364,8 @@ _trisetup_clip_coor_thunk:
|
||||
lea _va-STKOFF(%esp) , %vPtr /* Get vertex pointer address */
|
||||
mov drawTrianglesProc(%gc) , %procPtr /* Prefetch drawTriangles proc addr */
|
||||
|
||||
push %vPtr /* vertex array address */
|
||||
push $3 /* 3 vertices */
|
||||
pushl %vPtr /* vertex array address */
|
||||
pushl $3 /* 3 vertices */
|
||||
|
||||
/* If debugging make sure that we're in clip coordinates */
|
||||
#ifdef GLIDE_DEBUG
|
||||
@@ -374,7 +377,7 @@ _trisetup_clip_coor_thunk:
|
||||
L_trisetup_clip_coor_thunk__clipSpace:
|
||||
#endif /* GLIDE_DEBUG */
|
||||
|
||||
push $1 /* mode = grDrawVertexArray */
|
||||
pushl $1 /* mode = grDrawVertexArray */
|
||||
call %procPtr /* (*gc->curArchProcs.drawTrianglesProc)(grDrawVertexArray, 3, vPtr) */
|
||||
|
||||
ret /* pop 3 dwords (vertex addrs) and return */
|
||||
|
||||
@@ -21,7 +21,10 @@
|
||||
|
||||
/* $Header$ */
|
||||
/* $Revision$ */
|
||||
/* $Log$ */
|
||||
/* $Log$
|
||||
/* Revision 1.1.1.1 1999/11/24 21:44:58 joseph
|
||||
/* Initial checkin for SourceForge
|
||||
/* */
|
||||
/* */
|
||||
/* 2 10/30/97 6:53p Peter */
|
||||
/* first real cut at tri asm */
|
||||
@@ -198,7 +201,7 @@ LOCAL(no_validation):
|
||||
cmp tempVal , %ebx /* fifo space required >= space available ? */
|
||||
jge LOCAL(__triBegin) /* yup, push out triangle data to Voodoo */
|
||||
|
||||
push $__LINE__ /* line number inside this function */
|
||||
pushl $__LINE__ /* line number inside this function */
|
||||
push $0x0 /* pointer to function name = NULL */
|
||||
|
||||
push tempVal /* fifo space required */
|
||||
@@ -783,7 +786,7 @@ LOCAL(nocull):
|
||||
|
||||
jge LOCAL(__triBegin)
|
||||
|
||||
push $__LINE__
|
||||
pushl $__LINE__
|
||||
push $0x0
|
||||
|
||||
push %eax
|
||||
|
||||
@@ -193,7 +193,7 @@ _grDrawTriangles_3DNow:
|
||||
cmp %ecx , %eax /* fifo space avail >= packet size ? */
|
||||
jge .L_grDrawTriangles_3DNow_win_tri_begin_ND /* yup, start writing triangle data */
|
||||
|
||||
push $__LINE__ /* line number inside this function */
|
||||
pushl $__LINE__ /* line number inside this function */
|
||||
push $0x0 /* pointer to function name = NULL */
|
||||
|
||||
push %ecx /* fifo space needed */
|
||||
@@ -423,7 +423,7 @@ _grDrawTriangles_3DNow:
|
||||
cmp %ecx , %eax /* fifo space avail >= packet size ? */
|
||||
jge .L_grDrawTriangles_3DNow_win_tri_begin_D /* yup, start writing triangle data */
|
||||
|
||||
push $__LINE__ /* line number inside this function */
|
||||
pushl $__LINE__ /* line number inside this function */
|
||||
push $0x0 /* pointer to function name = NULL */
|
||||
|
||||
push %ecx /* fifo space needed */
|
||||
@@ -668,7 +668,7 @@ _grDrawTriangles_3DNow:
|
||||
cmp %ecx , %eax /* fifo space avail >= packet size ? */
|
||||
jge .L_grDrawTriangles_3DNow_clip_tri_begin /* yup, start writing triangle data */
|
||||
|
||||
push $__LINE__ /* line number inside this function */
|
||||
pushl $__LINE__ /* line number inside this function */
|
||||
push $0x0 /* pointer to function name = NULL */
|
||||
|
||||
push %ecx /* fifo space needed */
|
||||
@@ -1196,7 +1196,7 @@ _grDrawVertexList_3DNow_Window:
|
||||
cmp %ecx , %eax /* fifo space avail >= packet size ? */
|
||||
jge .L_grDrawVertexList_3DNow_Window_win_strip_begin_ND /* yup, start writing strip data */
|
||||
|
||||
push $__LINE__ /* line number inside this function */
|
||||
pushl $__LINE__ /* line number inside this function */
|
||||
push $0x0 /* pointer to function name = NULL */
|
||||
|
||||
push %ecx /* fifo space needed */
|
||||
@@ -1458,7 +1458,7 @@ _grDrawVertexList_3DNow_Window:
|
||||
cmp %ecx , %eax /* fifo space avail >= packet size ? */
|
||||
jge .L_grDrawVertexList_3DNow_Window_win_strip_begin_D /* yup, start writing strip data */
|
||||
|
||||
push $__LINE__ /* line number inside this function */
|
||||
pushl $__LINE__ /* line number inside this function */
|
||||
push $0x0 /* pointer to function name = NULL */
|
||||
|
||||
push %ecx /* fifo space needed */
|
||||
@@ -1786,7 +1786,7 @@ _grDrawVertexList_3DNow_Clip:
|
||||
cmp %ecx , %eax /* fifo space avail >= packet size ? */
|
||||
jge .L_grDrawVertexList_3DNow_Clip_clip_strip_begin /* yup, start writing strip data */
|
||||
|
||||
push $__LINE__ /* line number inside this function */
|
||||
pushl $__LINE__ /* line number inside this function */
|
||||
push $0x0 /* pointer to function name = NULL */
|
||||
|
||||
push %ecx /* fifo space needed */
|
||||
@@ -2334,7 +2334,7 @@ _drawvertexlist:
|
||||
add $4 , %eax
|
||||
cmp %eax , %ecx
|
||||
jge .L_drawvertexlist_win_strip_begin
|
||||
push $__LINE__
|
||||
pushl $__LINE__
|
||||
push $0x0
|
||||
push %eax
|
||||
call _grCommandTransportMakeRoom
|
||||
@@ -2545,7 +2545,7 @@ _vpdrawvertexlist:
|
||||
add $4 , %eax
|
||||
cmp %eax , %ecx
|
||||
jge .L_vpdrawvertexlist_clip_strip_begin
|
||||
push $__LINE__
|
||||
pushl $__LINE__
|
||||
push $0x0
|
||||
push %eax
|
||||
call _grCommandTransportMakeRoom
|
||||
@@ -2976,7 +2976,7 @@ _vptrisetup_cull:
|
||||
cmp %eax , %ecx
|
||||
jge .L_vptrisetup_cull_setup_pkt_hdr
|
||||
|
||||
push $__LINE__ /* line number inside this function */
|
||||
pushl $__LINE__ /* line number inside this function */
|
||||
push $0x0 /* pointer to function name = NULL */
|
||||
|
||||
push %eax
|
||||
|
||||
@@ -212,7 +212,7 @@ hwcInit(FxU32 vID, FxU32 dID) {
|
||||
|
||||
pciOpen();
|
||||
|
||||
hInfo.nBoards = 0;
|
||||
/* hInfo.nBoards = 0; */
|
||||
|
||||
errorString[0] = '\0';
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ float fxTime(void)
|
||||
return (tb.time - once) + tb.millitm * .001;
|
||||
|
||||
#else
|
||||
#if defined ( WIN32 ) || ( __DOS__ )
|
||||
#if defined ( WIN32 ) || ( __DOS__ ) || defined(__FreeBSD__)
|
||||
# include <time.h>
|
||||
# define times(a) clock()
|
||||
# define HZ CLOCKS_PER_SEC
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "linutil.h"
|
||||
|
||||
static init_done=0;
|
||||
|
||||
@@ -92,7 +92,24 @@ CDEBUG = -g -O
|
||||
#CDEBUG = -pg -g -O
|
||||
#GCDEFS =
|
||||
endif
|
||||
|
||||
|
||||
ifeq "$(OS)" "FreeBSD"
|
||||
GCINCS = -I. -I$(BUILD_ROOT_SWLIBS)/include -I$(BUILD_ROOT_HW)/include -I/usr/X11R6/include
|
||||
GCOPTS = -Wall
|
||||
#
|
||||
# BIG_OPT Indicates O3(?) or better is being used. It changes the
|
||||
# assembly language in grDrawTriangle. Larger optimization removes
|
||||
# an extra push in the calling sequence.
|
||||
#
|
||||
CNODEBUG = -O6 -m486 -fomit-frame-pointer -funroll-loops \
|
||||
-fexpensive-optimizations -ffast-math -DBIG_OPT
|
||||
|
||||
CDEBUG = -g -O
|
||||
# Profiling
|
||||
#CDEBUG = -pg -g -O
|
||||
#GCDEFS =
|
||||
endif
|
||||
|
||||
# if we are not debugging then replace debug flags with nodebug flags
|
||||
|
||||
# DEBUG = xx
|
||||
@@ -146,6 +163,11 @@ AR = /usr/bin/ar crsl
|
||||
ECHO = /bin/echo
|
||||
INSTALL = /usr/bin/install
|
||||
endif
|
||||
ifeq "$(OS)" "FreeBSD"
|
||||
AR = /usr/bin/ar crsl
|
||||
ECHO = /bin/echo
|
||||
INSTALL = /usr/bin/install -c
|
||||
endif
|
||||
|
||||
DATE = date
|
||||
RM = rm
|
||||
|
||||
@@ -26,7 +26,14 @@
|
||||
HEADERS = fxpci.h sst1_pci.h
|
||||
PRIVATE_HEADERS += pcilib.h
|
||||
INSTALL_DESTINATION = $(BUILD_ROOT_SWLIBS)
|
||||
|
||||
ifeq ($(shell $(BUILD_ROOT_SWLIBS)/include/make/ostype), Linux)
|
||||
EXTPCIFILES = fxlinux.c
|
||||
endif
|
||||
ifeq ($(shell $(BUILD_ROOT_SWLIBS)/include/make/ostype), FreeBSD)
|
||||
EXTPCIFILES = fxfreebsd.c
|
||||
endif
|
||||
|
||||
CFILES = fxpci.c fxinfo.c fxmsr.c sst1_pci.c $(EXTPCIFILES)
|
||||
#FX_DLL_COMPILE = 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user