/**
*** Copyright (c) Equator Technologies, Inc. Unpublished
***
*** Equator Technologies, Inc.
*** Proprietary & Confidential
***
*** This source code and the algorithms implemented therein constitute
*** confidential information and may comprise trade secrets of Equator
*** or its associates, and any use thereof is subject to the terms and
*** conditions of the Non-Disclosure Agreement pursuant to which this
*** source code was originally received.
**/

#include "iicdebug.h"

void
iicdebug_memdump (volatile __uncached__ int *address, int nbytes)
{
#pragma unroll_amount 0
    while (nbytes > 0)
    {
        iicdebug_int32dump ('@', (int) address);
        iicdebug_putchar (':');
        iicdebug_putchar (' ');
        iicdebug_int32dump (' ', *address++);
        iicdebug_int32dump (' ', *address++);
        iicdebug_int32dump ('-', *address++);
        iicdebug_int32dump (' ', *address++);
        iicdebug_putchar ('\r');
        iicdebug_putchar ('\n');
        nbytes -= 16;
    }
}

void
iicdebug_puts (char *address)
{
    int c;

    if (address < (char *) 0x1800) address += 0xffe80000;
#pragma unroll_amount 0
    while ((c = *address++) != '\0')
    {
        iicdebug_putchar (c);
    }
}
