0

From my linker file of linux kernel(vmlinux.lds) I came to know the value of _PAGE_OFFSET is 0xc0000000 but for some reasons I would to like change this value but coun't find out which macro this value is coming from.

So I would like from which file is this value of _PAGE_OFFSET coming from .

Amit Singh Tomar
  • 8,380
  • 27
  • 120
  • 199

2 Answers2

4

The "underscore"-prefixed ones are architecture specific, and only exist in a couple of architectures. They are in the arch directories, such as:

arch/x86/include/asm/page_32_types.h

In general, you should not be using them - and should use the more generic:

PAGE_OFFSET

Which is defined in all architecture types, in:

include/asm-generic/page.h
Brad
  • 11,262
  • 8
  • 55
  • 74
  • Thanks Brad ,it was there for me in page_32_types.h but not sure how they have defined it #define --PAGE_OFFSET _AC(CONFIG_PAGE_OFFSET,UL), Now is it possible for me directly give some value against --PAGE_OFFSET XXXXXXXXX , willit cause any issue? – Amit Singh Tomar Mar 20 '13 at 15:02
  • It is set in the kernel configuration file, so you should be able to set it via "make menuconfig" or "make xconfig" or setting it in your .config but setting the CONFIG_KERNEL_RAM_BASE_ADDRESS – Brad Mar 20 '13 at 15:07
  • I Couln't find this CONFIG_KERNEL_RAM_BASE_ADDRESS in my config file and under make menuconfig whichplace should I look into?? – Amit Singh Tomar Mar 20 '13 at 15:12
0

Take x86 arch for example.

arch/x86/include/asm/page_types.h :
#define PAGE_OFFSET     ((unsigned long)__PAGE_OFFSET)

arch/x86/include/asm/page_32_types.h :
#define __PAGE_OFFSET       _AC(CONFIG_PAGE_OFFSET, UL)

arch/x86/Kconfig:

config PAGE_OFFSET
    hex
    default 0xB0000000 if VMSPLIT_3G_OPT
    default 0x80000000 if VMSPLIT_2G
    default 0x78000000 if VMSPLIT_2G_OPT
    default 0x40000000 if VMSPLIT_1G
    default 0xC0000000
    depends on X86_32

The PAGE_OFFSET in arch/x86/Kconfig is the CONFIG_PAGE_OFFSET in page_32_types.h. Because the prefix 'CONFIG_' is added by make system automatically.

Victor Choy
  • 4,006
  • 28
  • 35