1#ifndef _ASM_IA64_SN_IDLE_H
2#define _ASM_IA64_SN_IDLE_H
3
4/*
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License.  See the file "COPYING" in the main directory of this archive
7 * for more details.
8 *
9 * Copyright (c) 2001-2002 Silicon Graphics, Inc.  All rights reserved.
10 */
11
12#include <linux/config.h>
13#include <asm/sn/leds.h>
14#include <asm/sn/simulator.h>
15
16static __inline__ void
17snidle(void) {
18
19#ifdef CONFIG_IA64_SGI_AUTOTEST
20	{
21		extern int	autotest_enabled;
22		if (autotest_enabled) {
23			extern void llsc_main(int);
24			llsc_main(smp_processor_id());
25		}
26	}
27#endif
28
29	if (pda.idle_flag == 0) {
30		/*
31		 * Turn the activity LED off.
32		 */
33		set_led_bits(0, LED_CPU_ACTIVITY);
34	}
35
36#ifdef CONFIG_IA64_SGI_SN_SIM
37	if (IS_RUNNING_ON_SIMULATOR())
38		SIMULATOR_SLEEP();
39#endif
40
41	pda.idle_flag = 1;
42}
43
44static __inline__ void
45snidleoff(void) {
46	/*
47	 * Turn the activity LED on.
48	 */
49	set_led_bits(LED_CPU_ACTIVITY, LED_CPU_ACTIVITY);
50
51	pda.idle_flag = 0;
52}
53
54#endif /* _ASM_IA64_SN_IDLE_H */
55