[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] add io space MMAP for memory mapping devices and files
|
From: |
Mohammad-Reza Nabipoor |
|
Subject: |
Re: [PATCH] add io space MMAP for memory mapping devices and files |
|
Date: |
Wed, 3 Jan 2024 23:32:16 +0100 |
Hello Andreas.
Thanks for the patch.
It'd be nice if you add a helper function in `libpoke/std.pk' to help
Poke programmers. We've already done that for `sub://' and `pid://' IO spaces.
You can search for `openproc' and `opensub' in `libpoke/std.pk'.
This is `openproc':
```poke
fun openproc = (uint<64> pid, uint<64> flags = 0) int<32>:
{
return open (format ("pid://%u64d", pid), flags);
}
```
E.g., you can provide this:
```poke
fun openmmap =
(string path, offset<uint<64>,B> base, offset<uint<64>,B> size) int<32>:
{
return open (format ("mmap://%u64d/%u64d/%s", base/#B, size/#B, path));
}
```
Regards,
Mohammad-Reza