Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
bf1570cb
Commit
bf1570cb
authored
Nov 20, 2015
by
stijn
Committed by
Paul Sokolovsky
Nov 24, 2015
Browse files
Options
Downloads
Patches
Plain Diff
nlr: Use single preprocessor symbol to check if building on Windows
parent
6edffd0d
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
py/nlrx64.S
+8
-4
8 additions, 4 deletions
py/nlrx64.S
py/nlrx86.S
+8
-7
8 additions, 7 deletions
py/nlrx86.S
with
16 additions
and
11 deletions
py/nlrx64.S
+
8
−
4
View file @
bf1570cb
...
@@ -39,12 +39,16 @@
...
@@ -39,12 +39,16 @@
#define NLR_TOP (_mp_state_ctx + NLR_TOP_OFFSET)
#define NLR_TOP (_mp_state_ctx + NLR_TOP_OFFSET)
#else
#else
#define NLR_TOP (mp_state_ctx + NLR_TOP_OFFSET)
#define NLR_TOP (mp_state_ctx + NLR_TOP_OFFSET)
#endif
#if defined(_WIN32) || defined(__CYGWIN__)
#define NLR_OS_WINDOWS
#endif
#endif
.
file
"nlr.s"
.
file
"nlr.s"
.
text
.
text
#if !defined(
__CYGWIN__
)
#if !defined(
NLR_OS_WINDOWS
)
/******************************************************************************/
/******************************************************************************/
//
//
...
@@ -140,11 +144,11 @@ nlr_jump:
...
@@ -140,11 +144,11 @@ nlr_jump:
je
_nlr_jump_fail
#
transfer
control
to
nlr_jump_fail
je
_nlr_jump_fail
#
transfer
control
to
nlr_jump_fail
#endif
#endif
#else // !defined(
__CYGWIN__
)
#else // !defined(
NLR_OS_WINDOWS
)
/******************************************************************************/
/******************************************************************************/
//
//
//
Functions
for
Cygwin
//
Functions
for
Windows
//
//
/******************************************************************************/
/******************************************************************************/
...
@@ -210,6 +214,6 @@ nlr_jump:
...
@@ -210,6 +214,6 @@ nlr_jump:
movq
%
rax
,
%
rcx
#
put
argument
back
in
first
-
arg
register
movq
%
rax
,
%
rcx
#
put
argument
back
in
first
-
arg
register
je
nlr_jump_fail
#
transfer
control
to
nlr_jump_fail
je
nlr_jump_fail
#
transfer
control
to
nlr_jump_fail
#endif // !defined(
__CYGWIN__
)
#endif // !defined(
NLR_OS_WINDOWS
)
#endif // defined(__x86_64__) && !MICROPY_NLR_SETJMP
#endif // defined(__x86_64__) && !MICROPY_NLR_SETJMP
This diff is collapsed.
Click to expand it.
py/nlrx86.S
+
8
−
7
View file @
bf1570cb
...
@@ -36,6 +36,7 @@
...
@@ -36,6 +36,7 @@
#define NLR_TOP_OFFSET (2 * 4)
#define NLR_TOP_OFFSET (2 * 4)
#if defined(_WIN32) || defined(__CYGWIN__)
#if defined(_WIN32) || defined(__CYGWIN__)
#define NLR_OS_WINDOWS
#define NLR_TOP (_mp_state_ctx + NLR_TOP_OFFSET)
#define NLR_TOP (_mp_state_ctx + NLR_TOP_OFFSET)
#else
#else
#define NLR_TOP (mp_state_ctx + NLR_TOP_OFFSET)
#define NLR_TOP (mp_state_ctx + NLR_TOP_OFFSET)
...
@@ -47,7 +48,7 @@
...
@@ -47,7 +48,7 @@
/**************************************/
/**************************************/
//
mp_uint_t
nlr_push
(
4
(%
esp
)=
nlr_buf_t
*
nlr
)
//
mp_uint_t
nlr_push
(
4
(%
esp
)=
nlr_buf_t
*
nlr
)
#if defined(
_WIN32) || defined(__CYGWIN__
)
#if defined(
NLR_OS_WINDOWS
)
.
globl
_nlr_push
.
globl
_nlr_push
.
def
_nlr_push
; .scl 2; .type 32; .endef
.
def
_nlr_push
; .scl 2; .type 32; .endef
_nlr_push
:
_nlr_push
:
...
@@ -69,14 +70,14 @@ nlr_push:
...
@@ -69,14 +70,14 @@ nlr_push:
mov
%
edx
,
NLR_TOP
#
stor
new
nlr_buf
(
to
make
linked
list
)
mov
%
edx
,
NLR_TOP
#
stor
new
nlr_buf
(
to
make
linked
list
)
xor
%
eax
,
%
eax
#
return
0
,
normal
return
xor
%
eax
,
%
eax
#
return
0
,
normal
return
ret
#
return
ret
#
return
#if !
(
defined(
_WIN32) || defined(__CYGWIN__)
)
#if !defined(
NLR_OS_WINDOWS
)
.
size
nlr_push
,
.
-
nlr_push
.
size
nlr_push
,
.
-
nlr_push
#endif
#endif
/**************************************/
/**************************************/
//
void
nlr_pop
()
//
void
nlr_pop
()
#if defined(
_WIN32) || defined(__CYGWIN__
)
#if defined(
NLR_OS_WINDOWS
)
.
globl
_nlr_pop
.
globl
_nlr_pop
.
def
_nlr_pop
; .scl 2; .type 32; .endef
.
def
_nlr_pop
; .scl 2; .type 32; .endef
_nlr_pop
:
_nlr_pop
:
...
@@ -89,14 +90,14 @@ nlr_pop:
...
@@ -89,14 +90,14 @@ nlr_pop:
mov
(%
eax
),
%
eax
#
load
prev
nlr_buf
mov
(%
eax
),
%
eax
#
load
prev
nlr_buf
mov
%
eax
,
NLR_TOP
#
store
nlr_top
(
to
unlink
list
)
mov
%
eax
,
NLR_TOP
#
store
nlr_top
(
to
unlink
list
)
ret
#
return
ret
#
return
#if !
(
defined(
_WIN32) || defined(__CYGWIN__)
)
#if !defined(
NLR_OS_WINDOWS
)
.
size
nlr_pop
,
.
-
nlr_pop
.
size
nlr_pop
,
.
-
nlr_pop
#endif
#endif
/**************************************/
/**************************************/
//
void
nlr_jump
(
4
(%
esp
)=
mp_uint_t
val
)
//
void
nlr_jump
(
4
(%
esp
)=
mp_uint_t
val
)
#if defined(
_WIN32) || defined(__CYGWIN__
)
#if defined(
NLR_OS_WINDOWS
)
.
globl
_nlr_jump
.
globl
_nlr_jump
.
def
_nlr_jump
; .scl 2; .type 32; .endef
.
def
_nlr_jump
; .scl 2; .type 32; .endef
_nlr_jump
:
_nlr_jump
:
...
@@ -107,7 +108,7 @@ nlr_jump:
...
@@ -107,7 +108,7 @@ nlr_jump:
#endif
#endif
mov
NLR_TOP
,
%
edx
#
load
nlr_top
mov
NLR_TOP
,
%
edx
#
load
nlr_top
test
%
edx
,
%
edx
#
check
for
nlr_top
being
NULL
test
%
edx
,
%
edx
#
check
for
nlr_top
being
NULL
#if defined(
_WIN32) || defined(__CYGWIN__
)
#if defined(
NLR_OS_WINDOWS
)
je
_nlr_jump_fail
#
fail
if
nlr_top
is
NULL
je
_nlr_jump_fail
#
fail
if
nlr_top
is
NULL
#else
#else
je
nlr_jump_fail
#
fail
if
nlr_top
is
NULL
je
nlr_jump_fail
#
fail
if
nlr_top
is
NULL
...
@@ -126,7 +127,7 @@ nlr_jump:
...
@@ -126,7 +127,7 @@ nlr_jump:
xor
%
eax
,
%
eax
#
clear
return
register
xor
%
eax
,
%
eax
#
clear
return
register
inc
%
al
#
increase
to
make
1
,
non
-
local
return
inc
%
al
#
increase
to
make
1
,
non
-
local
return
ret
#
return
ret
#
return
#if !
(
defined(
_WIN32) || defined(__CYGWIN__)
)
#if !defined(
NLR_OS_WINDOWS
)
.
size
nlr_jump
,
.
-
nlr_jump
.
size
nlr_jump
,
.
-
nlr_jump
#endif
#endif
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment