summaryrefslogtreecommitdiffstats
path: root/include/asm-arm/arch-arc/system.h
blob: 3becc7b2f81f74fdaf621bcdd1d8b74ef6f25f7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
 * linux/include/asm-arm/arch-arc/system.h
 *
 * Copyright (c) 1996 Russell King and Dave Gilbert
 */
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H

#include <linux/config.h>

#ifdef CONFIG_ARCH_ARC

#define cliIF()				\
	do {				\
	  unsigned long temp;		\
	  __asm__ __volatile__(		\
"	mov	%0, pc\n"		\
"	orr %0, %0, #0x0c000000\n"	\
"	teqp	%0, #0\n"		\
	  : "=r" (temp)	\
    : );	\
  } while(0)

#endif

extern __inline__ void arch_hard_reset (void)
{
	extern void ecard_reset (int card);

	/*
	 * Reset all expansion cards.
	 */
	ecard_reset (-1);

	/*
	 * copy branch instruction to reset location and call it
	 */
	*(unsigned long *)0 = *(unsigned long *)0x03800000;
	((void(*)(void))0)();

	/*
	 * If that didn't work, loop endlessly
	 */
	while (1);
}

#endif