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
2a6660ba
Commit
2a6660ba
authored
9 years ago
by
Paul Sokolovsky
Browse files
Options
Downloads
Patches
Plain Diff
extmod/modmachine: Avoid conflicts with system PAGE_SIZE define, if any.
parent
1abb449d
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
extmod/modmachine.c
+5
-5
5 additions, 5 deletions
extmod/modmachine.c
with
5 additions
and
5 deletions
extmod/modmachine.c
+
5
−
5
View file @
2a6660ba
...
@@ -33,12 +33,12 @@
...
@@ -33,12 +33,12 @@
#include
<errno.h>
#include
<errno.h>
#include
<fcntl.h>
#include
<fcntl.h>
#include
<sys/mman.h>
#include
<sys/mman.h>
#define MICROPY_PAGE_SIZE 4096
#define MICROPY_PAGE_MASK (MICROPY_PAGE_SIZE - 1)
#endif
#endif
#if MICROPY_PY_MACHINE
#if MICROPY_PY_MACHINE
#define PAGE_SIZE 4096
#define PAGE_MASK (PAGE_SIZE - 1)
STATIC
mp_uint_t
get_addr
(
mp_obj_t
addr_o
,
uint
align
)
{
STATIC
mp_uint_t
get_addr
(
mp_obj_t
addr_o
,
uint
align
)
{
mp_uint_t
addr
=
mp_obj_int_get_truncated
(
addr_o
);
mp_uint_t
addr
=
mp_obj_int_get_truncated
(
addr_o
);
...
@@ -58,12 +58,12 @@ STATIC mp_uint_t get_addr(mp_obj_t addr_o, uint align) {
...
@@ -58,12 +58,12 @@ STATIC mp_uint_t get_addr(mp_obj_t addr_o, uint align) {
}
}
}
}
mp_uint_t
cur_base
=
addr
&
~
PAGE_MASK
;
mp_uint_t
cur_base
=
addr
&
~
MICROPY_
PAGE_MASK
;
if
(
cur_base
!=
last_base
)
{
if
(
cur_base
!=
last_base
)
{
map_page
=
(
mp_uint_t
)
mmap
(
NULL
,
PAGE_SIZE
,
PROT_READ
|
PROT_WRITE
,
MAP_SHARED
,
fd
,
cur_base
);
map_page
=
(
mp_uint_t
)
mmap
(
NULL
,
MICROPY_
PAGE_SIZE
,
PROT_READ
|
PROT_WRITE
,
MAP_SHARED
,
fd
,
cur_base
);
last_base
=
cur_base
;
last_base
=
cur_base
;
}
}
addr
=
map_page
+
(
addr
&
PAGE_MASK
);
addr
=
map_page
+
(
addr
&
MICROPY_
PAGE_MASK
);
}
}
#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