Added support for environments with 64 bit kernel and 32 bit userland.

git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@26 53a565d1-3bb7-0310-b661-cf11e63c67ab
This commit is contained in:
aeb 2000-05-28 21:00:56 +00:00
parent 8dd13e5082
commit 8942a29ac1
8 changed files with 45 additions and 7 deletions

13
acconfig.h Normal file
View File

@ -0,0 +1,13 @@
/* Define if kernel is 64 bit and userland is 32 bit */
#undef KERNEL64_USER32
@BOTTOM@
#include <sys/types.h>
#ifdef KERNEL64_USER32
typedef u_int64_t kptr_t;
#else
typedef void *kptr_t;
#endif

View File

@ -2,8 +2,22 @@
AC_INIT(Makefile.am) AC_INIT(Makefile.am)
AM_INIT_AUTOMAKE(libraw1394, 0.6) AM_INIT_AUTOMAKE(libraw1394, 0.6)
AM_CONFIG_HEADER(config.h)
# AC_CANONICAL_HOST
AC_PROG_CC AC_PROG_CC
AM_PROG_LIBTOOL AM_PROG_LIBTOOL
AC_ARG_ENABLE(32-64,
[ --enable-32-64 support systems with 64 bit kernel and 32 bit userland],
[
case $enableval in
yes) AC_DEFINE(KERNEL64_USER32) ;;
no) ;;
*) AC_MSG_ERROR([ Invalid arg for --enable-32-64 ])
esac
])
AC_OUTPUT([ Makefile src/Makefile debian/Makefile ]) AC_OUTPUT([ Makefile src/Makefile debian/Makefile ])

View File

@ -1,4 +1,5 @@
#include <config.h>
#include <unistd.h> #include <unistd.h>
#include "raw1394.h" #include "raw1394.h"

View File

@ -1,4 +1,5 @@
#include <config.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
@ -18,7 +19,7 @@ static int do_fcp_listen(struct raw1394_handle *handle, int startstop)
req->generation = handle->generation; req->generation = handle->generation;
req->misc = startstop; req->misc = startstop;
req->tag = (unsigned long)&rh; req->tag = (unsigned long)&rh;
req->recvb = handle->buffer; req->recvb = (kptr_t)handle->buffer;
req->length = 512; req->length = 512;
err = write(handle->fd, req, sizeof(*req)); err = write(handle->fd, req, sizeof(*req));

View File

@ -1,4 +1,5 @@
#include <config.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
@ -19,7 +20,7 @@ static int do_iso_listen(struct raw1394_handle *handle, int channel)
req->generation = handle->generation; req->generation = handle->generation;
req->misc = channel; req->misc = channel;
req->tag = (unsigned long)&rh; req->tag = (unsigned long)&rh;
req->recvb = handle->buffer; req->recvb = (kptr_t)handle->buffer;
req->length = HBUF_SIZE; req->length = HBUF_SIZE;
err = write(handle->fd, req, sizeof(*req)); err = write(handle->fd, req, sizeof(*req));

View File

@ -56,8 +56,14 @@ struct raw1394_request {
unsigned long tag; unsigned long tag;
size_t length; size_t length;
#ifdef __KERNEL__
quadlet_t *sendb; quadlet_t *sendb;
quadlet_t *recvb; quadlet_t *recvb;
#else
kptr_t sendb;
kptr_t recvb;
#endif
}; };
struct raw1394_khost_list { struct raw1394_khost_list {

View File

@ -1,4 +1,5 @@
#include <config.h>
#include <errno.h> #include <errno.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -134,7 +135,7 @@ int raw1394_get_port_info(struct raw1394_handle *handle,
CLEAR_REQ(req); CLEAR_REQ(req);
req->type = RAW1394_REQ_LIST_CARDS; req->type = RAW1394_REQ_LIST_CARDS;
req->generation = handle->generation; req->generation = handle->generation;
req->recvb = handle->buffer; req->recvb = (kptr_t)handle->buffer;
req->length = HBUF_SIZE; req->length = HBUF_SIZE;
while (1) { while (1) {

View File

@ -1,4 +1,5 @@
#include <config.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
@ -21,7 +22,7 @@ int raw1394_start_read(struct raw1394_handle *handle, nodeid_t node,
req->address = ((u_int64_t)node << 48) | addr; req->address = ((u_int64_t)node << 48) | addr;
req->length = length; req->length = length;
req->recvb = buffer; req->recvb = (kptr_t)buffer;
return (int)write(handle->fd, req, sizeof(*req)); return (int)write(handle->fd, req, sizeof(*req));
} }
@ -40,7 +41,7 @@ int raw1394_start_write(struct raw1394_handle *handle, nodeid_t node,
req->address = ((u_int64_t)node << 48) | addr; req->address = ((u_int64_t)node << 48) | addr;
req->length = length; req->length = length;
req->sendb = data; req->sendb = (kptr_t)data;
return (int)write(handle->fd, req, sizeof(*req)); return (int)write(handle->fd, req, sizeof(*req));
} }
@ -64,8 +65,8 @@ int raw1394_start_lock(struct raw1394_handle *handle, nodeid_t node,
req->tag = tag; req->tag = tag;
req->address = ((u_int64_t)node << 48) | addr; req->address = ((u_int64_t)node << 48) | addr;
req->sendb = sendbuf; req->sendb = (kptr_t)sendbuf;
req->recvb = result; req->recvb = (kptr_t)result;
req->misc = extcode; req->misc = extcode;
switch (extcode) { switch (extcode) {