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 register unsigned int callno
asm ("r9") = 1; /* NR_exit */
38 asm volatile ("break 13\n"
46 ssize_t
write (int fd
, const void *buf
, size_t count
) {
47 register unsigned int callno
asm ("r9") = 4; /* NR_write */
48 register unsigned int r10
asm ("r10") = fd
;
49 register const void *r11
asm ("r11") = buf
;
50 register size_t r12
asm ("r12") = count
;
51 register unsigned int r
asm ("r10");
53 asm volatile ("break 13\n"
55 : "r" (callno
), "0" (r10
), "r" (r11
), "r" (r12
)