5 static inline int mystrlen(char *s
) {
13 char s
[] = "passed.\n";
14 write (1, s
, sizeof (s
) - 1);
18 void _fail(char *reason
) {
19 char s
[] = "\nfailed: ";
20 int len
= mystrlen(reason
);
21 write (1, s
, sizeof (s
) - 1);
22 write (1, reason
, len
);
27 void *memset (void *s
, int c
, size_t n
) {
30 for (i
= 0; i
< n
; i
++)
35 void exit (int status
) {
36 asm volatile ("moveq 1, $r9\n" /* NR_exit. */
42 ssize_t
write (int fd
, const void *buf
, size_t count
) {
44 asm ("move.d %0, $r10\n"
47 "moveq 4, $r9\n" /* NR_write. */
48 "break 13\n" : : "r" (fd
), "r" (buf
), "r" (count
) : "memory");
49 asm ("move.d $r10, %0\n" : "=r" (r
));