OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [lib/] [libbsp/] [i960/] [rxgen960/] [startup/] [sctns.c] - Diff between revs 30 and 173

Only display areas with differences | Details | Blame | View Log

Rev 30 Rev 173
/*-------------------------------------*/
/*-------------------------------------*/
/* sctns.c                             */
/* sctns.c                             */
/* Last change : 10.10.94              */
/* Last change : 10.10.94              */
/*-------------------------------------*/
/*-------------------------------------*/
/*
/*
 *  $Id: sctns.c,v 1.2 2001-09-27 11:59:59 chris Exp $
 *  $Id: sctns.c,v 1.2 2001-09-27 11:59:59 chris Exp $
 */
 */
 
 
#include "sctns.h"
#include "sctns.h"
#include "pmc901_memmap.h"
#include "pmc901_memmap.h"
/*#include "led.h"*/
/*#include "led.h"*/
/*-------------------------------------*/
/*-------------------------------------*/
 
 
/* Temporary nullation of WRITE LED */
/* Temporary nullation of WRITE LED */
#define WRITE_LED(x) errval =  x;
#define WRITE_LED(x) errval =  x;
void ledcyc()
void ledcyc()
{
{
        register int i,t;
        register int i,t;
        extern unsigned char * led_array;
        extern unsigned char * led_array;
        register unsigned char * la;
        register unsigned char * la;
        volatile register int k,m;
        volatile register int k,m;
        la = led_array;
        la = led_array;
   i = 1;
   i = 1;
loop:
loop:
        if (i > 9 )
        if (i > 9 )
                i = 1;
                i = 1;
        *(unsigned char *) LED_REG = la[i];
        *(unsigned char *) LED_REG = la[i];
        for(t=1; t < 0x10000; t++)
        for(t=1; t < 0x10000; t++)
                k = m + 33;
                k = m + 33;
        i++;
        i++;
        goto loop;
        goto loop;
}
}
 
 
void copyCodeToRom(void)
void copyCodeToRom(void)
{
{
  register int errval = 0;
  register int errval = 0;
  unsigned int * s;
  unsigned int * s;
  volatile unsigned int * d;
  volatile unsigned int * d;
  unsigned int t, i;
  unsigned int t, i;
  volatile unsigned char * z;
  volatile unsigned char * z;
extern unsigned char * led_array;
extern unsigned char * led_array;
 
 
  WRITE_LED(0x1);
  WRITE_LED(0x1);
  d = codeRamStart;
  d = codeRamStart;
  *d = 0;
  *d = 0;
  if( *d != 0)
  if( *d != 0)
        goto error;
        goto error;
  WRITE_LED(0x2);
  WRITE_LED(0x2);
  *d = 0xffffffff;
  *d = 0xffffffff;
  if( *d != 0xffffffff)
  if( *d != 0xffffffff)
        goto error;
        goto error;
  WRITE_LED(0x3);
  WRITE_LED(0x3);
  t = 1;
  t = 1;
  for( i=0; i < 31; i++){
  for( i=0; i < 31; i++){
        *d = t;
        *d = t;
        if(*d != t)
        if(*d != t)
                goto error;
                goto error;
        t <<= 1;
        t <<= 1;
  }
  }
  z = (unsigned char *)codeRamStart;
  z = (unsigned char *)codeRamStart;
  *z = 0;
  *z = 0;
  if( *z != 0)
  if( *z != 0)
        goto error;
        goto error;
  *z = 0xf;
  *z = 0xf;
  if( *z != 0xf)
  if( *z != 0xf)
        goto error;
        goto error;
  WRITE_LED(0x4);
  WRITE_LED(0x4);
  for (s = codeRomStart, d = codeRamStart; d < codeRamEnd; s ++, d ++)  {
  for (s = codeRomStart, d = codeRamStart; d < codeRamEnd; s ++, d ++)  {
    * d = * s;
    * d = * s;
  }
  }
  WRITE_LED(0x5);
  WRITE_LED(0x5);
  for (s = codeRomStart, d = codeRamStart; d < codeRamEnd; s ++, d ++)  {
  for (s = codeRomStart, d = codeRamStart; d < codeRamEnd; s ++, d ++)  {
    if( * d != * s )
    if( * d != * s )
        goto error;
        goto error;
  }
  }
  WRITE_LED(0x6);
  WRITE_LED(0x6);
  return;
  return;
 
 
error:
error:
  while(1){
  while(1){
        for(t=1; t < 0x100000; t++)
        for(t=1; t < 0x100000; t++)
                *(unsigned char *) LED_REG = errval;
                *(unsigned char *) LED_REG = errval;
        for(t=1; t < 0x100000; t++)
        for(t=1; t < 0x100000; t++)
                *(unsigned char *) LED_REG = led_array[0];
                *(unsigned char *) LED_REG = led_array[0];
   }
   }
 
 
}
}
void zeroBss(void)
void zeroBss(void)
{
{
  unsigned int * p;
  unsigned int * p;
 
 
  extern unsigned int bssStart_1[], bssEnd_1[];
  extern unsigned int bssStart_1[], bssEnd_1[];
 
 
  for (p = bssStart; p < bssEnd; p ++)  {
  for (p = bssStart; p < bssEnd; p ++)  {
    * p = 0;
    * p = 0;
  }
  }
  for (p = bssStart_1; p < bssEnd_1; p ++)  {
  for (p = bssStart_1; p < bssEnd_1; p ++)  {
    * p = 0;
    * p = 0;
  }
  }
}
}
/*-------------*/
/*-------------*/
/* End of file */
/* End of file */
/*-------------*/
/*-------------*/
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.