/* Work out how must of the buffer we used */
*needed = ptr - buff;
if (ptr > end)
- return -1;
+ return -ENOSPC;
+
return 0;
}
/* Work out how must of the buffer we used */
*needed = ptr - buff;
if (ptr > end)
- return -1;
+ return -ENOSPC;
+
return 0;
}
memcpy(buff, hdr, used);
#else
puts("trace: already enabled\n");
- return -1;
+ return -EALREADY;
#endif
}
hdr = (struct trace_hdr *)buff;
if (needed > buff_size) {
printf("trace: buffer size %zd bytes: at least %zd needed\n",
buff_size, needed);
- return -1;
+ return -ENOSPC;
}
if (was_disabled)
hdr->depth_limit = 15;
trace_enabled = 1;
trace_inited = 1;
+
return 0;
}
if (needed > buff_size) {
printf("trace: buffer size is %zd bytes, at least %zd needed\n",
buff_size, needed);
- return -1;
+ return -ENOSPC;
}
memset(hdr, '\0', needed);
printf("trace: early enable at %08x\n", CONFIG_TRACE_EARLY_ADDR);
trace_enabled = 1;
+
return 0;
}
#endif