Home | History | Annotate | Download | only in runtime
      1 // Copyright 2013 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 "textflag.h"
      6 
      7 // NaCl entry on 32-bit x86 has DI pointing at the arg block, which contains:
      8 //
      9 //	0(DI) - cleanup function pointer, always 0
     10 //	4(DI) - envc
     11 //	8(DI) - argc
     12 //	12(DI) - argv, then 0, then envv, then 0, then auxv
     13 // NaCl entry here is almost the same, except that there
     14 // is no saved caller PC, so 0(FP) is -8(FP) and so on.
     15 TEXT _rt0_amd64p32_nacl(SB),NOSPLIT,$16
     16 	MOVL	DI, 0(SP)
     17 	CALL	runtimenacl_sysinfo(SB)
     18 	MOVL	0(SP), DI
     19 	MOVL	8(DI), AX
     20 	LEAL	12(DI), BX
     21 	MOVL	AX, 0(SP)
     22 	MOVL	BX, 4(SP)
     23 	CALL	main(SB)
     24 	INT	$3
     25 
     26 TEXT main(SB),NOSPLIT,$0
     27 	// Uncomment for fake time like on Go Playground.
     28 	//MOVQ	$1257894000000000000, AX
     29 	//MOVQ	AX, runtimefaketime(SB)
     30 	JMP	runtimert0_go(SB)
     31