From c007ce824d9a4fccb148f9204e04c23ed2984b71 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 8 Sep 2014 00:08:51 -0400 Subject: build: move package sources from src/pkg to src Preparation was in CL 134570043. This CL contains only the effect of 'hg mv src/pkg/* src'. For more about the move, see golang.org/s/go14nopkg. --- src/pkg/runtime/runtime.c | 391 ---------------------------------------------- 1 file changed, 391 deletions(-) delete mode 100644 src/pkg/runtime/runtime.c (limited to 'src/pkg/runtime/runtime.c') diff --git a/src/pkg/runtime/runtime.c b/src/pkg/runtime/runtime.c deleted file mode 100644 index 42ce1dadfb..0000000000 --- a/src/pkg/runtime/runtime.c +++ /dev/null @@ -1,391 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -#include "runtime.h" -#include "stack.h" -#include "arch_GOARCH.h" -#include "textflag.h" - -// Keep a cached value to make gotraceback fast, -// since we call it on every call to gentraceback. -// The cached value is a uint32 in which the low bit -// is the "crash" setting and the top 31 bits are the -// gotraceback value. -static uint32 traceback_cache = 2<<1; - -// The GOTRACEBACK environment variable controls the -// behavior of a Go program that is crashing and exiting. -// GOTRACEBACK=0 suppress all tracebacks -// GOTRACEBACK=1 default behavior - show tracebacks but exclude runtime frames -// GOTRACEBACK=2 show tracebacks including runtime frames -// GOTRACEBACK=crash show tracebacks including runtime frames, then crash (core dump etc) -#pragma textflag NOSPLIT -int32 -runtime·gotraceback(bool *crash) -{ - if(crash != nil) - *crash = false; - if(g->m->traceback != 0) - return g->m->traceback; - if(crash != nil) - *crash = traceback_cache&1; - return traceback_cache>>1; -} - -int32 -runtime·mcmp(byte *s1, byte *s2, uintptr n) -{ - uintptr i; - byte c1, c2; - - for(i=0; i c2) - return +1; - } - return 0; -} - - -byte* -runtime·mchr(byte *p, byte c, byte *ep) -{ - for(; p < ep; p++) - if(*p == c) - return p; - return nil; -} - -static int32 argc; -static uint8** argv; - -Slice os·Args; -Slice syscall·envs; - -void (*runtime·sysargs)(int32, uint8**); - -void -runtime·args(int32 c, uint8 **v) -{ - argc = c; - argv = v; - if(runtime·sysargs != nil) - runtime·sysargs(c, v); -} - -int32 runtime·isplan9; -int32 runtime·issolaris; -int32 runtime·iswindows; - -// Information about what cpu features are available. -// Set on startup in asm_{x86/amd64}.s. -uint32 runtime·cpuid_ecx; -uint32 runtime·cpuid_edx; - -void -runtime·goargs(void) -{ - String *s; - int32 i; - - // for windows implementation see "os" package - if(Windows) - return; - - s = runtime·mallocgc(argc*sizeof s[0], nil, 0); - for(i=0; i= 0; bit--) { - if(v >= ((int64)div<= (int64)div) { - if(rem != nil) - *rem = 0; - return 0x7fffffff; - } - if(rem != nil) - *rem = v; - return res; -} - -// Helpers for Go. Must be NOSPLIT, must only call NOSPLIT functions, and must not block. - -#pragma textflag NOSPLIT -G* -runtime·getg(void) -{ - return g; -} - -#pragma textflag NOSPLIT -M* -runtime·acquirem(void) -{ - g->m->locks++; - return g->m; -} - -#pragma textflag NOSPLIT -void -runtime·releasem(M *mp) -{ - mp->locks--; - if(mp->locks == 0 && g->preempt) { - // restore the preemption request in case we've cleared it in newstack - g->stackguard0 = StackPreempt; - } -} - -#pragma textflag NOSPLIT -MCache* -runtime·gomcache(void) -{ - return g->m->mcache; -} - -#pragma textflag NOSPLIT -Slice -reflect·typelinks(void) -{ - extern Type *runtime·typelink[], *runtime·etypelink[]; - Slice ret; - - ret.array = (byte*)runtime·typelink; - ret.len = runtime·etypelink - runtime·typelink; - ret.cap = ret.len; - return ret; -} -- cgit v1.3-5-g9baa