UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

取消
显示结果 
搜索替代 
您的意思是: 
Highlighted
Xilinx Employee
Xilinx Employee

【分享】Linux保留内存的对齐访问问题。

ARM64 Linux可以在device tree里使用关键字reserved-memory保留内存,是内核不再使用这段内存,然后在用户态mmap和使用这段内存。
如果留内存时使用了关键字no-map,那么这段内存使用mmap映射后,是strongly order memory, 必须对齐访问。如果没有使用关键字no-map,那么这段内存使用mmap映射后,是normal memory, 可以不对齐访问。
1. Reserved-memory without “no-map” in device tree: It is mapped as normal memory that supports unaligned access.
2. Reserved-memory with “no-map” in device tree: It is mapped as strongly order memory that supports aligned access only.
3. memory reserved by "mem=1024M" in U-Boot bootargs is mapped as strongly order memory by default.
4. Uday has one drive that can map memory reserved by "mem=1024M" in U-Boot bootargs as normal memory.

/include/ "system-conf.dtsi"
/ {
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;

strongly_order_mem: buffer0@0x30000000 {
no-map;
reg = <0x0 0x30000000 0x0 0x1000000>;
};

normal_mem: buffer1@0x31000000 {
reg = <0x0 0x31000000 0x0 0x1000000>;
};
};
};

0 项奖励
1 条回复
Moderator
Moderator

回复: 【分享】Linux保留内存的对齐访问问题。

谢谢Hank的分享!

-------------------------------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------------------------------
如果提供的信息能解决您的问题,请标记为“接受为解决方案”。
如果您认为帖子有帮助,请点击“奖励”。谢谢!
-------------------------------------------------------------------------------------------------
0 项奖励