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

« back to all changes in this revision

Viewing changes to src/pkg/runtime/cgo/gcc_windows_386.c

  • 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:
4
4
 
5
5
#define WIN32_LEAN_AND_MEAN
6
6
#include <windows.h>
 
7
#include <process.h>
7
8
#include "libcgo.h"
8
9
 
9
 
static void *threadentry(void*);
 
10
static void threadentry(void*);
10
11
 
11
12
/* 1MB is default stack size for 32-bit Windows.
12
13
   Allocation granularity on Windows is typically 64 KB.
13
14
   The constant is also hardcoded in cmd/ld/pe.c (keep synchronized). */
14
15
#define STACKSIZE (1*1024*1024)
15
16
 
16
 
static void
17
 
xinitcgo(G *g)
 
17
void
 
18
x_cgo_init(G *g)
18
19
{
19
20
        int tmp;
20
21
        g->stackguard = (uintptr)&tmp - STACKSIZE + 8*1024;
21
22
}
22
23
 
23
 
void (*initcgo)(G*) = xinitcgo;
24
24
 
25
25
void
26
 
libcgo_sys_thread_start(ThreadStart *ts)
 
26
_cgo_sys_thread_start(ThreadStart *ts)
27
27
{
28
28
        _beginthread(threadentry, 0, ts);
29
29
}
30
30
 
31
 
static void*
 
31
static void
32
32
threadentry(void *v)
33
33
{
34
34
        ThreadStart ts;
55
55
        crosscall_386(ts.fn);
56
56
        
57
57
        LocalFree(tls0);
58
 
        return nil;
59
58
}