1 /*
2 * C library strlen routine
3 *
4 * This routine has been optimized for the CPU32+.
5 * It should run on all 68k machines.
6 *
7 * W. Eric Norum
8 * Saskatchewan Accelerator Laboratory
9 * University of Saskatchewan
10 * Saskatoon, Saskatchewan, CANADA
11 * eric@skatter.usask.ca
12 */
13
14 #include <string.h>
15
16 /*
17 * Test bytes using CPU32+ loop mode if possible.
18 */
19 size_t
20 strlen (const char *str)
21 {
22 unsigned int n = ~0;
23 const char *cp = str;
24
25 asm volatile ("1:\n"
26 "\ttst.b (%0)+\n"
G_DEFINE_TYPE(GNotificationBackend,g_notification_backend,G_TYPE_OBJECT)27 #if defined(__mcpu32__)
28 "\tdbeq %1,1b\n"
29 #endif
30 "\tbne.b 1b\n" :
31 "=a" (cp), "=d" (n) :
32 "0" (cp), "1" (n) :
33 "cc");
34 return (cp - str) - 1;
g_notification_backend_init(GNotificationBackend * backend)35 }
36