Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../lib/golang/src/runtime/cgo
File: libcgo.h
// Copyright 2009 The Go Authors. All rights reserved.
[0] Fix | Delete
// Use of this source code is governed by a BSD-style
[1] Fix | Delete
// license that can be found in the LICENSE file.
[2] Fix | Delete
[3] Fix | Delete
#include <stdint.h>
[4] Fix | Delete
#include <stdlib.h>
[5] Fix | Delete
#include <stdio.h>
[6] Fix | Delete
[7] Fix | Delete
#undef nil
[8] Fix | Delete
#define nil ((void*)0)
[9] Fix | Delete
#define nelem(x) (sizeof(x)/sizeof((x)[0]))
[10] Fix | Delete
[11] Fix | Delete
typedef uint32_t uint32;
[12] Fix | Delete
typedef uint64_t uint64;
[13] Fix | Delete
typedef uintptr_t uintptr;
[14] Fix | Delete
[15] Fix | Delete
/*
[16] Fix | Delete
* The beginning of the per-goroutine structure,
[17] Fix | Delete
* as defined in ../pkg/runtime/runtime.h.
[18] Fix | Delete
* Just enough to edit these two fields.
[19] Fix | Delete
*/
[20] Fix | Delete
typedef struct G G;
[21] Fix | Delete
struct G
[22] Fix | Delete
{
[23] Fix | Delete
uintptr stacklo;
[24] Fix | Delete
uintptr stackhi;
[25] Fix | Delete
};
[26] Fix | Delete
[27] Fix | Delete
/*
[28] Fix | Delete
* Arguments to the _cgo_thread_start call.
[29] Fix | Delete
* Also known to ../pkg/runtime/runtime.h.
[30] Fix | Delete
*/
[31] Fix | Delete
typedef struct ThreadStart ThreadStart;
[32] Fix | Delete
struct ThreadStart
[33] Fix | Delete
{
[34] Fix | Delete
G *g;
[35] Fix | Delete
uintptr *tls;
[36] Fix | Delete
void (*fn)(void);
[37] Fix | Delete
};
[38] Fix | Delete
[39] Fix | Delete
/*
[40] Fix | Delete
* Called by 5c/6c/8c world.
[41] Fix | Delete
* Makes a local copy of the ThreadStart and
[42] Fix | Delete
* calls _cgo_sys_thread_start(ts).
[43] Fix | Delete
*/
[44] Fix | Delete
extern void (*_cgo_thread_start)(ThreadStart *ts);
[45] Fix | Delete
[46] Fix | Delete
/*
[47] Fix | Delete
* Creates a new operating system thread without updating any Go state
[48] Fix | Delete
* (OS dependent).
[49] Fix | Delete
*/
[50] Fix | Delete
extern void (*_cgo_sys_thread_create)(void* (*func)(void*), void* arg);
[51] Fix | Delete
[52] Fix | Delete
/*
[53] Fix | Delete
* Indicates whether a dummy pthread per-thread variable is allocated.
[54] Fix | Delete
*/
[55] Fix | Delete
extern uintptr_t *_cgo_pthread_key_created;
[56] Fix | Delete
[57] Fix | Delete
/*
[58] Fix | Delete
* Creates the new operating system thread (OS, arch dependent).
[59] Fix | Delete
*/
[60] Fix | Delete
void _cgo_sys_thread_start(ThreadStart *ts);
[61] Fix | Delete
[62] Fix | Delete
/*
[63] Fix | Delete
* Waits for the Go runtime to be initialized (OS dependent).
[64] Fix | Delete
* If runtime.SetCgoTraceback is used to set a context function,
[65] Fix | Delete
* calls the context function and returns the context value.
[66] Fix | Delete
*/
[67] Fix | Delete
uintptr_t _cgo_wait_runtime_init_done(void);
[68] Fix | Delete
[69] Fix | Delete
/*
[70] Fix | Delete
* Call fn in the 6c world.
[71] Fix | Delete
*/
[72] Fix | Delete
void crosscall_amd64(void (*fn)(void), void (*setg_gcc)(void*), void *g);
[73] Fix | Delete
[74] Fix | Delete
/*
[75] Fix | Delete
* Call fn in the 8c world.
[76] Fix | Delete
*/
[77] Fix | Delete
void crosscall_386(void (*fn)(void));
[78] Fix | Delete
[79] Fix | Delete
/*
[80] Fix | Delete
* Prints error then calls abort. For linux and android.
[81] Fix | Delete
*/
[82] Fix | Delete
void fatalf(const char* format, ...);
[83] Fix | Delete
[84] Fix | Delete
/*
[85] Fix | Delete
* Registers the current mach thread port for EXC_BAD_ACCESS processing.
[86] Fix | Delete
*/
[87] Fix | Delete
void darwin_arm_init_thread_exception_port(void);
[88] Fix | Delete
[89] Fix | Delete
/*
[90] Fix | Delete
* Starts a mach message server processing EXC_BAD_ACCESS.
[91] Fix | Delete
*/
[92] Fix | Delete
void darwin_arm_init_mach_exception_handler(void);
[93] Fix | Delete
[94] Fix | Delete
/*
[95] Fix | Delete
* The cgo context function. See runtime.SetCgoTraceback.
[96] Fix | Delete
*/
[97] Fix | Delete
struct context_arg {
[98] Fix | Delete
uintptr_t Context;
[99] Fix | Delete
};
[100] Fix | Delete
extern void (*(_cgo_get_context_function(void)))(struct context_arg*);
[101] Fix | Delete
[102] Fix | Delete
/*
[103] Fix | Delete
* The argument for the cgo traceback callback. See runtime.SetCgoTraceback.
[104] Fix | Delete
*/
[105] Fix | Delete
struct cgoTracebackArg {
[106] Fix | Delete
uintptr_t Context;
[107] Fix | Delete
uintptr_t SigContext;
[108] Fix | Delete
uintptr_t* Buf;
[109] Fix | Delete
uintptr_t Max;
[110] Fix | Delete
};
[111] Fix | Delete
[112] Fix | Delete
/*
[113] Fix | Delete
* TSAN support. This is only useful when building with
[114] Fix | Delete
* CGO_CFLAGS="-fsanitize=thread" CGO_LDFLAGS="-fsanitize=thread" go install
[115] Fix | Delete
*/
[116] Fix | Delete
#undef CGO_TSAN
[117] Fix | Delete
#if defined(__has_feature)
[118] Fix | Delete
# if __has_feature(thread_sanitizer)
[119] Fix | Delete
# define CGO_TSAN
[120] Fix | Delete
# endif
[121] Fix | Delete
#elif defined(__SANITIZE_THREAD__)
[122] Fix | Delete
# define CGO_TSAN
[123] Fix | Delete
#endif
[124] Fix | Delete
[125] Fix | Delete
#ifdef CGO_TSAN
[126] Fix | Delete
[127] Fix | Delete
// These must match the definitions in yesTsanProlog in cmd/cgo/out.go.
[128] Fix | Delete
// In general we should call _cgo_tsan_acquire when we enter C code,
[129] Fix | Delete
// and call _cgo_tsan_release when we return to Go code.
[130] Fix | Delete
// This is only necessary when calling code that might be instrumented
[131] Fix | Delete
// by TSAN, which mostly means system library calls that TSAN intercepts.
[132] Fix | Delete
// See the comment in cmd/cgo/out.go for more details.
[133] Fix | Delete
[134] Fix | Delete
long long _cgo_sync __attribute__ ((common));
[135] Fix | Delete
[136] Fix | Delete
extern void __tsan_acquire(void*);
[137] Fix | Delete
extern void __tsan_release(void*);
[138] Fix | Delete
[139] Fix | Delete
__attribute__ ((unused))
[140] Fix | Delete
static void _cgo_tsan_acquire() {
[141] Fix | Delete
__tsan_acquire(&_cgo_sync);
[142] Fix | Delete
}
[143] Fix | Delete
[144] Fix | Delete
__attribute__ ((unused))
[145] Fix | Delete
static void _cgo_tsan_release() {
[146] Fix | Delete
__tsan_release(&_cgo_sync);
[147] Fix | Delete
}
[148] Fix | Delete
[149] Fix | Delete
#else // !defined(CGO_TSAN)
[150] Fix | Delete
[151] Fix | Delete
#define _cgo_tsan_acquire()
[152] Fix | Delete
#define _cgo_tsan_release()
[153] Fix | Delete
[154] Fix | Delete
#endif // !defined(CGO_TSAN)
[155] Fix | Delete
[156] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function