PERFORCE change 114166 for review

Robert Watson rwatson at FreeBSD.org
Wed Feb 7 11:11:20 UTC 2007


http://perforce.freebsd.org/chv.cgi?CH=114166

Change 114166 by rwatson at 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,


More information about the p4-projects mailing list