Skip to content

Commit 484bff1

Browse files
committed
---
yaml --- r: 139244 b: refs/heads/try2 c: ef282db h: refs/heads/master v: v3
1 parent 030c99a commit 484bff1

File tree

10 files changed

+258
-127
lines changed

10 files changed

+258
-127
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 30d4124a374489de1776eb1b8076ca533041fa18
8+
refs/heads/try2: ef282dbe2af9c6afc89776df177a750a1784853a
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/configure

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,17 @@ validate_opt () {
136136
isArgValid=1
137137
fi
138138
done
139-
if test $isArgValid -eq 0
139+
if [ "$arg" = "--help" ]
140140
then
141-
err "Option '$arg' is not recognized"
141+
echo ""
142+
echo "No more help available for Configure options,"
143+
echo "check the Uncyclo or join our IRC channel"
144+
break
145+
else
146+
if test $isArgValid -eq 0
147+
then
148+
err "Option '$arg' is not recognized"
149+
fi
142150
fi
143151
done
144152
}
@@ -266,13 +274,42 @@ case $CFG_OSTYPE in
266274
MINGW32*)
267275
CFG_OSTYPE=pc-mingw32
268276
;;
277+
# Thad's Cygwin identifers below
278+
279+
# Vista 32 bit
280+
CYGWIN_NT-6.0)
281+
CFG_OSTYPE=pc-mingw32
282+
CFG_CPUTYPE=i686
283+
;;
284+
285+
# Vista 64 bit
286+
CYGWIN_NT-6.0-WOW64)
287+
CFG_OSTYPE=w64-mingw32
288+
CFG_CPUTYPE=x86_64
289+
;;
290+
291+
# Win 7 32 bit
292+
CYGWIN_NT-6.1)
293+
CFG_OSTYPE=pc-mingw32
294+
CFG_CPUTYPE=i686
295+
;;
269296

297+
# Win 7 64 bit
298+
CYGWIN_NT-6.1-WOW64)
299+
CFG_OSTYPE=w64-mingw32
300+
CFG_CPUTYPE=x86_64
301+
;;
302+
303+
# We do not detect other OS such as XP/2003 using 64 bit using uname.
304+
# If we want to in the future, we will need to use Cygwin - Chuck's csih helper in /usr/lib/csih/winProductName.exe or alternative.
270305
*)
271306
err "unknown OS type: $CFG_OSTYPE"
272307
;;
273308
esac
274309

275310

311+
if [ -z "$CFG_CPUTYPE" ]
312+
then
276313
case $CFG_CPUTYPE in
277314

278315
i386 | i486 | i686 | i786 | x86)
@@ -290,6 +327,7 @@ case $CFG_CPUTYPE in
290327
*)
291328
err "unknown CPU type: $CFG_CPUTYPE"
292329
esac
330+
fi
293331

294332
# Detect 64 bit linux systems with 32 bit userland and force 32 bit compilation
295333
if [ $CFG_OSTYPE = unknown-linux-gnu -a $CFG_CPUTYPE = x86_64 ]

