OpceanAI's picture
Model card, paper, figures, logs and scripts
2049fc8 verified
Raw History Blame Contribute Delete
538 Bytes
typedef unsigned long size_t;
void *memset(void *s, int c, size_t n) {
unsigned char *p = (unsigned char *)s;
while (n--) *p++ = (unsigned char)c;
return s;
}
void *memcpy(void *d, const void *s, size_t n) {
unsigned char *a = (unsigned char *)d;
const unsigned char *b = (const unsigned char *)s;
while (n--) *a++ = *b++;
return d;
}
void exit(int code) {
register long a0 __asm__("a0") = code;
register long a7 __asm__("a7") = 93;
__asm__ volatile("ecall" :: "r"(a0), "r"(a7));
for (;;) {}
}