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
|
// vm.c
|
||||||
#define PGROUNDUP(sz) ((sz+PGSIZE-1) & ~(PGSIZE-1))
|
#define PGROUNDUP(sz) ((sz+PGSIZE-1) & ~(PGSIZE-1))
|
||||||
void pminit(void);
|
void pminit(void);
|
||||||
void swkstack(void);
|
void ksegment(void);
|
||||||
void vminit(void);
|
void vminit(void);
|
||||||
|
void jkstack();
|
||||||
|
void printstack(void);
|
||||||
void printpgdir(uint*);
|
void printpgdir(uint*);
|
||||||
uint* setupkvm(void); // XXX need pde_t*
|
uint* setupkvm(void); // XXX need pde_t*
|
||||||
char* uva2ka(uint*, char*);
|
char* uva2ka(uint*, char*);
|
||||||
|
@ -165,7 +167,6 @@ void freevm(uint*);
|
||||||
void inituvm(uint*, char*, char*, uint);
|
void inituvm(uint*, char*, char*, uint);
|
||||||
int loaduvm(uint*, char*, struct inode *ip, uint, uint);
|
int loaduvm(uint*, char*, struct inode *ip, uint, uint);
|
||||||
uint* copyuvm(uint*,uint);
|
uint* copyuvm(uint*,uint);
|
||||||
void ksegment(void);
|
|
||||||
void loadvm(struct proc*);
|
void loadvm(struct proc*);
|
||||||
|
|
||||||
// number of elements in fixed-size array
|
// number of elements in fixed-size array
|
||||||
|
|
10
kalloc.c
10
kalloc.c
|
@ -23,16 +23,6 @@ struct {
|
||||||
|
|
||||||
int nfreemem;
|
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.
|
// Initialize free list of physical pages.
|
||||||
// This code cheats by just considering one megabyte of
|
// This code cheats by just considering one megabyte of
|
||||||
// pages after end. Real systems would determine the
|
// pages after end. Real systems would determine the
|
||||||
|
|
|
@ -71,7 +71,7 @@ getcallerpcs(void *v, uint pcs[])
|
||||||
|
|
||||||
ebp = (uint*)v - 2;
|
ebp = (uint*)v - 2;
|
||||||
for(i = 0; i < 10; i++){
|
for(i = 0; i < 10; i++){
|
||||||
if(ebp == 0 || ebp < 0x100000 || ebp == (uint*)0xffffffff)
|
if(ebp == 0 || ebp < (uint *) 0x100000 || ebp == (uint*)0xffffffff)
|
||||||
break;
|
break;
|
||||||
pcs[i] = ebp[1]; // saved %eip
|
pcs[i] = ebp[1]; // saved %eip
|
||||||
ebp = (uint*)ebp[0]; // saved %ebp
|
ebp = (uint*)ebp[0]; // saved %ebp
|
||||||
|
|
|
@ -34,10 +34,8 @@ fetchstr(struct proc *p, uint addr, char **pp)
|
||||||
|
|
||||||
if(addr >= p->sz)
|
if(addr >= p->sz)
|
||||||
return -1;
|
return -1;
|
||||||
// *pp = p->mem + addr;
|
*pp = (char *) addr;
|
||||||
// ep = p->mem + p->sz;
|
ep = (char *) p->sz;
|
||||||
*pp = (char **) addr;
|
|
||||||
ep = p->sz;
|
|
||||||
for(s = *pp; s < ep; s++)
|
for(s = *pp; s < ep; s++)
|
||||||
if(*s == 0)
|
if(*s == 0)
|
||||||
return s - *pp;
|
return s - *pp;
|
||||||
|
|
Loading…
Reference in a new issue