Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 162682
b: refs/heads/master
c: 18070dd
h: refs/heads/master
v: v3
  • Loading branch information
Mike Frysinger committed Sep 17, 2009
1 parent 2d54f37 commit f7a5ff7
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f4e129399c9ead8ec37910ce9793813698c2df51
refs/heads/master: 18070dd6692a35bec266ed9ea559c24da4fdeeef
48 changes: 30 additions & 18 deletions trunk/arch/blackfin/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,31 +100,45 @@ static void decode_address(char *buf, unsigned long address)
char *modname;
char *delim = ":";
char namebuf[128];
#endif

buf += sprintf(buf, "<0x%08lx> ", address);

#ifdef CONFIG_KALLSYMS
/* look up the address and see if we are in kernel space */
symname = kallsyms_lookup(address, &symsize, &offset, &modname, namebuf);

if (symname) {
/* yeah! kernel space! */
if (!modname)
modname = delim = "";
sprintf(buf, "<0x%p> { %s%s%s%s + 0x%lx }",
(void *)address, delim, modname, delim, symname,
(unsigned long)offset);
sprintf(buf, "{ %s%s%s%s + 0x%lx }",
delim, modname, delim, symname,
(unsigned long)offset);
return;

}
#endif

/* Problem in fixed code section? */
if (address >= FIXED_CODE_START && address < FIXED_CODE_END) {
sprintf(buf, "<0x%p> /* Maybe fixed code section */", (void *)address);
/* Problem in fixed code section? */
strcat(buf, "/* Maybe fixed code section */");
return;

} else if (address < CONFIG_BOOT_LOAD) {
/* Problem somewhere before the kernel start address */
strcat(buf, "/* Maybe null pointer? */");
return;

} else if (address >= COREMMR_BASE) {
strcat(buf, "/* core mmrs */");
return;

} else if (address >= SYSMMR_BASE) {
strcat(buf, "/* system mmrs */");
return;
}

/* Problem somewhere before the kernel start address */
if (address < CONFIG_BOOT_LOAD) {
sprintf(buf, "<0x%p> /* Maybe null pointer? */", (void *)address);
} else if (address >= L1_ROM_START && address < L1_ROM_START + L1_ROM_LENGTH) {
strcat(buf, "/* on-chip L1 ROM */");
return;
}

Expand Down Expand Up @@ -172,18 +186,16 @@ static void decode_address(char *buf, unsigned long address)
offset = (address - vma->vm_start) +
(vma->vm_pgoff << PAGE_SHIFT);

sprintf(buf, "<0x%p> [ %s + 0x%lx ]",
(void *)address, name, offset);
sprintf(buf, "[ %s + 0x%lx ]", name, offset);
} else
sprintf(buf, "<0x%p> [ %s vma:0x%lx-0x%lx]",
(void *)address, name,
vma->vm_start, vma->vm_end);
sprintf(buf, "[ %s vma:0x%lx-0x%lx]",
name, vma->vm_start, vma->vm_end);

if (!in_atomic)
mmput(mm);

if (!strlen(buf))
sprintf(buf, "<0x%p> [ %s ] dynamic memory", (void *)address, name);
if (buf[0] == '\0')
sprintf(buf, "[ %s ] dynamic memory", name);

goto done;
}
Expand All @@ -193,7 +205,7 @@ static void decode_address(char *buf, unsigned long address)
}

/* we were unable to find this address anywhere */
sprintf(buf, "<0x%p> /* kernel dynamic memory */", (void *)address);
sprintf(buf, "/* kernel dynamic memory */");

done:
write_unlock_irqrestore(&tasklist_lock, flags);
Expand Down

0 comments on commit f7a5ff7

Please sign in to comment.