nits
This commit is contained in:
parent
40889627ba
commit
74c82bc158
4 changed files with 6 additions and 17 deletions
5
defs.h
5
defs.h
|
@ -155,8 +155,10 @@ void uartputc(int);
|
|||
// vm.c
|
||||
#define PGROUNDUP(sz) ((sz+PGSIZE-1) & ~(PGSIZE-1))
|
||||
void pminit(void);
|
||||
void swkstack(void);
|
||||
void ksegment(void);
|
||||
void vminit(void);
|
||||
void jkstack();
|
||||
void printstack(void);
|
||||
void printpgdir(uint*);
|
||||
uint* setupkvm(void); // XXX need pde_t*
|
||||
char* uva2ka(uint*, char*);
|
||||
|
@ -165,7 +167,6 @@ void freevm(uint*);
|
|||
void inituvm(uint*, char*, char*, uint);
|
||||
int loaduvm(uint*, char*, struct inode *ip, uint, uint);
|
||||
uint* copyuvm(uint*,uint);
|
||||
void ksegment(void);
|
||||
void loadvm(struct proc*);
|
||||
|
||||
// number of elements in fixed-size array
|
||||
|
|
10
kalloc.c
10
kalloc.c
|
@ -23,16 +23,6 @@ struct {
|
|||
|
||||
int nfreemem;
|
||||
|
||||
static void
|
||||
printfreelist(void)
|
||||
{
|
||||
struct run *r, **rp;
|
||||
cprintf("freelist:\n");
|
||||
for(rp=&kmem.freelist; (r=*rp) != 0; rp=&r->next){
|
||||
cprintf("0x%x %d=0x%x\n", r, r->len, r->len);
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize free list of physical pages.
|
||||
// This code cheats by just considering one megabyte of
|
||||
// pages after end. Real systems would determine the
|
||||
|
|
|
@ -71,7 +71,7 @@ getcallerpcs(void *v, uint pcs[])
|
|||
|
||||
ebp = (uint*)v - 2;
|
||||
for(i = 0; i < 10; i++){
|
||||
if(ebp == 0 || ebp < 0x100000 || ebp == (uint*)0xffffffff)
|
||||
if(ebp == 0 || ebp < (uint *) 0x100000 || ebp == (uint*)0xffffffff)
|
||||
break;
|
||||
pcs[i] = ebp[1]; // saved %eip
|
||||
ebp = (uint*)ebp[0]; // saved %ebp
|
||||
|
|
|
@ -34,10 +34,8 @@ fetchstr(struct proc *p, uint addr, char **pp)
|
|||
|
||||
if(addr >= p->sz)
|
||||
return -1;
|
||||
// *pp = p->mem + addr;
|
||||
// ep = p->mem + p->sz;
|
||||
*pp = (char **) addr;
|
||||
ep = p->sz;
|
||||
*pp = (char *) addr;
|
||||
ep = (char *) p->sz;
|
||||
for(s = *pp; s < ep; s++)
|
||||
if(*s == 0)
|
||||
return s - *pp;
|
||||
|
|
Loading…
Reference in a new issue