BSP for MIPS32 4KC

mikeci at acm.org mikeci at acm.org
Wed Sep 10 17:21:30 UTC 2003


Hi!

Here are the CPU_FLAGS which work for me:

CPU_CFLAGS = -O0 -G0 -EL -msoft-float -mips32 -Wl,-r,-EL


MIPS32 is 32 bit arhitecture, so all registers are 32 bit. So code looks
something like this (example):

unsigned32 _CPU_ISR_Get_level( void )
{
  unsigned int sr;

  mips_get_sr(sr);

  //printf("current sr=%08X, ",sr);

#if (__mips == 3) || (__mips == 32)
/* IE bit and shift down hardware ints into bits 1 thru 6 */
  sr = (sr & SR_IE) | ((sr & 0xfc00) >> 9);

#elif __mips == 1
/* IEC bit and shift down hardware ints into bits 1 thru 6 */
  sr = (sr & SR_IEC) | ((sr & 0xfc00) >> 9);

#else
#error "CPU ISR level: unknown MIPS level for SR handling"
#endif
  //printf("intlevel=%02X\n",sr);
  return sr;
}

This way you can generaly support MIPS32, and in the same time support
other MIPS arhitectures.

I agree that we can discuss this concept in more details, and that it is
not possible to support each and every MIPS CPU.


Regards

Ivica





More information about the users mailing list