Changeset 939dfd7 in mainline for arch/mips32/src/drivers/arc.c


Ignore:
Timestamp:
2005-12-09T18:29:34Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
705b4149
Parents:
ef0e259
Message:

Added MIPS ARC memory initializaiton.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • arch/mips32/src/drivers/arc.c

    ref0e259 r939dfd7  
    3232#include <arch.h>
    3333#include <arch/byteorder.h>
     34#include <arch/mm/frame.h>
     35#include <mm/frame.h>
    3436
    3537/* This is a good joke, SGI HAS different types than NT bioses... */
     
    102104 * @return 0 - ARC OK, -1 - ARC does not exist
    103105 */
    104 int init_arc(void)
     106int arc_init(void)
    105107{
    106108        if (sbp->signature != ARC_MAGIC) {
     
    166168        while (desc) {
    167169                printf("%s: %d (size: %dKB)\n",basetypes[desc->type],
    168                        desc->basepage * 4096,
    169                        desc->basecount*4);
     170                       desc->basepage * ARC_FRAME,
     171                       desc->basecount*ARC_FRAME/1024);
    170172                desc = arc_entry->getmemorydescriptor(desc);
    171173        }
     
    203205        return ch;
    204206}
     207
     208/* Initialize frame zones from ARC firmware.
     209 * In the future we may use even the FirmwareTemporary regions,
     210 * currently we use the FreeMemory (what about the LoadedProgram?)
     211 */
     212void arc_frame_init(void)
     213{
     214        arc_memdescriptor_t *desc;
     215        int total = 0;
     216
     217        desc = arc_entry->getmemorydescriptor(NULL);
     218        while (desc) {
     219                if (desc->type == FreeMemory ||
     220                    desc->type == FreeContiguous) {
     221                        total += desc->basecount*ARC_FRAME;
     222                        zone_create_in_region(desc->basepage*ARC_FRAME,
     223                                              desc->basecount*ARC_FRAME);
     224                }
     225                desc = arc_entry->getmemorydescriptor(desc);
     226        }
     227
     228        config.memory_size = total;
     229}
     230
Note: See TracChangeset for help on using the changeset viewer.