diff options
author | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-04-27 22:42:27 +0000 |
---|---|---|
committer | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-04-27 22:42:27 +0000 |
commit | 30d0116d16a40b641a4fc772435e0cbb09fe3e83 (patch) | |
tree | 814b49212bb351300b13dd77272b6c80f850e34c /libdha/mtrr.c | |
parent | 38a7d8e282893074240754cce4d00a9237d557e5 (diff) | |
download | mpv-30d0116d16a40b641a4fc772435e0cbb09fe3e83.tar.bz2 mpv-30d0116d16a40b641a4fc772435e0cbb09fe3e83.tar.xz |
OpenBSD, NetBSD portability patches by
Björn Sandell <biorn@dce.chalmers.se>
Marcus <core@antbear.org>
Bernd Ernesti <mplayer@lists.veego.de>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5873 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libdha/mtrr.c')
-rw-r--r-- | libdha/mtrr.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/libdha/mtrr.c b/libdha/mtrr.c index 271e0b2d73..aec32fcf0e 100644 --- a/libdha/mtrr.c +++ b/libdha/mtrr.c @@ -12,6 +12,12 @@ #include "libdha.h" #include "AsmMacros.h" +#if defined (__i386__) && defined (__NetBSD__) +#include <stdint.h> +#include <stdlib.h> +#include <machine/mtrr.h> +#include <machine/sysarch.h> +#endif #if defined( __i386__ ) int mtrr_set_type(unsigned base,unsigned size,int type) @@ -40,6 +46,23 @@ int mtrr_set_type(unsigned base,unsigned size,int type) return wr_len == strlen(sout) ? 0 : EPERM; } return ENOSYS; +#elif defined (__NetBSD__) + struct mtrr *mtrrp; + int n; + + mtrrp = malloc(sizeof (struct mtrr)); + mtrrp->base = base; + mtrrp->len = size; + mtrrp->type = type; + mtrrp->flags = MTRR_VALID | MTRR_PRIVATE; + n = 1; + + if (i386_set_mtrr(mtrrp, &n) < 0) { + free(mtrrp); + return errno; + } + free(mtrrp); + return 0; #else #warning Please port MTRR stuff!!! return ENOSYS; |