Deleted Added
sdiff udiff text old ( 3749:89fb514175fe ) new ( 3751:b422ffec62c1 )
full compact
1/*
2 * Copyright (c) 2001-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 51 unchanged lines hidden (view full) ---

60 pmemAddr = (uint8_t *)mmap(NULL, params()->addrRange.size(), PROT_READ | PROT_WRITE,
61 map_flags, -1, 0);
62
63 if (pmemAddr == (void *)MAP_FAILED) {
64 perror("mmap");
65 fatal("Could not mmap!\n");
66 }
67
68 pagePtr = 0;
69}
70
71void
72PhysicalMemory::init()
73{
74 if (!port)
75 panic("PhysicalMemory not connected to anything!");

--- 351 unchanged lines hidden (view full) ---

427}
428
429
430BEGIN_DECLARE_SIM_OBJECT_PARAMS(PhysicalMemory)
431
432 Param<string> file;
433 Param<Range<Addr> > range;
434 Param<Tick> latency;
435
436END_DECLARE_SIM_OBJECT_PARAMS(PhysicalMemory)
437
438BEGIN_INIT_SIM_OBJECT_PARAMS(PhysicalMemory)
439
440 INIT_PARAM_DFLT(file, "memory mapped file", ""),
441 INIT_PARAM(range, "Device Address Range"),
442 INIT_PARAM(latency, "Memory access latency")
443
444END_INIT_SIM_OBJECT_PARAMS(PhysicalMemory)
445
446CREATE_SIM_OBJECT(PhysicalMemory)
447{
448 PhysicalMemory::Params *p = new PhysicalMemory::Params;
449 p->name = getInstanceName();
450 p->addrRange = range;
451 p->latency = latency;
452 return new PhysicalMemory(p);
453}
454
455REGISTER_SIM_OBJECT("PhysicalMemory", PhysicalMemory)