} blkbuf, *bufptr;
#ifndef CONFIG_BLKBUF_EXTERNAL
-#define blktouser(baddr,uaddr) uput((baddr), (uaddr), BLKSIZE)
-#define blkfromuser(baddr,uaddr) uget((uaddr), (baddr), BLKSIZE)
#define blktok(kaddr,buf,off,len) \
memcpy((kaddr), (buf)->__bf_data + (off), (len))
#define blkfromk(kaddr,buf, off,len) \
memcpy((buf)->__bf_data + (off), (kaddr), (len))
+#define blktou(uaddr,buf,off,len) \
+ uput((buf)->__bf_data + (off), (uaddr), (len))
+#define blkfromu(uaddr,buf,off,len) \
+ uget((uaddr),(buf)->__bf_data + (off), (len))
#define blkptr(buf, off, len) ((void *)((buf)->__bf_data + (off)))
#define blkzero(buf) memset(buf->__bf_data, 0, BLKSIZE)
#else
extern void *blktok(void *kaddr, struct blkbuf *buf, uint16_t off, uint16_t len);
extern void *blkfromk(void *kaddr, struct blkbuf *buf, uint16_t off, uint16_t len);
-extern int blkfromuser(void *baddr, void *uaddr);
-extern int blktouser(void *baddr, void *uaddr);
+extern void *blktou(void *kaddr, struct blkbuf *buf, uint16_t off, uint16_t len);
+extern void *blkfromu(void *kaddr, struct blkbuf *buf, uint16_t off, uint16_t len);
/* Worst case is needing to copy over about 64 bytes */
extern void *blkptr(struct blkbuf *buf, uint16_t offset, uint16_t len);
extern void blkzero(struct blkbuf *buf);
* Copy data to/from either kernel or user space into
* the buffer. This is needed because we do inode operations
* to read and write blocks both for userspace (normal disk I/O) and
- * for the kernel (things like directory handling).
+ * for the kernel (things like directory handling). For split I/D systems
+ * we will need to extend this three ways as we have to load code.
*
* TODO: for the real block case add direct helpers for buf<->user
* transfer.
*/
+
unsigned int uputblk(bufptr bp, usize_t to, usize_t size)
{
if (udata.u_sysio)
blktok(udata.u_base, bp, to, size);
else
- uput(blkptr(bp, to, size), udata.u_base, size);
+ blktou(udata.u_base, bp, to, size);
return size;
}
if (udata.u_sysio)
blkfromk(udata.u_base, bp, from, size);
else
- uget(udata.u_base, blkptr(bp, from, size), size);
+ blkfromu(udata.u_base, bp, from, size);
return size;
}