?? boardcfg.c
字號:
/* openbios/arch/vulcan/boardcfg.c *//*-----------------------------------------------------------------------------+|| This source code has been made available to you by IBM on an AS-IS| basis. Anyone receiving this source is licensed under IBM| copyrights to use it in any way he or she deems fit, including| copying it, modifying it, compiling it, and redistributing it either| with or without modifications. No license under IBM patents or| patent applications is to be implied by the copyright license.|| Any user of this software should understand that IBM cannot provide| technical support for this software and will not be responsible for| any consequences resulting from the use of this software.|| Any person who transfers this source code or any derivative work| must include the IBM copyright notice, this paragraph, and the| preceding two paragraphs in the transferred software.|| COPYRIGHT I B M CORPORATION 1995| LICENSED MATERIAL - PROGRAM PROPERTY OF I B M+-----------------------------------------------------------------------------*//*-----------------------------------------------------------------------------+|| File Name: boardcfg.c|| Function: Defines Pallas specific board config related routines.|| Author: Yudong Yang|| Change Activity-|| Date Description of Change BY| --------- --------------------- ---| 15-Jan-02 Splitted architecture specific parts from miscLib/boardcfg YYD| 26-Apr-02 Modified VK+-----------------------------------------------------------------------------*/static void init_sysclock_ratio(){ unsigned long temp_value; unsigned long Mult, RangeA, RangeB; unsigned long HSMC_speed; /*--------------------------------------------------------------------------+ | Calculate the HSMC and processor speeds from clock registers. Note that | the processor speed is 4x as the bus speed. | Set the processor_speed and bus_speed fields in the board_cfg structure. +--------------------------------------------------------------------------*/ temp_value = ppcMfclkgpcr(); RangeB = 8 - ((temp_value >> 8) & 0x7); RangeA = 8 - ((temp_value >> 4) & 0x7); Mult = temp_value & 0xf; if (!Mult) { Mult = 16; } temp_value = PROC_CLOCK * Mult * RangeA / RangeB ; board_cfg.processor_speed = temp_value / 2; HSMC_speed = temp_value / 4; board_cfg.bus_speed = temp_value / 8; Ticks_per_sec = BOARD_CLOCK;}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -