Merge branch 'master' of ssh://waterman@scm.millennium.berkeley.edu/project/cs/radlab...
[akaros.git] / kern / arch / sparc / cpuinfo.c
index 865cb29..347b1b2 100644 (file)
@@ -40,6 +40,7 @@ print_cpuinfo(void)
 
        cprintf("CPU Info:\n");
        cprintf("ISA:             SPARC V8\n");
+       cprintf("Number of cores: %d\n",num_cores());
        cprintf("Implementation:  0x%x\n",(psr >> 28) & 0xF);
        cprintf("Version:         0x%x\n",(psr >> 24) & 0xF);
        cprintf("Number of Cores: %d\n",num_cpus);
@@ -74,7 +75,7 @@ void show_mapping(uintptr_t start, size_t size)
                {
                        cprintf("%08p  %1d %1d %1d  %1x  %1d\n",page2pa(page),
                                !!(*pte & PTE_C),!!(*pte & PTE_M),
-                               !!(*pte & PTE_R),PTE_ACC(*pte),
+                               !!(*pte & PTE_R),(*pte & PTE_ACC) >> 2,
                                !!(*pte & PTE_PTE));
                }
                else
@@ -86,7 +87,6 @@ void
 backtrace(void)
 {
        int i = 0, j;
-       env_t* curenv = curenvs[core_id()];
 
        flush_windows();
 
@@ -119,11 +119,11 @@ backtrace(void)
                        newsp = *((void**)sp+14);
                        pc = *((void**)sp+15);
                }
-               else if(curenv)
+               else if(current)
                {
                        error_t ret;
-                       ret  = memcpy_from_user(curenv,&newsp,(void**)sp+14,sizeof(void*));
-                       ret |= memcpy_from_user(curenv,&pc,(void**)sp+15,sizeof(void*));
+                       ret  = memcpy_from_user(current,&newsp,(void**)sp+14,sizeof(void*));
+                       ret |= memcpy_from_user(current,&pc,(void**)sp+15,sizeof(void*));
                        if(ret)
                        {
                                warn("Backtrace would have caused access exception; corrupt user stack?");
@@ -132,7 +132,7 @@ backtrace(void)
                }
                else
                {
-                       warn("Can't backtrace from user with curenv == NULL!");
+                       warn("Can't backtrace from user with current == NULL!");
                        break;
                }
        }