提交 2a0a93e3 创建 作者: Silas Boyd-Wickizer's avatar Silas Boyd-Wickizer

Merge branch 'scale-amd64' of git+ssh://amsterdam.csail.mit.edu/home/am0/6.828/xv6 into scale-amd64

......@@ -36,7 +36,7 @@ kernlet_pread(int fd, size_t count, off_t off)
t0 = rdtsc();
msgid = ipc_msg_alloc();
if (msgid == nullptr_MSGID) {
if (msgid == NULL_MSGID) {
fprintf(2, "kernlet_pread: ipc_alloc_msg failed");
return;
}
......@@ -44,7 +44,7 @@ kernlet_pread(int fd, size_t count, off_t off)
if (count > PGSIZE)
die("kernlet_pread: count oops");
pageid = ipc_page_alloc();
if (pageid == nullptr_PAGEID) {
if (pageid == NULL_PAGEID) {
fprintf(2, "kernlet_pread: ipc_alloc_page failed");
return;
}
......
......@@ -7,8 +7,8 @@ typedef u32 msgid_t;
#define IPC_CTLSIZE 4096
#define IPC_PGSIZE 4096
#define IPC_NMSG 16
#define nullptr_MSGID (-1)
#define nullptr_PAGEID (-1)
#define NULL_MSGID (-1)
#define NULL_PAGEID (-1)
#define IPC_NPAGE ((KSHAREDSIZE/IPC_PGSIZE) - 1)
struct ipcmsg {
......
......@@ -8,7 +8,7 @@ msgid_t
ipc_msg_alloc(void)
{
if (ipcctl->msghead - ipcctl->msgtail == IPC_NMSG)
return nullptr_MSGID;
return NULL_MSGID;
msgid_t i = ipcctl->msghead % IPC_NMSG;
ipcctl->msghead++;
......@@ -30,7 +30,7 @@ pageid_t
ipc_page_alloc(void)
{
if (ipcctl->pagehead - ipcctl->pagetail == IPC_NPAGE)
return nullptr_PAGEID;
return NULL_PAGEID;
pageid_t i = ipcctl->pagehead % IPC_NPAGE;
ipcctl->pagehead++;
......
......@@ -16,13 +16,13 @@ fasync(FILE *fp, size_t count, off_t off)
pageid_t pageid;
msgid = ipc_msg_alloc();
if (msgid == nullptr_MSGID) {
if (msgid == NULL_MSGID) {
fprintf(2, "fasync: ipc_msg_alloc failed\n");
return -1;
}
pageid = ipc_page_alloc();
if (pageid == nullptr_PAGEID) {
if (pageid == NULL_PAGEID) {
fprintf(2, "fasync: ipc_alloc_page failed\n");
return -1;
}
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论