DragonFly BSD support

patch by Joerg Sonnenberger <joerg - at - britannica - dot - bec - dot - de>


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@15567 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
diego 2005-05-25 08:48:32 +00:00
parent 22a08bc346
commit 8308e63eb1
13 changed files with 28 additions and 20 deletions

View File

@ -20,7 +20,7 @@ CpuCaps gCpuCaps;
#include <machine/cpu.h>
#endif
#ifdef __FreeBSD__
#if defined(__FreeBSD__) || defined(__DragonFly__)
#include <sys/types.h>
#include <sys/sysctl.h>
#endif
@ -169,7 +169,7 @@ void GetCpuCaps( CpuCaps *caps)
#endif
/* FIXME: Does SSE2 need more OS support, too? */
#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__CYGWIN__) || defined(__OpenBSD__)
#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__CYGWIN__) || defined(__OpenBSD__) || defined(__DragonFly__)
if (caps->hasSSE)
check_os_katmai_support();
if (!caps->hasSSE)
@ -324,7 +324,7 @@ static void check_os_katmai_support( void )
#ifdef ARCH_X86_64
gCpuCaps.hasSSE=1;
gCpuCaps.hasSSE2=1;
#elif defined(__FreeBSD__)
#elif defined(__FreeBSD__) || defined(__DragonFly__)
int has_sse=0, ret;
size_t len=sizeof(has_sse);

View File

@ -62,7 +62,7 @@
/* OS depended stuff */
#if defined (linux)
#include "sysdep/pci_linux.c"
#elif defined (__FreeBSD__)
#elif defined (__FreeBSD__) || defined(__DragonFly__)
#include "sysdep/pci_freebsd.c"
#elif defined (__386BSD__)
#include "sysdep/pci_386bsd.c"

View File

@ -35,7 +35,7 @@ void __builtin_delete(void* ize) {
free(ize);
}
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
void *__ctype_b=NULL;
#endif

View File

@ -79,7 +79,7 @@ void __pure_virtual(void) {
// exit(1);
}
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
void ___brk_addr(void) {exit(0);}
char **__environ={NULL};
#undef stderr

View File

@ -30,7 +30,7 @@
#if defined(__linux__)
#include <linux/cdrom.h>
#elif defined(__FreeBSD__) || defined(__bsdi__) || defined(__NetBSD__) || defined(__OpenBSD__)
#elif defined(__FreeBSD__) || defined(__bsdi__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
#include <sys/cdio.h>
#endif
@ -82,7 +82,7 @@ read_toc(const char *dev) {
return tochdr.cdth_trk1;
}
#elif defined(__FreeBSD__) || defined(__bsdi__)
#elif defined(__FreeBSD__) || defined(__bsdi__) || defined(__DragonFly__)
int
read_toc(const char *dev) {
int drive;

View File

@ -14,7 +14,7 @@
#include <sys/ioctl.h>
#include <errno.h>
#ifdef __FreeBSD__
#if defined(__FreeBSD__) || defined(__DragonFly__)
#include <sys/cdrio.h>
#include "vcd_read_fbsd.h"
#elif defined(__NetBSD__) || defined (__OpenBSD__)

View File

@ -43,6 +43,9 @@
#ifdef __NetBSD__
#include <dev/ic/bt8xx.h>
#include <sys/audioio.h>
#elif defined(__DragonFly__)
#include <dev/video/meteor/ioctl_meteor.h>
#include <dev/video/bktr/ioctl_bt848.h>
#elif __FreeBSD_version >= 502100
#include <dev/bktr/ioctl_meteor.h>
#include <dev/bktr/ioctl_bt848.h>

View File

@ -88,12 +88,17 @@ inline static unsigned long long int bswap_64(unsigned long long int x)
}
#define B2N_64(x) x = bswap_64(x)
#elif defined(__DragonFly__)
#include <sys/endian.h>
#define B2N_16(x) x = be16toh(x)
#define B2N_32(x) x = be32toh(x)
#define B2N_64(x) x = be64toh(x)
/* This is a slow but portable implementation, it has multiple evaluation
* problems so beware.
* FreeBSD and Solaris don't have <byteswap.h> or any other such
* functionality!
*/
#elif defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) || defined(__CYGWIN__)
#define B2N_16(x) \
x = ((((x) & 0xff00) >> 8) | \

View File

@ -35,7 +35,7 @@
#include <limits.h>
#include <dirent.h>
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__bsdi__)|| defined(__DARWIN__)
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__bsdi__)|| defined(__DARWIN__) || defined(__DragonFly__)
#define SYS_BSD 1
#endif

