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

« back to all changes in this revision

Viewing changes to src/pkg/runtime/sys_linux_386.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:
77
77
        CALL    *runtime·_vdso(SB)
78
78
        RET
79
79
 
80
 
TEXT runtime·raisesigpipe(SB),7,$12
 
80
TEXT runtime·raise(SB),7,$12
81
81
        MOVL    $224, AX        // syscall - gettid
82
82
        CALL    *runtime·_vdso(SB)
83
 
        MOVL    AX, 0(SP)       // arg 1 tid
84
 
        MOVL    $13, 4(SP)      // arg 2 SIGPIPE
 
83
        MOVL    AX, BX  // arg 1 tid
 
84
        MOVL    sig+0(FP), CX   // arg 2 signal
85
85
        MOVL    $238, AX        // syscall - tkill
86
86
        CALL    *runtime·_vdso(SB)
87
87
        RET
104
104
 
105
105
// func now() (sec int64, nsec int32)
106
106
TEXT time·now(SB), 7, $32
107
 
        MOVL    $78, AX                 // syscall - gettimeofday
108
 
        LEAL    8(SP), BX
109
 
        MOVL    $0, CX
 
107
        MOVL    $265, AX                        // syscall - clock_gettime
 
108
        MOVL    $0, BX
 
109
        LEAL    8(SP), CX
110
110
        MOVL    $0, DX
111
111
        CALL    *runtime·_vdso(SB)
112
112
        MOVL    8(SP), AX       // sec
113
 
        MOVL    12(SP), BX      // usec
 
113
        MOVL    12(SP), BX      // nsec
114
114
 
115
 
        // sec is in AX, usec in BX
 
115
        // sec is in AX, nsec in BX
116
116
        MOVL    AX, sec+0(FP)
117
117
        MOVL    $0, sec+4(FP)
118
 
        IMULL   $1000, BX
119
118
        MOVL    BX, nsec+8(FP)
120
119
        RET
121
120
 
122
121
// int64 nanotime(void) so really
123
122
// void nanotime(int64 *nsec)
124
123
TEXT runtime·nanotime(SB), 7, $32
125
 
        MOVL    $78, AX                 // syscall - gettimeofday
126
 
        LEAL    8(SP), BX
127
 
        MOVL    $0, CX
 
124
        MOVL    $265, AX                        // syscall - clock_gettime
 
125
        MOVL    $0, BX
 
126
        LEAL    8(SP), CX
128
127
        MOVL    $0, DX
129
128
        CALL    *runtime·_vdso(SB)
130
129
        MOVL    8(SP), AX       // sec
131
 
        MOVL    12(SP), BX      // usec
 
130
        MOVL    12(SP), BX      // nsec
132
131
 
133
 
        // sec is in AX, usec in BX
 
132
        // sec is in AX, nsec in BX
134
133
        // convert to DX:AX nsec
135
134
        MOVL    $1000000000, CX
136
135
        MULL    CX
137
 
        IMULL   $1000, BX
138
136
        ADDL    BX, AX
139
137
        ADCL    $0, DX
140
 
        
 
138
 
141
139
        MOVL    ret+0(FP), DI
142
140
        MOVL    AX, 0(DI)
143
141
        MOVL    DX, 4(DI)
170
168
        // check that m exists
171
169
        MOVL    m(CX), BX
172
170
        CMPL    BX, $0
173
 
        JNE     2(PC)
 
171
        JNE     5(PC)
 
172
        MOVL    sig+0(FP), BX
 
173
        MOVL    BX, 0(SP)
174
174
        CALL    runtime·badsignal(SB)
 
175
        RET
175
176
 
176
177
        // save g
177
178
        MOVL    g(CX), DI
240
241
        MOVL    8(SP), CX
241
242
        MOVL    12(SP), DX
242
243
        CALL    *runtime·_vdso(SB)
243
 
        CMPL    AX, $0xfffff001
244
 
        JLS     2(PC)
245
 
        INT $3
 
244
        // ignore failure - maybe pages are locked
246
245
        RET
247
246
 
248
247
// int32 futex(int32 *uaddr, int32 op, int32 val,
258
257
        CALL    *runtime·_vdso(SB)
259
258
        RET
260
259
 
261
 
// int32 clone(int32 flags, void *stack, M *m, G *g, void (*fn)(void));
 
260
// int32 clone(int32 flags, void *stack, M *mp, G *gp, void (*fn)(void));
262
261
TEXT runtime·clone(SB),7,$0
263
262
        MOVL    $120, AX        // clone
264
263
        MOVL    flags+4(SP), BX
266
265
        MOVL    $0, DX  // parent tid ptr
267
266
        MOVL    $0, DI  // child tid ptr
268
267
 
269
 
        // Copy m, g, fn off parent stack for use by child.
 
268
        // Copy mp, gp, fn off parent stack for use by child.
270
269
        SUBL    $16, CX
271
270
        MOVL    mm+12(SP), SI
272
271
        MOVL    SI, 0(CX)
423
422
        MOVL    $158, AX
424
423
        CALL    *runtime·_vdso(SB)
425
424
        RET
 
425
 
 
426
TEXT runtime·sched_getaffinity(SB),7,$0
 
427
        MOVL    $242, AX                // syscall - sched_getaffinity
 
428
        MOVL    4(SP), BX
 
429
        MOVL    8(SP), CX
 
430
        MOVL    12(SP), DX
 
431
        CALL    *runtime·_vdso(SB)
 
432
        RET
 
433
 
 
434
// int32 runtime·epollcreate(int32 size);
 
435
TEXT runtime·epollcreate(SB),7,$0
 
436
        MOVL    $254, AX
 
437
        MOVL    4(SP), BX
 
438
        CALL    *runtime·_vdso(SB)
 
439
        RET
 
440
 
 
441
// int32 runtime·epollcreate1(int32 flags);
 
442
TEXT runtime·epollcreate1(SB),7,$0
 
443
        MOVL    $329, AX
 
444
        MOVL    4(SP), BX
 
445
        CALL    *runtime·_vdso(SB)
 
446
        RET
 
447
 
 
448
// int32 runtime·epollctl(int32 epfd, int32 op, int32 fd, EpollEvent *ev);
 
449
TEXT runtime·epollctl(SB),7,$0
 
450
        MOVL    $255, AX
 
451
        MOVL    4(SP), BX
 
452
        MOVL    8(SP), CX
 
453
        MOVL    12(SP), DX
 
454
        MOVL    16(SP), SI
 
455
        CALL    *runtime·_vdso(SB)
 
456
        RET
 
457
 
 
458
// int32 runtime·epollwait(int32 epfd, EpollEvent *ev, int32 nev, int32 timeout);
 
459
TEXT runtime·epollwait(SB),7,$0
 
460
        MOVL    $256, AX
 
461
        MOVL    4(SP), BX
 
462
        MOVL    8(SP), CX
 
463
        MOVL    12(SP), DX
 
464
        MOVL    16(SP), SI
 
465
        CALL    *runtime·_vdso(SB)
 
466
        RET
 
467
 
 
468
// void runtime·closeonexec(int32 fd);
 
469
TEXT runtime·closeonexec(SB),7,$0
 
470
        MOVL    $55, AX  // fcntl
 
471
        MOVL    4(SP), BX  // fd
 
472
        MOVL    $2, CX  // F_SETFD
 
473
        MOVL    $1, DX  // FD_CLOEXEC
 
474
        CALL    *runtime·_vdso(SB)
 
475
        RET