github.com/yanyiwu/go@v0.0.0-20150106053140-03d6637dbb7f/src/cmd/9g/galign.c (about) 1 // Copyright 2009 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 #include <u.h> 6 #include <libc.h> 7 #include "gg.h" 8 9 int thechar = '9'; 10 char* thestring = "ppc64"; 11 LinkArch* thelinkarch; 12 13 void 14 linkarchinit(void) 15 { 16 thestring = getgoarch(); 17 if(strcmp(thestring, "ppc64le") == 0) 18 thelinkarch = &linkppc64le; 19 else 20 thelinkarch = &linkppc64; 21 } 22 23 vlong MAXWIDTH = 1LL<<50; 24 25 /* 26 * go declares several platform-specific type aliases: 27 * int, uint, float, and uintptr 28 */ 29 Typedef typedefs[] = 30 { 31 {"int", TINT, TINT64}, 32 {"uint", TUINT, TUINT64}, 33 {"uintptr", TUINTPTR, TUINT64}, 34 {0} 35 }; 36 37 void 38 betypeinit(void) 39 { 40 widthptr = 8; 41 widthint = 8; 42 widthreg = 8; 43 44 zprog.link = P; 45 zprog.as = AGOK; 46 zprog.reg = NREG; 47 zprog.from.name = D_NONE; 48 zprog.from.type = D_NONE; 49 zprog.from.reg = NREG; 50 zprog.to = zprog.from; 51 zprog.from3 = zprog.from; 52 53 listinit9(); 54 }