コード例 #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
ファイル: HalDevices.cs プロジェクト: Paul1nh0/Singularity
        public override void ReleaseResources()
        {
            clock.ReleaseResources();
            clock = null;

            timer.ReleaseResources();
            timer = null;

            pic.ReleaseResources();
            pic = null;
        }
コード例 #3
0
ファイル: HalDevices.cs プロジェクト: Paul1nh0/Singularity
        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
ファイル: ClockLogger.cs プロジェクト: Paul1nh0/Singularity
        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
ファイル: ClockLogger.cs プロジェクト: Paul1nh0/Singularity
 internal static void AddEntry(int who, RtcPitState rps, TimerOmap3430 timer)
 {
     AddEntry(who, rps, timer, 0);
 }