Commit 56bbd862 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven

m68k/sun3: Modernize printing of kernel messages

  - Convert from printk() to pr_*(),
  - Add missing continuations,
  - Do not print nonexistent len variable,
  - Add missing sysname[] variable,
  - Correct printf()-style format specifiers.
Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
parent 446926f9
...@@ -134,7 +134,7 @@ void __init config_sun3(void) ...@@ -134,7 +134,7 @@ void __init config_sun3(void)
{ {
unsigned long memory_start, memory_end; unsigned long memory_start, memory_end;
printk("ARCH: SUN3\n"); pr_info("ARCH: SUN3\n");
idprom_init(); idprom_init();
/* Subtract kernel memory from available memory */ /* Subtract kernel memory from available memory */
......
...@@ -31,8 +31,7 @@ static unsigned long dvma_page(unsigned long kaddr, unsigned long vaddr) ...@@ -31,8 +31,7 @@ static unsigned long dvma_page(unsigned long kaddr, unsigned long vaddr)
ptep = pfn_pte(virt_to_pfn(kaddr), PAGE_KERNEL); ptep = pfn_pte(virt_to_pfn(kaddr), PAGE_KERNEL);
pte = pte_val(ptep); pte = pte_val(ptep);
// printk("dvma_remap: addr %lx -> %lx pte %08lx len %x\n", // pr_info("dvma_remap: addr %lx -> %lx pte %08lx\n", kaddr, vaddr, pte);
// kaddr, vaddr, pte, len);
if(ptelist[(vaddr & 0xff000) >> PAGE_SHIFT] != pte) { if(ptelist[(vaddr & 0xff000) >> PAGE_SHIFT] != pte) {
sun3_put_pte(vaddr, pte); sun3_put_pte(vaddr, pte);
ptelist[(vaddr & 0xff000) >> PAGE_SHIFT] = pte; ptelist[(vaddr & 0xff000) >> PAGE_SHIFT] = pte;
......
...@@ -64,12 +64,14 @@ static void __init display_system_type(unsigned char machtype) ...@@ -64,12 +64,14 @@ static void __init display_system_type(unsigned char machtype)
for (i = 0; i < NUM_SUN_MACHINES; i++) { for (i = 0; i < NUM_SUN_MACHINES; i++) {
if(Sun_Machines[i].id_machtype == machtype) { if(Sun_Machines[i].id_machtype == machtype) {
if (machtype != (SM_SUN4M_OBP | 0x00)) if (machtype != (SM_SUN4M_OBP | 0x00))
printk("TYPE: %s\n", Sun_Machines[i].name); pr_info("TYPE: %s\n", Sun_Machines[i].name);
else { else {
#if 0 #if 0
char sysname[128];
prom_getproperty(prom_root_node, "banner-name", prom_getproperty(prom_root_node, "banner-name",
sysname, sizeof(sysname)); sysname, sizeof(sysname));
printk("TYPE: %s\n", sysname); pr_info("TYPE: %s\n", sysname);
#endif #endif
} }
return; return;
...@@ -125,5 +127,5 @@ void __init idprom_init(void) ...@@ -125,5 +127,5 @@ void __init idprom_init(void)
display_system_type(idprom->id_machtype); display_system_type(idprom->id_machtype);
printk("Ethernet address: %pM\n", idprom->id_ethaddr); pr_info("Ethernet address: %pM\n", idprom->id_ethaddr);
} }
...@@ -72,21 +72,21 @@ void print_pte (pte_t pte) ...@@ -72,21 +72,21 @@ void print_pte (pte_t pte)
#if 0 #if 0
/* Verbose version. */ /* Verbose version. */
unsigned long val = pte_val (pte); unsigned long val = pte_val (pte);
printk (" pte=%lx [addr=%lx", pr_cont(" pte=%lx [addr=%lx",
val, (val & SUN3_PAGE_PGNUM_MASK) << PAGE_SHIFT); val, (val & SUN3_PAGE_PGNUM_MASK) << PAGE_SHIFT);
if (val & SUN3_PAGE_VALID) printk (" valid"); if (val & SUN3_PAGE_VALID) pr_cont(" valid");
if (val & SUN3_PAGE_WRITEABLE) printk (" write"); if (val & SUN3_PAGE_WRITEABLE) pr_cont(" write");
if (val & SUN3_PAGE_SYSTEM) printk (" sys"); if (val & SUN3_PAGE_SYSTEM) pr_cont(" sys");
if (val & SUN3_PAGE_NOCACHE) printk (" nocache"); if (val & SUN3_PAGE_NOCACHE) pr_cont(" nocache");
if (val & SUN3_PAGE_ACCESSED) printk (" accessed"); if (val & SUN3_PAGE_ACCESSED) pr_cont(" accessed");
if (val & SUN3_PAGE_MODIFIED) printk (" modified"); if (val & SUN3_PAGE_MODIFIED) pr_cont(" modified");
switch (val & SUN3_PAGE_TYPE_MASK) { switch (val & SUN3_PAGE_TYPE_MASK) {
case SUN3_PAGE_TYPE_MEMORY: printk (" memory"); break; case SUN3_PAGE_TYPE_MEMORY: pr_cont(" memory"); break;
case SUN3_PAGE_TYPE_IO: printk (" io"); break; case SUN3_PAGE_TYPE_IO: pr_cont(" io"); break;
case SUN3_PAGE_TYPE_VME16: printk (" vme16"); break; case SUN3_PAGE_TYPE_VME16: pr_cont(" vme16"); break;
case SUN3_PAGE_TYPE_VME32: printk (" vme32"); break; case SUN3_PAGE_TYPE_VME32: pr_cont(" vme32"); break;
} }
printk ("]\n"); pr_cont("]\n");
#else #else
/* Terse version. More likely to fit on a line. */ /* Terse version. More likely to fit on a line. */
unsigned long val = pte_val (pte); unsigned long val = pte_val (pte);
...@@ -108,7 +108,7 @@ void print_pte (pte_t pte) ...@@ -108,7 +108,7 @@ void print_pte (pte_t pte)
default: type = "unknown?"; break; default: type = "unknown?"; break;
} }
printk (" pte=%08lx [%07lx %s %s]\n", pr_cont(" pte=%08lx [%07lx %s %s]\n",
val, (val & SUN3_PAGE_PGNUM_MASK) << PAGE_SHIFT, flags, type); val, (val & SUN3_PAGE_PGNUM_MASK) << PAGE_SHIFT, flags, type);
#endif #endif
} }
...@@ -116,7 +116,7 @@ void print_pte (pte_t pte) ...@@ -116,7 +116,7 @@ void print_pte (pte_t pte)
/* Print the PTE value for a given virtual address. For debugging. */ /* Print the PTE value for a given virtual address. For debugging. */
void print_pte_vaddr (unsigned long vaddr) void print_pte_vaddr (unsigned long vaddr)
{ {
printk (" vaddr=%lx [%02lx]", vaddr, sun3_get_segmap (vaddr)); pr_cont(" vaddr=%lx [%02lx]", vaddr, sun3_get_segmap (vaddr));
print_pte (__pte (sun3_get_pte (vaddr))); print_pte (__pte (sun3_get_pte (vaddr)));
} }
...@@ -153,7 +153,7 @@ void __init mmu_emu_init(unsigned long bootmem_end) ...@@ -153,7 +153,7 @@ void __init mmu_emu_init(unsigned long bootmem_end)
if(!pmeg_alloc[i]) { if(!pmeg_alloc[i]) {
#ifdef DEBUG_MMU_EMU #ifdef DEBUG_MMU_EMU
printk("freed: "); pr_info("freed:");
print_pte_vaddr (seg); print_pte_vaddr (seg);
#endif #endif
sun3_put_segmap(seg, SUN3_INVALID_PMEG); sun3_put_segmap(seg, SUN3_INVALID_PMEG);
...@@ -165,7 +165,7 @@ void __init mmu_emu_init(unsigned long bootmem_end) ...@@ -165,7 +165,7 @@ void __init mmu_emu_init(unsigned long bootmem_end)
if (sun3_get_segmap (seg) != SUN3_INVALID_PMEG) { if (sun3_get_segmap (seg) != SUN3_INVALID_PMEG) {
#ifdef DEBUG_PROM_MAPS #ifdef DEBUG_PROM_MAPS
for(i = 0; i < 16; i++) { for(i = 0; i < 16; i++) {
printk ("mapped:"); pr_info("mapped:");
print_pte_vaddr (seg + (i*PAGE_SIZE)); print_pte_vaddr (seg + (i*PAGE_SIZE));
break; break;
} }
...@@ -293,8 +293,8 @@ inline void mmu_emu_map_pmeg (int context, int vaddr) ...@@ -293,8 +293,8 @@ inline void mmu_emu_map_pmeg (int context, int vaddr)
#ifdef DEBUG_MMU_EMU #ifdef DEBUG_MMU_EMU
printk("mmu_emu_map_pmeg: pmeg %x to context %d vaddr %x\n", pr_info("mmu_emu_map_pmeg: pmeg %x to context %d vaddr %x\n",
curr_pmeg, context, vaddr); curr_pmeg, context, vaddr);
#endif #endif
/* Invalidate old mapping for the pmeg, if any */ /* Invalidate old mapping for the pmeg, if any */
...@@ -370,7 +370,7 @@ int mmu_emu_handle_fault (unsigned long vaddr, int read_flag, int kernel_fault) ...@@ -370,7 +370,7 @@ int mmu_emu_handle_fault (unsigned long vaddr, int read_flag, int kernel_fault)
} }
#ifdef DEBUG_MMU_EMU #ifdef DEBUG_MMU_EMU
printk ("mmu_emu_handle_fault: vaddr=%lx type=%s crp=%p\n", pr_info("mmu_emu_handle_fault: vaddr=%lx type=%s crp=%p\n",
vaddr, read_flag ? "read" : "write", crp); vaddr, read_flag ? "read" : "write", crp);
#endif #endif
...@@ -378,14 +378,15 @@ int mmu_emu_handle_fault (unsigned long vaddr, int read_flag, int kernel_fault) ...@@ -378,14 +378,15 @@ int mmu_emu_handle_fault (unsigned long vaddr, int read_flag, int kernel_fault)
offset = (vaddr >> SUN3_PTE_SIZE_BITS) & 0xF; offset = (vaddr >> SUN3_PTE_SIZE_BITS) & 0xF;
#ifdef DEBUG_MMU_EMU #ifdef DEBUG_MMU_EMU
printk ("mmu_emu_handle_fault: segment=%lx offset=%lx\n", segment, offset); pr_info("mmu_emu_handle_fault: segment=%lx offset=%lx\n", segment,
offset);
#endif #endif
pte = (pte_t *) pgd_val (*(crp + segment)); pte = (pte_t *) pgd_val (*(crp + segment));
//todo: next line should check for valid pmd properly. //todo: next line should check for valid pmd properly.
if (!pte) { if (!pte) {
// printk ("mmu_emu_handle_fault: invalid pmd\n"); // pr_info("mmu_emu_handle_fault: invalid pmd\n");
return 0; return 0;
} }
...@@ -417,9 +418,9 @@ int mmu_emu_handle_fault (unsigned long vaddr, int read_flag, int kernel_fault) ...@@ -417,9 +418,9 @@ int mmu_emu_handle_fault (unsigned long vaddr, int read_flag, int kernel_fault)
pte_val (*pte) |= SUN3_PAGE_ACCESSED; pte_val (*pte) |= SUN3_PAGE_ACCESSED;
#ifdef DEBUG_MMU_EMU #ifdef DEBUG_MMU_EMU
printk ("seg:%d crp:%p ->", get_fs().seg, crp); pr_info("seg:%ld crp:%p ->", get_fs().seg, crp);
print_pte_vaddr (vaddr); print_pte_vaddr (vaddr);
printk ("\n"); pr_cont("\n");
#endif #endif
return 1; return 1;
......
...@@ -39,7 +39,7 @@ prom_printf(char *fmt, ...) ...@@ -39,7 +39,7 @@ prom_printf(char *fmt, ...)
#ifdef CONFIG_KGDB #ifdef CONFIG_KGDB
if (kgdb_initialized) { if (kgdb_initialized) {
printk("kgdb_initialized = %d\n", kgdb_initialized); pr_info("kgdb_initialized = %d\n", kgdb_initialized);
putpacket(bptr, 1); putpacket(bptr, 1);
} else } else
#else #else
......
...@@ -62,7 +62,7 @@ static void print_use(void) ...@@ -62,7 +62,7 @@ static void print_use(void)
int i; int i;
int j = 0; int j = 0;
printk("dvma entry usage:\n"); pr_info("dvma entry usage:\n");
for(i = 0; i < IOMMU_TOTAL_ENTRIES; i++) { for(i = 0; i < IOMMU_TOTAL_ENTRIES; i++) {
if(!iommu_use[i]) if(!iommu_use[i])
...@@ -70,16 +70,15 @@ static void print_use(void) ...@@ -70,16 +70,15 @@ static void print_use(void)
j++; j++;
printk("dvma entry: %08lx len %08lx\n", pr_info("dvma entry: %08x len %08lx\n",
( i << DVMA_PAGE_SHIFT) + DVMA_START, (i << DVMA_PAGE_SHIFT) + DVMA_START, iommu_use[i]);
iommu_use[i]);
} }
printk("%d entries in use total\n", j); pr_info("%d entries in use total\n", j);
printk("allocation/free calls: %lu/%lu\n", dvma_allocs, dvma_frees); pr_info("allocation/free calls: %lu/%lu\n", dvma_allocs, dvma_frees);
printk("allocation/free bytes: %Lx/%Lx\n", dvma_alloc_bytes, pr_info("allocation/free bytes: %Lx/%Lx\n", dvma_alloc_bytes,
dvma_free_bytes); dvma_free_bytes);
} }
static void print_holes(struct list_head *holes) static void print_holes(struct list_head *holes)
...@@ -88,18 +87,18 @@ static void print_holes(struct list_head *holes) ...@@ -88,18 +87,18 @@ static void print_holes(struct list_head *holes)
struct list_head *cur; struct list_head *cur;
struct hole *hole; struct hole *hole;
printk("listing dvma holes\n"); pr_info("listing dvma holes\n");
list_for_each(cur, holes) { list_for_each(cur, holes) {
hole = list_entry(cur, struct hole, list); hole = list_entry(cur, struct hole, list);
if((hole->start == 0) && (hole->end == 0) && (hole->size == 0)) if((hole->start == 0) && (hole->end == 0) && (hole->size == 0))
continue; continue;
printk("hole: start %08lx end %08lx size %08lx\n", hole->start, hole->end, hole->size); pr_info("hole: start %08lx end %08lx size %08lx\n",
hole->start, hole->end, hole->size);
} }
printk("end of hole listing...\n"); pr_info("end of hole listing...\n");
} }
#endif /* DVMA_DEBUG */ #endif /* DVMA_DEBUG */
...@@ -137,7 +136,7 @@ static inline struct hole *rmcache(void) ...@@ -137,7 +136,7 @@ static inline struct hole *rmcache(void)
if(list_empty(&hole_cache)) { if(list_empty(&hole_cache)) {
if(!refill()) { if(!refill()) {
printk("out of dvma hole cache!\n"); pr_crit("out of dvma hole cache!\n");
BUG(); BUG();
} }
} }
...@@ -157,7 +156,7 @@ static inline unsigned long get_baddr(int len, unsigned long align) ...@@ -157,7 +156,7 @@ static inline unsigned long get_baddr(int len, unsigned long align)
if(list_empty(&hole_list)) { if(list_empty(&hole_list)) {
#ifdef DVMA_DEBUG #ifdef DVMA_DEBUG
printk("out of dvma holes! (printing hole cache)\n"); pr_crit("out of dvma holes! (printing hole cache)\n");
print_holes(&hole_cache); print_holes(&hole_cache);
print_use(); print_use();
#endif #endif
...@@ -195,7 +194,7 @@ static inline unsigned long get_baddr(int len, unsigned long align) ...@@ -195,7 +194,7 @@ static inline unsigned long get_baddr(int len, unsigned long align)
} }
printk("unable to find dvma hole!\n"); pr_crit("unable to find dvma hole!\n");
BUG(); BUG();
return 0; return 0;
} }
...@@ -287,15 +286,12 @@ unsigned long dvma_map_align(unsigned long kaddr, int len, int align) ...@@ -287,15 +286,12 @@ unsigned long dvma_map_align(unsigned long kaddr, int len, int align)
len = 0x800; len = 0x800;
if(!kaddr || !len) { if(!kaddr || !len) {
// printk("error: kaddr %lx len %x\n", kaddr, len); // pr_err("error: kaddr %lx len %x\n", kaddr, len);
// *(int *)4 = 0; // *(int *)4 = 0;
return 0; return 0;
} }
#ifdef DEBUG pr_debug("dvma_map request %08x bytes from %08lx\n", len, kaddr);
printk("dvma_map request %08lx bytes from %08lx\n",
len, kaddr);
#endif
off = kaddr & ~DVMA_PAGE_MASK; off = kaddr & ~DVMA_PAGE_MASK;
kaddr &= PAGE_MASK; kaddr &= PAGE_MASK;
len += off; len += off;
...@@ -307,12 +303,13 @@ unsigned long dvma_map_align(unsigned long kaddr, int len, int align) ...@@ -307,12 +303,13 @@ unsigned long dvma_map_align(unsigned long kaddr, int len, int align)
align = ((align + (DVMA_PAGE_SIZE-1)) & DVMA_PAGE_MASK); align = ((align + (DVMA_PAGE_SIZE-1)) & DVMA_PAGE_MASK);
baddr = get_baddr(len, align); baddr = get_baddr(len, align);
// printk("using baddr %lx\n", baddr); // pr_info("using baddr %lx\n", baddr);
if(!dvma_map_iommu(kaddr, baddr, len)) if(!dvma_map_iommu(kaddr, baddr, len))
return (baddr + off); return (baddr + off);
printk("dvma_map failed kaddr %lx baddr %lx len %x\n", kaddr, baddr, len); pr_crit("dvma_map failed kaddr %lx baddr %lx len %x\n", kaddr, baddr,
len);
BUG(); BUG();
return 0; return 0;
} }
...@@ -343,9 +340,7 @@ void *dvma_malloc_align(unsigned long len, unsigned long align) ...@@ -343,9 +340,7 @@ void *dvma_malloc_align(unsigned long len, unsigned long align)
if(!len) if(!len)
return NULL; return NULL;
#ifdef DEBUG pr_debug("dvma_malloc request %lx bytes\n", len);
printk("dvma_malloc request %lx bytes\n", len);
#endif
len = ((len + (DVMA_PAGE_SIZE-1)) & DVMA_PAGE_MASK); len = ((len + (DVMA_PAGE_SIZE-1)) & DVMA_PAGE_MASK);
if((kaddr = __get_free_pages(GFP_ATOMIC, get_order(len))) == 0) if((kaddr = __get_free_pages(GFP_ATOMIC, get_order(len))) == 0)
...@@ -364,10 +359,8 @@ void *dvma_malloc_align(unsigned long len, unsigned long align) ...@@ -364,10 +359,8 @@ void *dvma_malloc_align(unsigned long len, unsigned long align)
return NULL; return NULL;
} }
#ifdef DEBUG pr_debug("mapped %08lx bytes %08lx kern -> %08lx bus\n", len, kaddr,
printk("mapped %08lx bytes %08lx kern -> %08lx bus\n", baddr);
len, kaddr, baddr);
#endif
return (void *)vaddr; return (void *)vaddr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment