Code changes from my work and the AMD760MP chipset.

The primary changes is the way in which printk works.
But there are many other assorted code cleanups.
Just look and see :)
This commit is contained in:
Eric W. Biederman 2001-08-08 02:45:10 +00:00
commit ed8c9d7e0d
62 changed files with 1362 additions and 977 deletions

View file

@ -30,20 +30,20 @@ fill_inbuf(void)
{
if (firstfill) {
if ((ram = malloc(K64)) == NULL) {
printk(KERN_EMERG "%6d:%s() - ram malloc failed\n",
printk_emerg("%6d:%s() - ram malloc failed\n",
__LINE__, __FUNCTION__);
return (0);
}
#ifdef CHECK_DOC_MIL
if ((checkbuf = malloc(K64)) == NULL) {
printk(KERN_EMERG "%6d:%s() - checkbuf malloc failed\n",
printk_emerg("%6d:%s() - checkbuf malloc failed\n",
__LINE__, __FUNCTION__);
printk(KERN_EMERG "Checking disabled\n");
printk_emerg("Checking disabled\n");
}
#endif
DBG("%6d:%s() - ram buffer:0x%p\n",
printk_debug("%6d:%s() - ram buffer:0x%p\n",
__LINE__, __FUNCTION__, ram);
block_count = 0;
@ -57,20 +57,20 @@ fill_inbuf(void)
if (checkbuf) {
memcpy_from_doc_mil(checkbuf, nvram, K64);
if (memcmp(checkbuf, ram, K64)) {
printk("CHECKBUF FAILS for doc mil!\n");
printk(KERN_EMERG "address 0x%x\n", nvram);
printk_emerg("CHECKBUF FAILS for doc mil!\n");
printk_emerg( "address 0x%x\n", nvram);
}
}
{
int i;
printk(KERN_INFO "First 16 bytes of block: ");
printk_info( "First 16 bytes of block: ");
for (i = 0; i < 16; i++)
printk("0x%x ", ram[i]);
printk(KERN_INFO "\n");
printk_info("0x%x ", ram[i]);
printk_info( "\n");
}
#endif
DBG("%6d:%s() - nvram:0x%p block_count:%d\n",
printk_debug("%6d:%s() - nvram:0x%p block_count:%d\n",
__LINE__, __FUNCTION__, nvram, block_count);
nvram += K64;

View file

@ -44,7 +44,7 @@ int fill_inbuf(void)
}
if (block_count > 31) {
printk(KERN_EMERG "%6d:%s() - overflowed source buffer\n",
printk_emerg( "%6d:%s() - overflowed source buffer\n",
__LINE__, __FUNCTION__);
inbuf = zkernel_start;
inptr = 0;
@ -57,7 +57,7 @@ int fill_inbuf(void)
#ifdef INBUF_COPY
if (!ram) {
printk(KERN_EMERG "%6d:%s() - "
printk_emerg("%6d:%s() - "
"ram malloc failed\n",
__LINE__, __FUNCTION__);
inbuf = zkernel_start;
@ -66,10 +66,10 @@ int fill_inbuf(void)
return (0);
}
DBG("%6d:%s() - ram buffer:0x%08x\n",
printk_debug("%6d:%s() - ram buffer:0x%08x\n",
__LINE__, __FUNCTION__, ram);
#endif
DBG("%6d:%s() - zkernel_start:0x%08x "
printk_debug("%6d:%s() - zkernel_start:0x%08x "
"zkernel_mask:0x%08x\n",
__LINE__, __FUNCTION__,
zkernel_start, zkernel_mask);
@ -77,14 +77,14 @@ int fill_inbuf(void)
nvram += K64;
while (!(zkernel_mask & (1 << block_count))) {
DBG("%6d:%s() - skipping block %d\n",
printk_debug("%6d:%s() - skipping block %d\n",
__LINE__, __FUNCTION__, block_count);
block_count++;
nvram += K64;
if (block_count > 31) {
printk(KERN_EMERG "%6d:%s() - "
printk_emerg("%6d:%s() - "
"overflowed source buffer\n",
__LINE__, __FUNCTION__);
inbuf = zkernel_start;
@ -98,7 +98,7 @@ int fill_inbuf(void)
#ifdef INBUF_COPY
memcpy(ram, nvram, K64);
#endif
DBG("%6d:%s() - nvram:0x%p block_count:%d\n",
printk_debug("%6d:%s() - nvram:0x%p block_count:%d\n",
__LINE__, __FUNCTION__, nvram, block_count);
#ifdef INBUF_COPY

View file

@ -45,7 +45,7 @@ int fill_inbuf(void)
firstfill = 0;
ram = malloc(K64);
if (!ram) {
printk(KERN_EMERG "%6d:%s() - "
printk_emerg("%6d:%s() - "
"ram malloc failed\n",
__LINE__, __FUNCTION__);
return 0;
@ -53,30 +53,30 @@ int fill_inbuf(void)
}
if (block_count > 31) {
printk(KERN_EMERG "%6d:%s() - overflowed source buffer\n",
printk_emerg("%6d:%s() - overflowed source buffer\n",
__LINE__, __FUNCTION__);
insize = 0;
return (0);
}
if (!block_count) {
nvram = TIG_KERNEL_START;
DBG("%6d:%s() - ram buffer:0x%08x\n",
printk_debug("%6d:%s() - ram buffer:0x%08x\n",
__LINE__, __FUNCTION__, ram);
DBG("%6d:%s() - TIG_KERNEL_START:0x%08x\n",
printk_debug("%6d:%s() - TIG_KERNEL_START:0x%08x\n",
__LINE__, __FUNCTION__,
TIG_KERNEL_START);
}
tsunami_flash_copy_from(ram, nvram, K64);
DBG("\n%6d:%s() - nvram:0x%lx block_count:%d\n",
printk_debug("\n%6d:%s() - nvram:0x%lx block_count:%d\n",
__LINE__, __FUNCTION__, nvram, block_count);
#if 0
{
int i;
for(i = 0; i < K64; i+= 16) {
printk("%05x: %02x %02x %02x %02x %02x %02x %02x %02x "
printk_debug("%05x: %02x %02x %02x %02x %02x %02x %02x %02x "
"%02x %02x %02x %02x %02x %02x %02x %02x\n",
(block_count << 16)+i,
ram[i+0], ram[i+1], ram[i+2], ram[i+3],