branches/try2/src/rt/arch/arm/sp.h

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// Getting the stack pointer and getting/setting sp limit.
12+
13+
#ifndef SP_H
14+
#define SP_H
15+
16+
#include "../../rust_globals.h"
17+
18+
// Gets a pointer to the vicinity of the current stack pointer
19+
extern "C" uintptr_t get_sp();
20+
21+
// Gets the pointer to the end of the Rust stack from a platform-
22+
// specific location in the thread control block
23+
extern "C" CDECL uintptr_t get_sp_limit();
24+
25+
// Records the pointer to the end of the Rust stack in a platform-
26+
// specific location in the thread control block
27+
extern "C" CDECL void record_sp_limit(void *limit);
28+
29+
#endif
Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +0,0 @@
1-
.text
2-
3-
#if defined(__APPLE__) || defined(_WIN32)
4-
#define RECORD_SP_LIMIT _record_sp_limit
5-
#define GET_SP_LIMIT _get_sp_limit
6-
#define GET_SP _get_sp
7-
#else
8-
#define RECORD_SP_LIMIT record_sp_limit
9-
#define GET_SP_LIMIT get_sp_limit
10-
#define GET_SP get_sp
11-
#endif
12-
13-
.globl RECORD_SP_LIMIT
14-
.globl GET_SP_LIMIT
15-
.globl GET_SP
16-
17-
#if defined(__linux__) || defined(__FreeBSD__)
18-
RECORD_SP_LIMIT:
19-
movl 4(%esp), %eax
20-
movl %eax, %gs:48
21-
ret
22-
#endif
23-
24-
#if defined(__APPLE__)
25-
RECORD_SP_LIMIT:
26-
movl $0x48+90*4, %eax
27-
movl 4(%esp), %ecx
28-
movl %ecx, %gs:(%eax)
29-
ret
30-
#endif
31-
32-
#if defined(_WIN32)
33-
RECORD_SP_LIMIT:
34-
movl 4(%esp), %eax
35-
movl %eax, %fs:0x14
36-
ret
37-
#endif
38-
39-
#if defined(__linux__) || defined(__FreeBSD__)
40-
GET_SP_LIMIT:
41-
movl %gs:48, %eax
42-
ret
43-
#endif
44-
45-
#if defined(__APPLE__)
46-
GET_SP_LIMIT:
47-
movl $0x48+90*4, %ecx
48-
movl %gs:(%ecx), %eax
49-
ret
50-
#endif
51-
52-
#if defined(_WIN32)
53-
GET_SP_LIMIT:
54-
movl %fs:0x14, %eax
55-
ret
56-
#endif
57-
58-
GET_SP:
59-
movl %esp, %eax
60-
ret

branches/try2/src/rt/arch/i386/sp.h

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// Getting the stack pointer and getting/setting sp limit.
12+
13+
#ifndef SP_H
14+
#define SP_H
15+
16+
#include "../../rust_globals.h"
17+
18+
// Gets a pointer to the vicinity of the current stack pointer
19+
extern "C" ALWAYS_INLINE uintptr_t get_sp() {
20+
uintptr_t sp;
21+
asm volatile (
22+
"movl %%esp, %0"
23+
: "=m"(sp));
24+
return sp;
25+
}
26+
27+
// Gets the pointer to the end of the Rust stack from a platform-
28+
// specific location in the thread control block
29+
extern "C" CDECL ALWAYS_INLINE uintptr_t get_sp_limit() {
30+
uintptr_t limit;
31+
32+
#if defined(__linux__) || defined(__FreeBSD__)
33+
asm volatile (
34+
"movl %%gs:48, %0"
35+
: "=r"(limit));
36+
#elif defined(__APPLE__)
37+
asm volatile (
38+
"movl $0x48+90*4, %%ecx\n\t"
39+
"movl %%gs:(%%ecx), %0"
40+
: "=r"(limit)
41+
:: "ecx");
42+
#elif defined(_WIN32)
43+
asm volatile (
44+
"movl %%fs:0x14, %0"
45+
: "=r"(limit));
46+
#endif
47+
48+
return limit;
49+
}
50+
51+
// Records the pointer to the end of the Rust stack in a platform-
52+
// specific location in the thread control block
53+
extern "C" CDECL ALWAYS_INLINE void record_sp_limit(void *limit) {
54+
#if defined(__linux__) || defined(__FreeBSD__)
55+
asm volatile (
56+
"movl %0, %%gs:48"
57+
:: "r"(limit));
58+
#elif defined(__APPLE__)
59+
asm volatile (
60+
"movl $0x48+90*4, %%eax\n\t"
61+
"movl %0, %%gs:(%%eax)"
62+
:: "r"(limit)
63+
: "eax");
64+
#elif defined(_WIN32)
65+
asm volatile (
66+
"movl %0, %%fs:0x14"
67+
:: "r"(limit));
68+
#endif
69+
}
70+
71+
#endif

