URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 297 |
Rev 384 |
// Contributed by Alexandre Oliva <aoliva@redhat.com>
|
// Contributed by Alexandre Oliva <aoliva@redhat.com>
|
// From Red Hat case 106165.
|
// From Red Hat case 106165.
|
|
|
typedef unsigned short (FUNC_P) (void *, unsigned char *, unsigned short);
|
typedef unsigned short (FUNC_P) (void *, unsigned char *, unsigned short);
|
|
|
void crashIt(int id, FUNC_P *func, unsigned char *funcparm)
|
void crashIt(int id, FUNC_P *func, unsigned char *funcparm)
|
{
|
{
|
unsigned char buff[5], reverse[4];
|
unsigned char buff[5], reverse[4];
|
unsigned char *bp = buff;
|
unsigned char *bp = buff;
|
unsigned char *rp = reverse;
|
unsigned char *rp = reverse;
|
unsigned short int count = 0;
|
unsigned short int count = 0;
|
unsigned short cnt;
|
unsigned short cnt;
|
while (id > 0)
|
while (id > 0)
|
{
|
{
|
*rp++ = (unsigned char) (id & 0x7F);
|
*rp++ = (unsigned char) (id & 0x7F);
|
id >>= 7;
|
id >>= 7;
|
count++;
|
count++;
|
}
|
}
|
cnt = count + 1;
|
cnt = count + 1;
|
while ((count--) > 1)
|
while ((count--) > 1)
|
{
|
{
|
*bp++ = (unsigned char)(*(--rp) | 0x80);
|
*bp++ = (unsigned char)(*(--rp) | 0x80);
|
}
|
}
|
*bp++ = *(--rp);
|
*bp++ = *(--rp);
|
(void)(*func)(funcparm, buff, cnt);
|
(void)(*func)(funcparm, buff, cnt);
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.