When I saw it, it turned around, and it involved a problem with the Uboot address.

Source: Internet
Author: User
Addr = (_bss_end + (page_size-1)) & ~ (page_size-1); What do you mean?

This is a function of assigning video frame buffer address in uboot, I want to ask is: add one (page_size-1)) and then in with the previous ~ (PAGE_SIZE-1) is what role, I see a lot of is this write. Would you please tell me what the purpose of this writing is?

For page_size the value of 2 n power, such as 4096, after addr = (_bss_end + (page_size-1)) & ~ (page_size-1), after the operation, the resulting addr value according to Page_ The size is 4096-aligned, and the value of addr is a multiple of page_size and is just above the _bss_end value. If _bss_end is a multiple of page_size, then addr=_bss_end.
For example: _bss_end=100,page_size=64, the above calculation, addr=128, just a multiple of 64, and greater than 100, if _bss_end=128, then addr=128

When I saw it, it turned around, and it involved a problem with the Uboot address.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.