示例#1
0
 internal static void Run(HalClockNull clock, TimerOmap3430 gpTimer1)
 {
     DebugStub.Print("CLOCK CALIBRATION NOT ATTEMPTED.\n");
     // hacked, should calibrate
     Processor.CyclesPerSecond = 687 * 1000 * 1000; // MPU runs @ 687Mhz in OPP1
     gpTimer1.SetTicksPerSecond(32768);
     return;
 }
示例#2
0
        public override void ReleaseResources()
        {
            clock.ReleaseResources();
            clock = null;

            timer.ReleaseResources();
            timer = null;

            pic.ReleaseResources();
            pic = null;
        }
示例#3
0
        public override void Initialize(Processor rootProcessor)
        {
            DebugStub.Print("HalDevices.Initialize() - ARM\n");

            // PIC
            PnpConfig picConfig
                = (PnpConfig)IoSystem.YieldResources("/arm/ti/3430/INTCPS",
                                                     typeof(Pic));

            pic = new Pic(picConfig);
            pic.Initialize();

            // Timer
            PnpConfig timerConfig
                = (PnpConfig)IoSystem.YieldResources("/arm/ti/3430/GPTIMER1",
                                                     typeof(TimerOmap3430));

            timer = new TimerOmap3430(timerConfig, pic);
            byte timerInterrupt = timer.Initialize();

            // Real-time clock
            clock = new HalClockNull();
            byte clockInterrupt = clock.Initialize();
            bool noisyTimer     = false;

            CalibrateTimers.Run(clock, timer);

            SystemClock.Initialize(clock, TimeSpan.FromHours(8).Ticks);

            rootProcessor.AddPic(pic);

            rootProcessor.AddTimer(timerInterrupt, timer);
            rootProcessor.AddClock(clockInterrupt, clock);

            // ----------------------------------------------------------
            // Add Srat tables to the Processor
            halMemory = new HalMemoryNull();
            ProcessorNode.AddMemory(halMemory);

            timer.Start();

            halScreen      = new HalScreenNull();
            Console.Screen = (HalScreen)halScreen;
        }
示例#4
0
        internal static void AddEntry(int who, RtcPitState rps, TimerOmap3430 timer, long cookie)
        {
            if (ignoreCount != 0)
            {
                ignoreCount--;
                return;
            }

            if (currentRecord == entries.Length)
            {
                return;
            }

            entries[currentRecord].who    = who;
            entries[currentRecord].cookie = cookie;
            entries[currentRecord].when   = Processor.CycleCount;
//            int pitNow = timer.Timer2Read();
            int pitNow = 0;

            entries[currentRecord].currentTime =
                (ulong)rps.GetKernelTicks(pitNow);
            entries[currentRecord].upTime       = rps.upTime;
            entries[currentRecord].pitLastClock = rps.pitLastClock;
            entries[currentRecord].pitNow       = pitNow;

            currentRecord = currentRecord + 1;

            if (currentRecord == entries.Length)
            {
                bool iflag = Processor.DisableInterrupts();
                try {
                    DumpEntries();
                    DebugStub.Assert(false);
                }
                finally {
                    Processor.RestoreInterrupts(iflag);
                }
            }
        }
示例#5
0
 internal static void AddEntry(int who, RtcPitState rps, TimerOmap3430 timer)
 {
     AddEntry(who, rps, timer, 0);
 }