Changeset 84dd253 in mainline for arch


Ignore:
Timestamp:
2005-09-21T13:37:50Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
aed4eca
Parents:
fcacfb7
Message:

Physical memory management work.
New frame allocator.
Some architectures need to have bigger heap.

Location:
arch
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • arch/amd64/src/mm/page.c

    rfcacfb7 r84dd253  
    5353                 * PA2KA(identity) mapping for all frames.
    5454                 */
    55                 for (i = 0; i < frames; i++) {
     55                for (i = 0; i < config.memory_size/FRAME_SIZE; i++) {
    5656                        map_page_to_frame(PA2KA(i * PAGE_SIZE), i * PAGE_SIZE, PAGE_CACHEABLE | PAGE_EXEC, KA2PA(dba));
    5757                }
  • arch/ia32/src/mm/frame.c

    rfcacfb7 r84dd253  
    3333#include <arch/boot/boot.h>
    3434#include <arch/boot/memmap.h>
     35#include <panic.h>
    3536
    3637size_t hardcoded_unmapped_ktext_size = 0;
     
    3940void frame_arch_init(void)
    4041{
     42        zone_t *z;
    4143        __u8 i;
    4244       
    4345        if (config.cpu_active == 1) {
    44                 /* Reserve the NULL frame */
    45                 frame_not_free(0x0);
     46                for (i=e820counter;i>0;i--) {
     47                        if (e820table[i-1].type==MEMMAP_MEMORY_AVAILABLE) {
     48                                z = zone_create(e820table[i-1].base_address, e820table[i-1].size & ~(FRAME_SIZE-1), 0);
     49                                if (!z) {
     50                                        panic("Cannot allocate zone (%dB).\n", e820table[i-1].size & ~(FRAME_SIZE-1));
     51                                }
     52                                zone_attach(z);
     53                        }
     54                }
    4655               
    47                 /* Reserve well-known memory regions */
    48                 frame_region_not_free(0xa0000,0xff000);
    49                 frame_region_not_free(0xfec00000,0xffffffff);
    50                
     56                frame_not_free(0);
     57
    5158                /* Reserve real mode bootstrap memory */
    52                 frame_region_not_free(BOOTSTRAP_OFFSET, BOOTSTRAP_OFFSET + hardcoded_unmapped_ktext_size + hardcoded_unmapped_kdata_size);
    53                
    54                 for (i=e820counter;i>0;i--) {
    55                         if (e820table[i-1].type!=MEMMAP_MEMORY_AVAILABLE) {
    56                                         frame_region_not_free(e820table[i-1].base_address, e820table[i-1].base_address+e820table[i-1].size);
    57                                 }
    58                         }
     59                frame_region_not_free(BOOTSTRAP_OFFSET, BOOTSTRAP_OFFSET + hardcoded_unmapped_ktext_size + hardcoded_unmapped_kdata_size);
    5960        }
    6061}
  • arch/ia32/src/mm/page.c

    rfcacfb7 r84dd253  
    5656                 * PA2KA(identity) mapping for all frames.
    5757                 */
    58                 for (i = 0; i < frames; i++)
     58                for (i = 0; i < config.memory_size/PAGE_SIZE; i++)
    5959                        map_page_to_frame(PA2KA(i * PAGE_SIZE), i * PAGE_SIZE, PAGE_CACHEABLE, KA2PA(dba));
    6060
  • arch/ia32/src/smp/mps.c

    rfcacfb7 r84dd253  
    188188        printf("%P: MPS Floating Pointer Structure\n", fs);
    189189
    190         frame_not_free((__address) fs);
    191 
    192190        if (fs->config_type == 0 && fs->configuration_table) {
    193191                if (fs->mpfib2 >> 7) {
     
    197195
    198196                ct = (struct mps_ct *)PA2KA((__address)fs->configuration_table);
    199                 frame_not_free((__address) ct);
    200197                config.cpu_count = configure_via_ct();
    201198        }
  • arch/ia64/Makefile.inc

    rfcacfb7 r84dd253  
    3333        arch/ivt.S \
    3434        arch/interrupt_handler.c \
    35         arch/fmath.c
     35        arch/fmath.c \
     36        arch/mm/frame.c
  • arch/ia64/src/dummy.s

    rfcacfb7 r84dd253  
    4141.global cpu_priority_restore
    4242.global cpu_sleep
    43 .global frame_arch_init
    4443.global dummy
    4544.global fpu_enable
     
    5958cpu_priority_restore:
    6059cpu_sleep:
    61 frame_arch_init:
    6260fpu_init:
    6361fpu_enable:
  • arch/mips32/src/mm/frame.c

    rfcacfb7 r84dd253  
    3131#include <arch/asm/boot.h>
    3232#include <arch/mm/page.h>
     33#include <config.h>
     34#include <panic.h>
    3335
    3436void frame_arch_init(void)
    3537{
     38        zone_t *z;
     39       
     40        z = zone_create(0, config.memory_size, 0);
     41        if (!z) {
     42                panic("Can't allocate zone (%dB).\n", config.memory_size);
     43        }
     44        zone_attach(z);
     45
    3646        /* Disable Everything until load address */
    3747        frame_region_not_free(0, KA2PA(KERNEL_LOAD_ADDRESS));
  • arch/ppc32/src/mm/frame.c

    rfcacfb7 r84dd253  
    2929#include <arch/mm/frame.h>
    3030#include <mm/frame.h>
     31#include <config.h>
     32#include <panic.h>
    3133
    3234void frame_arch_init(void)
    3335{
     36        zone_t *z;
     37
     38        z = zone_create(0, config.memory_size & ~(FRAME_SIZE-1), 0);
     39        if (!z) {
     40                panic("Can't allocate zone (%dB).\n", config.memory_size & ~(FRAME_SIZE-1));
     41        }
     42        zone_attach(z);
    3443}
Note: See TracChangeset for help on using the changeset viewer.