Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Feb 2007 11:11:15 GMT
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 114166 for review
Message-ID:  <200702071111.l17BBFD9041903@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=114166

Change 114166 by rwatson@rwatson_cinnamon on 2007/02/07 11:10:42

	Continue internal confusion about size_t: BPF performs int/u_int
	arithmetic on its sizes, so for now, accept u_int arguments from
	BPF.  We use size_t for all user APIs that refer to buffer sizes,
	however, in the hopes that we can allow >32bit shared memory
	buffers using the same API on 64-bit platforms in the future.

Affected files ...

.. //depot/projects/zcopybpf/src/sys/net/bpf_zerocopy.c#17 edit
.. //depot/projects/zcopybpf/src/sys/net/bpf_zerocopy.h#5 edit

Differences ...

==== //depot/projects/zcopybpf/src/sys/net/bpf_zerocopy.c#17 (text+ko) ====

@@ -241,7 +241,7 @@
  * responsible for performing bounds checking, etc.
  */
 void
-bpf_zerocopy_append_bytes(struct bpf_d *d, caddr_t buf, size_t offset,
+bpf_zerocopy_append_bytes(struct bpf_d *d, caddr_t buf, u_int offset,
     void *src, u_int len)
 {
 	u_int count, page, poffset;
@@ -294,7 +294,7 @@
  * checking that this will not exceed the buffer limit.
  */
 void
-bpf_zerocopy_append_mbuf(struct bpf_d *d, caddr_t buf, size_t offset,
+bpf_zerocopy_append_mbuf(struct bpf_d *d, caddr_t buf, u_int offset,
     void *src, u_int len)
 {
 	u_int count, moffset, page, poffset;
@@ -430,7 +430,7 @@
  * scatter-gather copying with a series of uiomove calls here.
  */
 int
-bpf_zerocopy_uiomove(struct bpf_d *d, caddr_t buf, size_t len,
+bpf_zerocopy_uiomove(struct bpf_d *d, caddr_t buf, u_int len,
     struct uio *uio)
 {
 

==== //depot/projects/zcopybpf/src/sys/net/bpf_zerocopy.h#5 (text+ko) ====

@@ -48,7 +48,7 @@
 int	bpf_zerocopy_ioctl_getzbuf(struct thread *td, struct bpf_d *d,
 	    struct bpf_zbuf *bz);
 int	bpf_zerocopy_ioctl_getzmax(struct thread *td, struct bpf_d *d,
-	    u_int *i);
+	    size_t *i);
 int	bpf_zerocopy_ioctl_getznext(struct thread *td, struct bpf_d *d,
 	    struct bpf_zbuf *bz);
 int	bpf_zerocopy_ioctl_setzbuf(struct thread *td, struct bpf_d *d,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200702071111.l17BBFD9041903>