View File

@ -50,7 +50,7 @@ int modify_ldt(int func, void *ptr, unsigned long bytecount);
}
#endif
#else
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
#include <machine/segments.h>
#include <machine/sysarch.h>
#endif
@ -165,7 +165,7 @@ static int LDT_Modify( int func, struct modify_ldt_ldt_s *ptr,
#endif
#endif
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
static void LDT_EntryToBytes( unsigned long *buffer, const struct modify_ldt_ldt_s *content )
{
*buffer++ = ((content->base_addr & 0x0000ffff) << 16) |
@ -227,7 +227,7 @@ ldt_fs_t* Setup_LDT_Keeper(void)
}
#endif /*linux*/
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__)
#if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
{
unsigned long d[2];
@ -246,7 +246,7 @@ ldt_fs_t* Setup_LDT_Keeper(void)
printf("Did you reconfigure the kernel with \"options USER_LDT\"?\n");
}
}
#endif /* __NetBSD__ || __FreeBSD__ || __OpenBSD__ */
#endif /* __NetBSD__ || __FreeBSD__ || __OpenBSD__ || __DragonFly__ */
#if defined(__svr4__)
{

View File

@ -905,7 +905,7 @@ void PE_UnloadLibrary(WINE_MODREF *wm)
*/
static void __attribute__((noinline)) extend_stack_for_dll_alloca(void)
{
#ifndef __FreeBSD__
#if !defined(__FreeBSD__) && !defined(__DragonFly__)
volatile int* mem=alloca(0x20000);
*mem=0x1234;
#endif

View File

@ -993,7 +993,7 @@ static void WINAPI expGetSystemInfo(SYSTEM_INFO* si)
/* disable cpuid based detection (mplayer's cpudetect.c does this - see above) */
#ifndef MPLAYER
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__svr4__)
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__svr4__) || defined(__DragonFly__)
do_cpuid(1, regs);
switch ((regs[0] >> 8) & 0xf) { // cpu family
case 3: cachedsi.dwProcessorType = PROCESSOR_INTEL_386;

View File

@ -220,7 +220,7 @@ void getch2_enable(){
struct termios tio_new;
#if defined(__NetBSD__) || defined(__svr4__) || defined(__CYGWIN__) || defined(__OS2__) || defined(__GLIBC__)
tcgetattr(0,&tio_orig);
#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__APPLE__)
#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__APPLE__) || defined(__DragonFly__)
ioctl(0,TIOCGETA,&tio_orig);
#else
ioctl(0,TCGETS,&tio_orig);
@ -231,7 +231,7 @@ struct termios tio_new;
tio_new.c_cc[VTIME] = 0;
#if defined(__NetBSD__) || defined(__svr4__) || defined(__CYGWIN__) || defined(__OS2__) || defined(__GLIBC__)
tcsetattr(0,TCSANOW,&tio_new);
#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__APPLE__)
#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__APPLE__) || defined(__DragonFly__)
ioctl(0,TIOCSETA,&tio_new);
#else
ioctl(0,TCSETS,&tio_new);
@ -245,7 +245,7 @@ void getch2_disable(){
#ifdef HAVE_TERMIOS
#if defined(__NetBSD__) || defined(__svr4__) || defined(__CYGWIN__) || defined(__OS2__) || defined(__GLIBC__)
tcsetattr(0,TCSANOW,&tio_orig);
#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__APPLE__)
#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__APPLE__) || defined(__DragonFly__)
ioctl(0,TIOCSETA,&tio_orig);
#else
ioctl(0,TCSETS,&tio_orig);