Changeset c520034 in mainline for kernel/arch/ia64/include/asm.h


Ignore:
Timestamp:
2011-12-31T18:19:35Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
295f658, 77c2b02, 96cd5b4
Parents:
852052d (diff), 22f0561 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Support for kernel non-identity mappings, phase I.

  • identity/non-identity kernel memory split on all architectures
  • low/high physical memory split on all architectures
  • frame allocator understands low/high memory
  • high physical memory currently unused (Phase II)
  • more compact frame_t
  • zone conf frames, pte_t, kernel stacks allocated from low memory
  • lockless TLB-miss handlers everywhere (newly sparc64, ia64)
  • preallocate PTL1 page tables for non-identity and prevent their deallocation
  • hw_map() unification
  • new resource allocator used for allocating kernel virtual addresses

Breakage:

  • sparc64/sun4v creates too large kernel identity; not fixed because of lack of testing hw
  • ppc32's tlb_refill() seems wrong as it creates too large kernel identity, but appears unused and the architecture works normally

Not implemented yet (phase II):

  • allow high memory to be used for common kernel allocations
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia64/include/asm.h

    r852052d rc520034  
    3939#include <typedefs.h>
    4040#include <arch/register.h>
     41#include <arch/legacyio.h>
    4142#include <trace.h>
    4243
    43 #define IA64_IOSPACE_ADDRESS  0xE001000000000000ULL
    44 
    4544#define IO_SPACE_BOUNDARY       ((void *) (64 * 1024))
    4645
     46/** Map the I/O port address to a legacy I/O address. */
     47NO_TRACE static inline uintptr_t p2a(volatile void *p)
     48{
     49        uintptr_t prt = (uintptr_t) p;
     50
     51        return legacyio_virt_base + (((prt >> 2) << 12) | (prt & 0xfff));
     52}
     53       
    4754NO_TRACE static inline void pio_write_8(ioport8_t *port, uint8_t v)
    4855{
    49         if (port < (ioport8_t *) IO_SPACE_BOUNDARY) {
    50                 uintptr_t prt = (uintptr_t) port;
    51        
    52                 *((ioport8_t *) (IA64_IOSPACE_ADDRESS +
    53                     ((prt & 0xfff) | ((prt >> 2) << 12)))) = v;
    54         } else {
     56        if (port < (ioport8_t *) IO_SPACE_BOUNDARY)
     57                *((ioport8_t *) p2a(port)) = v;
     58        else
    5559                *port = v;
    56         }
    5760       
    5861        asm volatile (
     
    6467NO_TRACE static inline void pio_write_16(ioport16_t *port, uint16_t v)
    6568{
    66         if (port < (ioport16_t *) IO_SPACE_BOUNDARY) {
    67                 uintptr_t prt = (uintptr_t) port;
    68        
    69                 *((ioport16_t *) (IA64_IOSPACE_ADDRESS +
    70                     ((prt & 0xfff) | ((prt >> 2) << 12)))) = v;
    71         } else {
     69        if (port < (ioport16_t *) IO_SPACE_BOUNDARY)
     70                *((ioport16_t *) p2a(port)) = v;
     71        else
    7272                *port = v;
    73         }
    7473       
    7574        asm volatile (
     
    8180NO_TRACE static inline void pio_write_32(ioport32_t *port, uint32_t v)
    8281{
    83         if (port < (ioport32_t *) IO_SPACE_BOUNDARY) {
    84                 uintptr_t prt = (uintptr_t) port;
    85        
    86                 *((ioport32_t *) (IA64_IOSPACE_ADDRESS +
    87                     ((prt & 0xfff) | ((prt >> 2) << 12)))) = v;
    88         } else {
     82        if (port < (ioport32_t *) IO_SPACE_BOUNDARY)
     83                *((ioport32_t *) p2a(port)) = v;
     84        else
    8985                *port = v;
    90         }
    9186       
    9287        asm volatile (
     
    105100        );
    106101
    107         if (port < (ioport8_t *) IO_SPACE_BOUNDARY) {
    108                 uintptr_t prt = (uintptr_t) port;
    109 
    110                 v = *((ioport8_t *) (IA64_IOSPACE_ADDRESS +
    111                     ((prt & 0xfff) | ((prt >> 2) << 12))));
    112         } else {
     102        if (port < (ioport8_t *) IO_SPACE_BOUNDARY)
     103                v = *((ioport8_t *) p2a(port));
     104        else
    113105                v = *port;
    114         }
    115106       
    116107        return v;
     
    126117        );
    127118
    128         if (port < (ioport16_t *) IO_SPACE_BOUNDARY) {
    129                 uintptr_t prt = (uintptr_t) port;
    130 
    131                 v = *((ioport16_t *) (IA64_IOSPACE_ADDRESS +
    132                     ((prt & 0xfff) | ((prt >> 2) << 12))));
    133         } else {
     119        if (port < (ioport16_t *) IO_SPACE_BOUNDARY)
     120                v = *((ioport16_t *) p2a(port));
     121        else
    134122                v = *port;
    135         }
    136123       
    137124        return v;
     
    147134        );
    148135       
    149         if (port < (ioport32_t *) IO_SPACE_BOUNDARY) {
    150                 uintptr_t prt = (uintptr_t) port;
    151                
    152                 v = *((ioport32_t *) (IA64_IOSPACE_ADDRESS +
    153                     ((prt & 0xfff) | ((prt >> 2) << 12))));
    154         } else {
     136        if (port < (ioport32_t *) IO_SPACE_BOUNDARY)
     137                v = *((ioport32_t *) p2a(port));
     138        else
    155139                v = *port;
    156         }
    157140
    158141        return v;
Note: See TracChangeset for help on using the changeset viewer.