summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar ddennedy 2006-04-09 02:13:44 +0000
committerGravatar ddennedy 2006-04-09 02:13:44 +0000
commit0b0ad6b10e1667571f97bd8f2e73b35359f4b5ef (patch)
tree18ddeac4eca78981927254785d4df1c8645b27a2 /src
parentremove memory allocations for isochronous operations from the libraw1394 even... (diff)
lock allocated isochronous packet tracking memory
git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@163 53a565d1-3bb7-0310-b661-cf11e63c67ab
Diffstat (limited to '')
-rw-r--r--src/iso.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/iso.c b/src/iso.c
index 35fecb7..fc45063 100644
--- a/src/iso.c
+++ b/src/iso.c
@@ -105,6 +105,7 @@ static int do_iso_init(raw1394handle_t handle,
int cmd)
{
unsigned int stride;
+ int result;
/* already initialized? */
if(handle->iso_mode != ISO_INACTIVE)
@@ -159,7 +160,16 @@ static int do_iso_init(raw1394handle_t handle,
ioctl(handle->fd, RAW1394_IOC_ISO_SHUTDOWN, 0);
return -1;
}
-
+#if _POSIX_MEMLOCK > 0
+ result = mlock(handle->iso_packet_infos, buf_packets * sizeof(struct raw1394_iso_packet_info));
+ /* Ignore a permission error - app is responsible for that, */
+ if (result < 0 && result != -EPERM) {
+ munmap(handle->iso_buffer, handle->iso_status.config.data_buf_size);
+ handle->iso_buffer = NULL;
+ ioctl(handle->fd, RAW1394_IOC_ISO_SHUTDOWN, 0);
+ return -1;
+ }
+#endif
return 0;
}
@@ -464,6 +474,11 @@ void raw1394_iso_shutdown(raw1394handle_t handle)
}
if(handle->iso_packet_infos) {
+#if _POSIX_MEMLOCK > 0
+ munlock(handle->iso_packet_infos,
+ handle->iso_status.config.buf_packets *
+ sizeof(struct raw1394_iso_packet_info));
+#endif
free(handle->iso_packet_infos);
handle->iso_packet_infos = NULL;
}
ss='insertions'>+12 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@101 53a565d1-3bb7-0310-b661-cf11e63c67ab 2003-01-06back out previous commit - don't drop the legacy API just yetGravatar dmaas 6-173/+130 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@100 53a565d1-3bb7-0310-b661-cf11e63c67ab 2003-01-05emulate legacy ISO reception API on top of new rawiso APIGravatar dmaas 7-131/+174 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@99 53a565d1-3bb7-0310-b661-cf11e63c67ab 2002-12-24update iso API for multi-channel reception and new packet buffer layoutGravatar dmaas 4-123/+236 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@98 53a565d1-3bb7-0310-b661-cf11e63c67ab 2002-12-20oops, irq_interval needs to be signedGravatar anonymous 1-1/+1 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@97 53a565d1-3bb7-0310-b661-cf11e63c67ab 2002-12-20dmaas - renamed exported arm definitions into the raw1394_ namespace; ↵Gravatar anonymous 3-124/+48 brought kernel-raw1394.h back in sync with the kernel version git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@96 53a565d1-3bb7-0310-b661-cf11e63c67ab 2002-12-16rawiso updates:Gravatar dmaas 3-18/+25 - changed return type of rawiso xmit/recv handlers from int to enum raw1394_iso_disposition - added an ioctl (RAW1394_ISO_QUEUE_ACTIVITY) to force an ISO_ACTIVITY event into the queue. This is needed for handling RAW1394_ISO_DEFER, to kick us out of the next read() instead of sleeping forever. - removed references to "8-byte" isochronous header - this is an OHCI-specific implementation detail git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@95 53a565d1-3bb7-0310-b661-cf11e63c67ab 2002-11-18fix cplusplus extern C blockGravatar ddennedy 1-4/+4 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@94 53a565d1-3bb7-0310-b661-cf11e63c67ab 2002-11-18merged rawiso branchGravatar ddennedy 7-6/+488 git-svn-id: svn://svn.linux1394.org/libraw1394/trunk@93 53a565d1-3bb7-0310-b661-cf11e63c67ab