-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
regmap: Create a Python C extension module for low-level memory mappe…
…d IO This change implements a Python extension module in C to provide access to a memory mapped region directly via pointers, ensuring that memcpy isn't used on device memory where side effects can occur.
- Loading branch information
1 parent
585128e
commit 6652887
Showing
6 changed files
with
422 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
build/ | ||
dist/ | ||
poetry.lock | ||
setup.py | ||
__pycache__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from setuptools import Extension | ||
|
||
#--------------------------------------------------------------------------------------------------- | ||
ext_modules = [ | ||
Extension(name='regio.regmap.io.mmap_ext', | ||
sources=['src/regio/regmap/io/mmap_ext.c'], | ||
extra_compile_args=['-Wall', '-Werror', '-Wextra', '-Wno-conversion']), | ||
] | ||
|
||
#--------------------------------------------------------------------------------------------------- | ||
def build(setup_kwargs): | ||
setup_kwargs.update({ | ||
'ext_modules': ext_modules, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
mmap_ext.cpython-*.so |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.