Fix definition of PAGESIZE and B_PAGE_SIZE

On sparc, the minimal page size we can use is 8K. Since B_PAGE_SIZE and
PAGESIZE defines were hardcoded to 4K, this resulted in a lot of
confusion in all code trying to manipulate pages.

- Remove cpu.h from headers/private/kernel/arch/*. It dates back from
  NewOS and was not used anymore since our kernel uses B_PAGE_SIZE
  (PAGE_SIZE was the only thing defined in this header).
- Add posix/arch/*/limits.h with the arch specific page size and include
  it from the main limits.h.
- Adjust bios_ia32/debug.cpp which was the only place using the
  PAGE_SIZE constant from the deleted headers.
- Change OS.h to define B_PAGE_SIZE to be the same as POSIX PAGESIZE.
- Define PAGESIZE in the build header if the host OS doesn't.

Change-Id: I8c3732cf952ea3c2f088aa16d216678fbf198b96
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3558
Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
Adrien Destugues
2021-01-08 12:02:16 +00:00
committed by Adrien Destugues
parent c46f51fb45
commit 68d37cfb3a
25 changed files with 115 additions and 253 deletions
+3 -1
View File
@@ -7,6 +7,7 @@
/** Kernel specific structures and functions */
#include <limits.h>
#include <stdarg.h>
#include <sys/types.h>
@@ -21,9 +22,10 @@ extern "C" {
/* System constants */
#define B_OS_NAME_LENGTH 32
#define B_PAGE_SIZE 4096
#define B_INFINITE_TIMEOUT (9223372036854775807LL)
#define B_PAGE_SIZE PAGESIZE
enum {
B_TIMEOUT = 0x8, /* relative timeout */
B_RELATIVE_TIMEOUT = 0x8, /* fails after a relative timeout