Fixing warnings and small fixes.

This commit is contained in:
Ali Mashtizadeh 2014-09-04 18:21:18 -07:00
parent bad9c2b470
commit 3ada1a4fcc
4 changed files with 11 additions and 9 deletions

View File

@ -1198,9 +1198,7 @@ db_disasm_esc(loc, inst, rex, short_addr, size, seg)
* next instruction.
*/
uintptr_t
db_disasm(loc, altfmt)
uintptr_t loc;
bool altfmt;
db_disasm(uintptr_t loc, bool altfmt)
{
int inst;
int size;

View File

@ -26,6 +26,7 @@ extern void PS2_Init();
extern void PCI_Init();
extern void IDE_Init();
extern void MachineBoot_AddMem();
extern void Loader_LoadInit();
#define GDT_MAX 8
@ -150,7 +151,7 @@ void Machine_Init()
VFS_MountRoot(root);
Critical_Exit();
Thread *thr = Thread_KThreadCreate(&Machine_IdleThread, NULL);
if (thr == NULL) {
kprintf("Couldn't create idle thread!\n");

View File

@ -2,6 +2,8 @@
#include <stdbool.h>
#include <stdint.h>
#include <errno.h>
#include <sys/kassert.h>
#include <sys/kmem.h>
#include <sys/thread.h>
@ -77,7 +79,7 @@ Syscall_MUnmap(uint64_t addr, uint64_t len)
uint64_t
Syscall_MProtect(uint64_t addr, uint64_t len, uint64_t prot)
{
Thread *cur = Thread_Current();
//Thread *cur = Thread_Current();
NOT_IMPLEMENTED();
return 0;
}
@ -89,7 +91,7 @@ Syscall_Read(uint64_t fd, uint64_t addr, uint64_t off, uint64_t length)
Handle *handle = Handle_Lookup(cur, fd);
if (handle == NULL)
return -1;
return -EBADF;
// Verify memory region and pin
@ -103,7 +105,7 @@ Syscall_Write(uint64_t fd, uint64_t addr, uint64_t off, uint64_t length)
Handle *handle = Handle_Lookup(cur, fd);
if (handle == NULL)
return -1;
return -EBADF;
// Verify memory region and pin
@ -117,7 +119,7 @@ Syscall_Flush(uint64_t fd)
Handle *handle = Handle_Lookup(cur, fd);
if (handle == NULL)
return -1;
return -EBADF;
return (handle->flush)(handle);
}
@ -136,7 +138,7 @@ Syscall_Close(uint64_t fd)
Handle *handle = Handle_Lookup(cur, fd);
if (handle == NULL)
return -1;
return -EBADF;
return (handle->close)(handle);
}

View File

@ -63,6 +63,7 @@ Thread_Create()
}
thr->schedState = SCHED_STATE_NULL;
thr->nextFD = 0;
Handle_Init(thr);