3 * Copyright (C) 2008 Tomas 'ZeXx86' Jedrzejek (zexx86@zexos.org)
4 * Copyright (C) 2009 Tomas 'ZeXx86' Jedrzejek (zexx86@zexos.org)
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
23 static unsigned long read_pentium_clock ()
28 __asm__
__volatile__ ("rdtsc" : "=a" (lb
), "=d" (hb
));
30 return( ((unsigned long) hb
) << 24 | lb
);
35 printf ("CPU: i386 compatibile\nClock: %lu MHz\n", read_pentium_clock ());
38 /* enable interrupts */
39 unsigned int_enable ()
41 __asm__
__volatile__("sti"
49 /* disable interrupts */
50 unsigned int_disable ()
54 __asm__
__volatile__("pushfl\n"
66 #ifndef CONFIG_COMPAT_QEMU /* dont know, but it is probably Qemu bug, because it hard halt cpu */
71 unsigned arch_cpu_reset ()
78 unsigned arch_cpu_shutdown ()
84 /* architecture initialization process */
99 if (!timer_install ())