~ubuntu-branches/ubuntu/vivid/golang/vivid

« back to all changes in this revision

Viewing changes to src/pkg/runtime/cgo/asm_amd64.s

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2013-08-20 14:06:23 UTC
  • mfrom: (14.1.23 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130820140623-b414jfxi3m0qkmrq
Tags: 2:1.1.2-2ubuntu1
* Merge from Debian unstable (LP: #1211749, #1202027). Remaining changes:
  - 016-armhf-elf-header.patch: Use correct ELF header for armhf binaries.
  - d/control,control.cross: Update Breaks/Replaces for Ubuntu
    versions to ensure smooth upgrades, regenerate control file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
/*
 
6
 * void crosscall2(void (*fn)(void*, int32), void*, int32)
 
7
 * Save registers and call fn with two arguments.
 
8
 */
 
9
TEXT crosscall2(SB),7,$0
 
10
        SUBQ    $0x58, SP       /* keeps stack pointer 32-byte aligned */
 
11
        MOVQ    BX, 0x10(SP)
 
12
        MOVQ    BP, 0x18(SP)
 
13
        MOVQ    R12, 0x20(SP)
 
14
        MOVQ    R13, 0x28(SP)
 
15
        MOVQ    R14, 0x30(SP)
 
16
        MOVQ    R15, 0x38(SP)
 
17
 
 
18
#ifdef GOOS_windows
 
19
        // Win64 save RBX, RBP, RDI, RSI, RSP, R12, R13, R14, and R15
 
20
        MOVQ    DI, 0x40(SP)
 
21
        MOVQ    SI, 0x48(SP)
 
22
 
 
23
        MOVQ    DX, 0(SP)       /* arg */
 
24
        MOVQ    R8, 8(SP)       /* argsize (includes padding) */
 
25
        
 
26
        CALL    CX      /* fn */
 
27
        
 
28
        MOVQ    0x40(SP), DI
 
29
        MOVQ    0x48(SP), SI
 
30
#else
 
31
        MOVQ    SI, 0(SP)       /* arg */
 
32
        MOVQ    DX, 8(SP)       /* argsize (includes padding) */
 
33
 
 
34
        CALL    DI      /* fn */
 
35
#endif
 
36
 
 
37
        MOVQ    0x10(SP), BX
 
38
        MOVQ    0x18(SP), BP
 
39
        MOVQ    0x20(SP), R12
 
40
        MOVQ    0x28(SP), R13
 
41
        MOVQ    0x30(SP), R14
 
42
        MOVQ    0x38(SP), R15
 
43
        
 
44
        ADDQ    $0x58, SP
 
45
        RET