Changeset 052da81 in mainline


Ignore:
Timestamp:
2006-02-18T14:40:15Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
daea4bf
Parents:
ede493e
Message:

Fixes in memory allocator

  • proper kernel blacklisting, when kernel not loaded on page boundary
  • correct zone adding in zone list (how could this work??)
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • arch/mips32/include/mm/tlb.h

    rede493e r052da81  
    7575/** Page Table Entry. */
    7676struct pte {
    77 #ifdef BIG_ENDIAN
    78         unsigned a : 1;                 /**< Accessed bit. */
    79         unsigned w : 1;                 /**< Page writable bit. */
    80         unsigned pfn : 24;              /**< Physical frame number. */
    81         unsigned soft_valid : 1;        /**< Valid content even if not present. */
    82         unsigned : 1;                   /**< Unused. */
    83         unsigned cacheable : 1;         /**< Cacheable bit. */
    84         unsigned d : 1;                 /**< Dirty bit. */
    85         unsigned p : 1;                 /**< Present bit. */
    86         unsigned g : 1;                 /**< Global bit. */
    87 #else
    8877        unsigned g : 1;                 /**< Global bit. */
    8978        unsigned p : 1;                 /**< Present bit. */
     
    9584        unsigned w : 1;                 /**< Page writable bit. */
    9685        unsigned a : 1;                 /**< Accessed bit. */
    97 #endif
    9886};
    9987
  • arch/mips32/src/console.c

    rede493e r052da81  
    4040        } else if (serial_init()) {
    4141                serial_console();
    42         } else
     42        } else {
    4343                msim_console();
    4444#ifdef CONFIG_FB
    45         fb_init(0xb2000000, 640, 480, 3); // gxemul framebuffer
     45                fb_init(0xb2000000, 640, 480, 3); // gxemul framebuffer
    4646#endif
     47        }
    4748}
  • arch/mips32/src/drivers/arc.c

    rede493e r052da81  
    3737#include <align.h>
    3838#include <console/console.h>
     39#include <console/kconsole.h>
     40#include <console/cmd.h>
    3941
    4042/* This is a good joke, SGI HAS different types than NT bioses... */
     
    153155        desc = arc_entry->getmemorydescriptor(NULL);
    154156        while (desc) {
    155                 printf("%s: %d (size: %dKB)\n",basetypes[desc->type],
     157                printf("%s: %d(%P) (size: %dKB)\n",basetypes[desc->type],
     158                       desc->basepage * ARC_FRAME,
    156159                       desc->basepage * ARC_FRAME,
    157160                       desc->basecount*ARC_FRAME/1024);
     
    173176}
    174177
     178static int cmd_reboot(cmd_arg_t *argv)
     179{
     180        arc_entry->reboot();
     181        return 0;
     182}
     183static cmd_info_t reboot_info = {
     184        .name = "reboot",
     185        .description = "Reboot computer",
     186        .func = cmd_reboot,
     187        .argc = 0
     188};
     189
    175190/** Initialize ARC structure
    176191 *
     
    189204        arc_putchar('C');
    190205        arc_putchar('\n');
     206
     207        /* Add command for resetting the computer */
     208        cmd_initialize(&reboot_info);
     209        cmd_register(&reboot_info);
    191210
    192211        return 0;
     
    305324                        total += basesize;
    306325                       
    307                         zone_create(ADDR2PFN(base),
    308                                     SIZE2FRAMES(ALIGN_DOWN(basesize,FRAME_SIZE)),
    309                                     ADDR2PFN(base),0);
     326                        zone_create(ADDR2PFN(base), SIZE2FRAMES(basesize),
     327                                    ADDR2PFN(base), 0);
    310328                }
    311329                desc = arc_entry->getmemorydescriptor(desc);
  • arch/mips32/src/exception.c

    rede493e r052da81  
    7575                rasymbol = s;
    7676       
    77         printf("PC: %X(%s) RA: %X(%s)\n",pstate->epc,pcsymbol,
    78                pstate->ra,rasymbol);
     77        printf("PC: %X(%s) RA: %X(%s), SP(%P)\n",pstate->epc,pcsymbol,
     78               pstate->ra,rasymbol, pstate->sp);
    7979}
    8080
  • generic/src/mm/frame.c

    rede493e r052da81  
    137137        if (zones.count+1 == ZONES_MAX)
    138138                panic("Maximum zone(%d) count exceeded.", ZONES_MAX);
    139 
    140139        for (i=0; i < zones.count; i++) {
    141140                /* Check for overflow */
    142                 z = zones.info[zones.count];
     141                z = zones.info[i];
    143142                if (overlaps(newzone->base,newzone->count,
    144143                             z->base, z->count)) {
     
    146145                        return -1;
    147146                }
    148                 if (z->base < newzone->base)
     147                if (newzone->base < z->base)
    149148                        break;
    150149        }
     
    152151        for (j=i;j < zones.count;j++)
    153152                zones.info[j+1] = zones.info[j];
    154 
    155153        zones.info[i] = newzone;
    156154        zones.count++;
    157 
    158155        spinlock_unlock(&zones.lock);
    159156        interrupts_restore(ipl);
     
    768765                frame_initialize(&z->frames[i]);
    769766        }
    770 
     767       
    771768        /* Stuffing frames */
    772769        for (i = 0; i < count; i++) {
     
    844841                        zone_mark_unavailable(z, i - z->base);
    845842                }
    846 
    847843        return znum;
    848844}
     
    972968        zone_t *zone;
    973969        int prefzone = 0;
    974 
     970       
    975971        for (i=0; i < count; i++) {
    976972                zone = find_zone_and_lock(start+i,&prefzone);
     
    996992        frame_arch_init();
    997993        if (config.cpu_active == 1) {
    998                 frame_mark_unavailable(ADDR2PFN(KA2PA(config.base)),
    999                                        SIZE2FRAMES(config.kernel_size));
     994                pfn_t firstframe = ADDR2PFN(KA2PA(config.base));
     995                pfn_t lastframe = ADDR2PFN(KA2PA(config.base+config.kernel_size));
     996                frame_mark_unavailable(firstframe,lastframe-firstframe+1);
    1000997                if (config.init_size > 0)
    1001998                        frame_mark_unavailable(ADDR2PFN(KA2PA(config.init_addr)),
Note: See TracChangeset for help on using the changeset viewer.