branches/try2/src/rt/arch/mips/sp.h

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// Getting the stack pointer and getting/setting sp limit.
12+
13+
#ifndef SP_H
14+
#define SP_H
15+
16+
#include "../../rust_globals.h"
17+
18+
// Gets a pointer to the vicinity of the current stack pointer
19+
extern "C" uintptr_t get_sp();
20+
21+
// Gets the pointer to the end of the Rust stack from a platform-
22+
// specific location in the thread control block
23+
extern "C" CDECL uintptr_t get_sp_limit();
24+
25+
// Records the pointer to the end of the Rust stack in a platform-
26+
// specific location in the thread control block
27+
extern "C" CDECL void record_sp_limit(void *limit);
28+
29+
#endif
Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +0,0 @@
1-
.text
2-
3-
#if defined(__APPLE__) || defined(_WIN32)
4-
#define RECORD_SP_LIMIT _record_sp_limit
5-
#define GET_SP_LIMIT _get_sp_limit
6-
#define GET_SP _get_sp
7-
#else
8-
#define RECORD_SP_LIMIT record_sp_limit
9-
#define GET_SP_LIMIT get_sp_limit
10-
#define GET_SP get_sp
11-
#endif
12-
13-
.globl RECORD_SP_LIMIT
14-
.globl GET_SP_LIMIT
15-
.globl GET_SP
16-
17-
#if defined(__linux__)
18-
RECORD_SP_LIMIT:
19-
movq %rdi, %fs:112
20-
ret
21-
#elif defined(__APPLE__)
22-
RECORD_SP_LIMIT:
23-
movq $0x60+90*8, %rsi
24-
movq %rdi, %gs:(%rsi)
25-
ret
26-
#elif defined(__FreeBSD__)
27-
RECORD_SP_LIMIT:
28-
movq %rdi, %fs:24
29-
ret
30-
#else
31-
RECORD_SP_LIMIT:
32-
ret
33-
#endif
34-
35-
#if defined(__linux__)
36-
GET_SP_LIMIT:
37-
movq %fs:112, %rax
38-
ret
39-
#elif defined(__APPLE__)
40-
GET_SP_LIMIT:
41-
movq $0x60+90*8, %rsi
42-
movq %gs:(%rsi), %rax
43-
ret
44-
#elif defined(__FreeBSD__)
45-
GET_SP_LIMIT:
46-
movq %fs:24, %rax
47-
ret
48-
#endif
49-
50-
GET_SP:
51-
movq %rsp, %rax
52-
ret

branches/try2/src/rt/arch/x86_64/sp.h

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// Getting the stack pointer and getting/setting sp limit.
12+
13+
#ifndef SP_H
14+
#define SP_H
15+
16+
#include "../../rust_globals.h"
17+
18+
// Gets a pointer to the vicinity of the current stack pointer
19+
extern "C" ALWAYS_INLINE uintptr_t get_sp() {
20+
uintptr_t sp;
21+
asm volatile (
22+
"movq %%rsp, %0"
23+
: "=m"(sp));
24+
return sp;
25+
}
26+
27+
// Gets the pointer to the end of the Rust stack from a platform-
28+
// specific location in the thread control block
29+
extern "C" CDECL ALWAYS_INLINE uintptr_t get_sp_limit() {
30+
uintptr_t limit;
31+
32+
#if defined(__linux__)
33+
asm volatile (
34+
"movq %%fs:112, %0"
35+
: "=r"(limit));
36+
#elif defined(__APPLE__)
37+
asm volatile (
38+
"movq $0x60+90*8, %%rsi\n\t"
39+
"movq %%gs:(%%rsi), %0"
40+
: "=r"(limit)
41+
:: "rsi");
42+
#elif defined(__FreeBSD__)
43+
asm volatile (
44+
"movq %%fs:24, %0"
45+
: "=r"(limit));
46+
#endif
47+
48+
return limit;
49+
}
50+
51+
// Records the pointer to the end of the Rust stack in a platform-
52+
// specific location in the thread control block
53+
extern "C" CDECL ALWAYS_INLINE void record_sp_limit(void *limit) {
54+
#if defined(__linux__)
55+
asm volatile (
56+
"movq %0, %%fs:112"
57+
:: "r"(limit));
58+
#elif defined(__APPLE__)
59+
asm volatile (
60+
"movq $0x60+90*8, %%rsi\n\t"
61+
"movq %0, %%gs:(%%rsi)"
62+
:: "r"(limit)
63+
: "rsi");
64+
#elif defined(__FreeBSD__)
65+
asm volatile (
66+
"movq %0, %%fs:24"
67+
:: "r"(limit));
68+
#endif
69+
}
70+
71+
#endif

0 commit comments

Comments
 (0)