!include/arch: use _PAGE_SIZE definition from p-r-kernel#486
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces _PAGE_SHIFT and defines _PAGE_SIZE using bitwise shifts across various architectures, as well as exposing PAGE_SHIFT in limits.h. However, critical compilation errors were introduced in include/arch/ia32/arch.h and include/arch/riscv64/arch.h due to duplicated and nested macro definitions for SIZE_PAGE during the edits.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
618ab62 to
cb0d310
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces the _PAGE_SHIFT and PAGE_SHIFT macros across various architecture-dependent headers (including aarch64, armv7, armv8, ia32, riscv64, and sparcv8leon) and redefines _PAGE_SIZE using bitwise shifts. Additionally, it updates copyright years and author attributions in the modified files. There are no review comments, and I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
julianuziemblo
left a comment
There was a problem hiding this comment.
_PAGE_SIZE, PAGE_SIZE, PAGESIZE and SIZE_PAGE are always defined the same way: _PAGE_SIZE = (1 << _PAGE_SHIFT), PAGE_SIZE = _PAGE_SIZE, PAGESIZE = _PAGE_SIZE and SIZE_PAGE = _Pragma(...) _PAGE_SIZE. Maybe we could transfer them to the common limits.h file that includes all those for different architectures? Or is there a reason this is kept separate?
|
As an author of deprecation message on macro SIZE_PAGE and C/POSIX orthodox I would suggest you to remove SIZE_PAGE macro with deprecation warning altogether - it's deprecated for literally 7 years, and system users had a time to switch to PAGE_SIZE or _PAGE_SIZE. Exporting PAGE_SHIFT from limits.h is fishy – it's C/POSIX header so you shouldn't export additional macros from there. Maybe just leave _PAGE_SHIFT? |
Sure, seems sane. |
I also thought about it, but OTOH, |
759b82d to
3af1b44
Compare
|
Consider adding |
|
|
||
| #define _PAGE_SIZE 0x1000 | ||
| #define SIZE_PAGE _Pragma("GCC warning \"'SIZE_PAGE' is deprecated. Use _PAGE_SIZE from arch.h or PAGE_SIZE from limits.h (POSIX only)\"") _PAGE_SIZE | ||
| #define _PAGE_SHIFT 12 |
There was a problem hiding this comment.
Consider using unsigned values everywhere, as done in the kernel:
#define _PAGE_SHIFT 12U
#define _PAGE_SIZE (1U << _PAGE_SHIFT)
Rabini sa niezdecydowani. |
|
I understood that the idea is to use the PAGE_SIZE defined here for ports like JFFS2. JFFS2 also requires PAGE_SHIFT, though. I can agree that both should probably come from the kernel headers instead. |
dc5cc96 to
0993310
Compare
f707a88 to
eb33f75
Compare
It has been deprecated some years already and it seems that there are not many places it is still used in. Deleted per deprecation message author suggestion. JIRA: RTOS-1356
This is already defined in <posix/limits.h> JIRA: RTOS-1358
eb33f75 to
d29f889
Compare
|
I moved Also, implemented changes suggested by @julianuziemblo regarding definition dedup. |
JIRA: RTOS-1358
d29f889 to
32927ca
Compare
JIRA: RTOS-1358
Types of changes
How Has This Been Tested?
aarch64a53-zynqmp-qemu.Checklist:
Special treatment