Changeset 93165be in mainline for arch/amd64/include/mm/page.h


Ignore:
Timestamp:
2006-03-16T23:54:05Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5fceec7
Parents:
ff14c520
Message:

Add support for more then 2GB of address space for AMD64.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • arch/amd64/include/mm/page.h

    rff14c520 r93165be  
    2727 */
    2828
     29/** Paging on AMD64
     30 *
     31 * The space is divided in positive numbers - userspace and
     32 * negative numbers - kernel space. The 'negative' space starting
     33 * with 0xffff800000000000 and ending with 0xffffffff80000000
     34 * (-2GB) is identically mapped physical memory. The area
     35 * (0xffffffff80000000 ... 0xffffffffffffffff is again identically
     36 * mapped first 2GB.
     37 *
     38 * ATTENTION - PA2KA(KA2PA(x)) != x if 'x' is in kernel
     39 */
     40
    2941#ifndef __amd64_PAGE_H__
    3042#define __amd64_PAGE_H__
     
    4355
    4456#ifndef __ASM__
    45 # define KA2PA(x)      (((__address) (x)) - 0xffffffff80000000)
    46 # define PA2KA(x)      (((__address) (x)) + 0xffffffff80000000)
     57static inline __address ka2pa(__address x)
     58{
     59        if (x > 0xffffffff80000000)
     60                return x - 0xffffffff80000000;
     61        else
     62                return x - 0xffff800000000000;
     63}
     64/* Linker symbol */
     65extern int ktext_start;
     66extern int kdata_end;
     67static inline __address pa2ka(__address x)
     68{
     69        if (x >= ka2pa((__address)(&kdata_end)) || \
     70            x <= ka2pa((__address)&ktext_start))
     71                return x + 0xffff800000000000;
     72        else
     73                return x + 0xffffffff80000000;
     74}
     75# define KA2PA(x)      ka2pa((__address)x)
     76# define PA2KA(x)      pa2ka((__address)x)
     77# define PA2KA_IDENT(x)      (((__address) (x)) + 0xffff800000000000)
     78# define PA2KA_CODE(x)      (((__address) (x)) + 0xffffffff80000000)
    4779#else
    4880# define KA2PA(x)      ((x) - 0xffffffff80000000)
    4981# define PA2KA(x)      ((x) + 0xffffffff80000000)
     82# define PA2KA_DATA(x)      ((x) + 0xffff800000000000)
    5083#endif
    5184
Note: See TracChangeset for help on using the changeset viewer.