}
void
-errprintf(char *fmt, ...) {
+errprintf(char *fmt, ...)
+{
va_list arg;
char *p;
DWORD n, w;
* because we need die->offs and infoo/infosize;
*/
static int
-ispubname(DWDie *die) {
+ispubname(DWDie *die)
+{
DWAttr *a;
switch(die->abbrev) {
}
static int
-ispubtype(DWDie *die) {
+ispubtype(DWDie *die)
+{
return die->abbrev >= DW_ABRV_NULLTYPE;
}
}
uvlong
-amd64_uregSP(void) {
+amd64_uregSP(void)
+{
return ureg_amd64.sp;
}
#ifdef WIN32
#include <windows.h>
-static void crashhandler(int sig) {
+static void
+crashhandler(int sig)
+{
USED(sig);
fprint(2, "%s: internal fatal error.\n", argv0);
exit(1);
}
int
-isvalidcharntorune(const char* str, int length, Rune* rune, int* consumed) {
+isvalidcharntorune(const char* str, int length, Rune* rune, int* consumed)
+{
*consumed = charntorune(rune, str, length);
return *rune != Runeerror || *consumed == 3;
}
#include <u.h>
#include <libc.h>
-int fork()
+int
+fork(void)
{
return -1;
}
-int p9rfork(int flags)
+int
+p9rfork(int flags)
{
return -1;
}
-Waitmsg *p9wait()
+Waitmsg*
+p9wait(void)
{
return 0;
}
-int p9waitpid()
+int
+p9waitpid(void)
{
return -1;
}
* strcmp, but allow '_' to match center dot (rune 00b7 == bytes c2 b7)
*/
int
-cdotstrcmp(char *sym, char *user) {
+cdotstrcmp(char *sym, char *user)
+{
for (;;) {
while (*sym == *user) {
if (*sym++ == '\0')
void __aeabi_read_tp(void) __attribute__((naked));
void cgo_tls_set_gm(void) __attribute__((naked));
void cgo_tls_get_gm(void) __attribute__((naked));
-void __aeabi_read_tp(void) {
+
+void
+__aeabi_read_tp(void)
+{
// read @ 0xffff1000
__asm__ __volatile__ (
"ldr r0, =0xffff1000\n\t"
"mov pc, lr\n\t"
);
}
+
// g (R10) at 8(TP), m (R9) at 12(TP)
-void cgo_tls_get_gm(void) {
+void
+cgo_tls_get_gm(void)
+{
__asm__ __volatile__ (
"push {lr}\n\t"
"bl __aeabi_read_tp\n\t"
"pop {pc}\n\t"
);
}
-void cgo_tls_set_gm(void) {
+
+void
+cgo_tls_set_gm(void)
+{
__asm__ __volatile__ (
"push {lr}\n\t"
"bl __aeabi_read_tp\n\t"
"pop {pc}\n\t"
);
}
+
// both cgo_tls_{get,set}_gm can be called from runtime
void (*cgo_load_gm)(void) = cgo_tls_get_gm;
void (*cgo_save_gm)(void) = cgo_tls_set_gm;
void __aeabi_read_tp(void) __attribute__((naked));
void cgo_tls_set_gm(void) __attribute__((naked));
void cgo_tls_get_gm(void) __attribute__((naked));
-void __aeabi_read_tp(void) {
+
+void
+__aeabi_read_tp(void)
+{
// b __kuser_get_tls @ 0xffff0fe0
__asm__ __volatile__ (
"mvn r0, #0xf000\n\t"
"nop\n\tnop\n\t"
);
}
+
// g (R10) at 8(TP), m (R9) at 12(TP)
-void cgo_tls_get_gm(void) {
+void
+cgo_tls_get_gm(void)
+{
__asm__ __volatile__ (
"push {lr}\n\t"
"bl __aeabi_read_tp\n\t"
"pop {pc}\n\t"
);
}
-void cgo_tls_set_gm(void) {
+
+void
+cgo_tls_set_gm(void)
+{
__asm__ __volatile__ (
"push {lr}\n\t"
"bl __aeabi_read_tp\n\t"
"pop {pc}\n\t"
);
}
+
// both cgo_tls_{get,set}_gm can be called from runtime
void (*cgo_load_gm)(void) = cgo_tls_get_gm;
void (*cgo_save_gm)(void) = cgo_tls_set_gm;
void __aeabi_read_tp(void) __attribute__((naked));
void cgo_tls_set_gm(void) __attribute__((naked));
void cgo_tls_get_gm(void) __attribute__((naked));
-void __aeabi_read_tp(void) {
+
+void
+__aeabi_read_tp(void)
+{
// this function is only allowed to clobber r0
__asm__ __volatile__ (
"mrc p15, 0, r0, c13, c0, 3\n\t"
"mov pc, lr\n\t"
);
}
+
// g (R10) at 8(TP), m (R9) at 12(TP)
-void cgo_tls_get_gm(void) {
+void
+cgo_tls_get_gm(void)
+{
__asm__ __volatile__ (
"push {lr}\n\t"
"bl __aeabi_read_tp\n\t"
"pop {pc}\n\t"
);
}
-void cgo_tls_set_gm(void) {
+
+void
+cgo_tls_set_gm(void)
+{
__asm__ __volatile__ (
"push {lr}\n\t"
"bl __aeabi_read_tp\n\t"
"pop {pc}\n\t"
);
}
+
// both cgo_tls_{get,set}_gm can be called from runtime
void (*cgo_load_gm)(void) = cgo_tls_get_gm;
void (*cgo_save_gm)(void) = cgo_tls_set_gm;
// LostProfileData is a no-op function used in profiles
// to mark the number of profiling stack traces that were
// discarded due to slow data writers.
-static void LostProfileData(void) {
+static void
+LostProfileData(void)
+{
}
// SetCPUProfileRate sets the CPU profiling rate.
}
void
-runtime·racegoend()
+runtime·racegoend(void)
{
}
#pragma textflag 7
int64
-runtime·cputicks() {
+runtime·cputicks(void)
+{
// Currently cputicks() is used in blocking profiler and to seed runtime·fastrand1().
// runtime·nanotime() is a poor approximation of CPU ticks that is enough for the profiler.
// TODO: need more entropy to better seed fastrand1.
#pragma textflag 7
int64
-runtime·cputicks() {
+runtime·cputicks(void)
+{
// Currently cputicks() is used in blocking profiler and to seed runtime·fastrand1().
// runtime·nanotime() is a poor approximation of CPU ticks that is enough for the profiler.
// runtime·randomNumber provides better seeding of fastrand1.
{ (byte*)"__vdso_clock_gettime", &runtime·__vdso_clock_gettime_sym },
};
-static void vdso_init_from_sysinfo_ehdr(struct vdso_info *vdso_info, Elf64_Ehdr* hdr) {
+static void
+vdso_init_from_sysinfo_ehdr(struct vdso_info *vdso_info, Elf64_Ehdr* hdr)
+{
uint64 i;
bool found_vaddr = false;
vdso_info->valid = true;
}
-static int32 vdso_find_version(struct vdso_info *vdso_info, version_key* ver) {
+static int32
+vdso_find_version(struct vdso_info *vdso_info, version_key* ver)
+{
if(vdso_info->valid == false) {
return 0;
}
return 0;
}
-static void vdso_parse_symbols(struct vdso_info *vdso_info, int32 version) {
+static void
+vdso_parse_symbols(struct vdso_info *vdso_info, int32 version)
+{
int32 i, j;
if(vdso_info->valid == false)