From: M. R. B. <ma...@uw...> - 2000-12-07 01:36:47
|
On Thu, 7 Dec 2000, Rene Malmgren wrote: > Let me give you an alternative solution witch might be better att hand. > > I thnik we should adress the problem directly. Not try to patch our way > arouind it. > > So our problem is that different SH arch have different ways to talk to the > RTC. > So I prupose that we introduse an abstraction. Simply the get/set timeofday > funktions. > These funktions can be switched in att compile time or dynamicly at runtime. > Then we simply write an rtc_gen.c and a rtc_dc.c, or perhaps even an > rtc_sh3_gen.c, rtc_sh4_gen.c and an rtc_sh4_dc.c. Then we make all the other > functions that use ther RTC access it through these two funktions. The > get_timer_freq for instance. No modification has to be made to the generic > code at all. You just simply chose the type of timer you want. We should > consider doing the same thing to the timers aswell. > Rene, what you just described is *exactly* what Phillip is planning to do. He's moving generic SH4 RTC code into rtc.c so the generic SH4 target (and any other machine that uses the SH4's builtin RTC) can use it. Then he's adding get_timer_frequency, get_rtc_time, and set_rtc_time to the machine vector, so that we can right customized routines for the Dreamcast. Then any machine that doesn't use the SH4's RTC can write their own. That's what the machvec system is for, and I do believe the DC port will be using it extensively :). I'm fleshing out the machvec for the DC now, it'll get rough when we start working on the G2 bus and expansion port :P. But if you check out Documentation/sh/new-machine.txt it'll give you some ideas of the files that are needed. M. R. |