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
4b34c76f
Commit
4b34c76f
authored
11 years ago
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
Changes to get unix/ port compiling on Cygwin.
parent
3996611c
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
py/nlr.h
+4
-0
4 additions, 0 deletions
py/nlr.h
py/nlrx64.S
+62
-1
62 additions, 1 deletion
py/nlrx64.S
tests/run-tests
+7
-1
7 additions, 1 deletion
tests/run-tests
unix/gccollect.c
+8
-3
8 additions, 3 deletions
unix/gccollect.c
with
81 additions
and
5 deletions
py/nlr.h
+
4
−
0
View file @
4b34c76f
...
@@ -11,7 +11,11 @@ struct _nlr_buf_t {
...
@@ -11,7 +11,11 @@ struct _nlr_buf_t {
#if defined(__i386__)
#if defined(__i386__)
void
*
regs
[
6
];
void
*
regs
[
6
];
#elif defined(__x86_64__)
#elif defined(__x86_64__)
#if defined(__CYGWIN__)
void
*
regs
[
12
];
#else
void
*
regs
[
8
];
void
*
regs
[
8
];
#endif
#elif defined(__thumb2__)
#elif defined(__thumb2__)
void
*
regs
[
10
];
void
*
regs
[
10
];
#else
#else
...
...
This diff is collapsed.
Click to expand it.
py/nlrx64.S
+
62
−
1
View file @
4b34c76f
...
@@ -4,6 +4,8 @@
...
@@ -4,6 +4,8 @@
.
file
"nlr.s"
.
file
"nlr.s"
.
text
.
text
#if !defined(__CYGWIN__)
/*
uint
nlr_push
(
rdi
=
nlr_buf_t
*
nlr
)
*/
/*
uint
nlr_push
(
rdi
=
nlr_buf_t
*
nlr
)
*/
#if !(defined(__APPLE__) && defined(__MACH__))
#if !(defined(__APPLE__) && defined(__MACH__))
.
globl
nlr_push
.
globl
nlr_push
...
@@ -82,4 +84,63 @@ nlr_jump:
...
@@ -82,4 +84,63 @@ nlr_jump:
.
local
nlr_top
.
local
nlr_top
#endif
#endif
.
comm
nlr_top
,
8
,
8
.
comm
nlr_top
,
8
,
8
#endif
#else // !defined(__CYGWIN__)
/*
uint
nlr_push
(
rcx
=
nlr_buf_t
*
nlr
)
*/
.
globl
nlr_push
nlr_push
:
movq
(%
rsp
),
%
rax
#
load
return
%
rip
movq
%
rax
,
16
(%
rcx
)
#
store
%
rip
into
nlr_buf
movq
%
rbp
,
24
(%
rcx
)
#
store
%
rbp
into
nlr_buf
movq
%
rsp
,
32
(%
rcx
)
#
store
%
rsp
into
nlr_buf
movq
%
rbx
,
40
(%
rcx
)
#
store
%
rbx
into
nlr_buf
movq
%
r12
,
48
(%
rcx
)
#
store
%
r12
into
nlr_buf
movq
%
r13
,
56
(%
rcx
)
#
store
%
r13
into
nlr_buf
movq
%
r14
,
64
(%
rcx
)
#
store
%
r14
into
nlr_buf
movq
%
r15
,
72
(%
rcx
)
#
store
%
r15
into
movq
%
rdi
,
80
(%
rcx
)
#
store
%
rdr
into
movq
%
rsi
,
88
(%
rcx
)
#
store
%
rsi
into
movq
nlr_top
(%
rip
),
%
rax
#
get
last
nlr_buf
movq
%
rax
,
(%
rcx
)
#
store
it
movq
%
rcx
,
nlr_top
(%
rip
)
#
stor
new
nlr_buf
(
to
make
linked
list
)
xorq
%
rax
,
%
rax
#
return
0
,
normal
return
ret
#
return
/*
void
nlr_jump
(
rcx
=
uint
val
)
*/
.
globl
nlr_jump
nlr_jump
:
movq
%
rcx
,
%
rax
#
put
return
value
in
%
rax
movq
nlr_top
(%
rip
),
%
rcx
#
get
nlr_top
into
%
rsi
movq
%
rax
,
8
(%
rcx
)
#
store
return
value
movq
(%
rcx
),
%
rax
#
load
prev
nlr_buf
movq
%
rax
,
nlr_top
(%
rip
)
#
store
prev
nlr_buf
(
to
unlink
list
)
movq
72
(%
rcx
),
%
r15
#
load
saved
%
r15
movq
64
(%
rcx
),
%
r14
#
load
saved
%
r14
movq
56
(%
rcx
),
%
r13
#
load
saved
%
r13
movq
48
(%
rcx
),
%
r12
#
load
saved
%
r12
movq
40
(%
rcx
),
%
rbx
#
load
saved
%
rbx
movq
32
(%
rcx
),
%
rsp
#
load
saved
%
rsp
movq
24
(%
rcx
),
%
rbp
#
load
saved
%
rbp
movq
16
(%
rcx
),
%
rax
#
load
saved
%
rip
movq
80
(%
rcx
),
%
rdi
#
store
%
rdr
into
movq
88
(%
rcx
),
%
rsi
#
store
%
rsi
into
movq
%
rax
,
(%
rsp
)
#
store
saved
%
rip
to
stack
xorq
%
rax
,
%
rax
#
clear
return
register
inc
%
al
#
increase
to
make
1
,
non
-
local
return
ret
#
return
.
comm
nlr_top
,
8
,
8
/
*
void
nlr_pop
()
*/
.
globl
nlr_pop
nlr_pop
:
movq
nlr_top
(%
rip
),
%
rax
#
get
nlr_top
into
%
rax
movq
(%
rax
),
%
rax
#
load
prev
nlr_buf
movq
%
rax
,
nlr_top
(%
rip
)
#
store
prev
nlr_buf
(
to
unlink
list
)
ret
#
return
#endif // !defined(__CYGWIN__)
#endif // __x86_64__
This diff is collapsed.
Click to expand it.
tests/run-tests
+
7
−
1
View file @
4b34c76f
...
@@ -36,7 +36,13 @@ if test_on_pyboard:
...
@@ -36,7 +36,13 @@ if test_on_pyboard:
for
test_file
in
tests
:
for
test_file
in
tests
:
test_name
=
os
.
path
.
splitext
(
os
.
path
.
basename
(
test_file
))[
0
]
test_name
=
os
.
path
.
splitext
(
os
.
path
.
basename
(
test_file
))[
0
]
# run CPython
try
:
output_expected
=
subprocess
.
check_output
([
CPYTHON3
,
'
-B
'
,
test_file
])
output_expected
=
subprocess
.
check_output
([
CPYTHON3
,
'
-B
'
,
test_file
])
except
subprocess
.
CalledProcessError
:
output_expected
=
b
'
CPYTHON3 CRASH
'
# run Micro Python
try
:
try
:
if
test_on_pyboard
:
if
test_on_pyboard
:
pyb
.
enter_raw_repl
()
pyb
.
enter_raw_repl
()
...
...
This diff is collapsed.
Click to expand it.
unix/gccollect.c
+
8
−
3
View file @
4b34c76f
...
@@ -78,9 +78,14 @@ void gc_collect(void) {
...
@@ -78,9 +78,14 @@ void gc_collect(void) {
gc_collect_start
();
gc_collect_start
();
// this traces .data and .bss sections
// this traces .data and .bss sections
extern
char
__bss_start
,
_end
;
#ifdef __CYGWIN__
//printf(".bss: %p-%p\n", &__bss_start, &_end);
#define BSS_START __bss_start__
gc_collect_root
((
void
**
)
&
__bss_start
,
((
machine_uint_t
)
&
_end
-
(
machine_uint_t
)
&
__bss_start
)
/
sizeof
(
machine_uint_t
));
#else
#define BSS_START __bss_start
#endif
extern
char
BSS_START
,
_end
;
//printf(".bss: %p-%p\n", &BSS_START, &_end);
gc_collect_root
((
void
**
)
&
BSS_START
,
((
machine_uint_t
)
&
_end
-
(
machine_uint_t
)
&
BSS_START
)
/
sizeof
(
machine_uint_t
));
regs_t
regs
;
regs_t
regs
;
gc_helper_get_regs
(
regs
);
gc_helper_get_regs
(
regs
);
// GC stack (and regs because we captured them)
// GC stack (and regs because we captured them)
...
...
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