# # Copyright (C) 2008-2010 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=button-hotplug PKG_RELEASE:=3 include $(INCLUDE_DIR)/package.mk define KernelPackage/button-hotplug SUBMENU:=Other modules TITLE:=Button Hotplug driver DEPENDS:=+kmod-input-core FILES:=$(PKG_BUILD_DIR)/button-hotplug.ko AUTOLOAD:=$(call AutoLoad,30,button-hotplug,1) KCONFIG:= endef define KernelPackage/button-hotplug/description Kernel module to generate button uevent-s from input subsystem events. If your device uses GPIO buttons, see gpio-button-hotplug. endef EXTRA_KCONFIG:= \ CONFIG_BUTTON_HOTPLUG=m EXTRA_CFLAGS:= \ $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(EXTRA_KCONFIG)))) \ $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) \ MAKE_OPTS:= \ ARCH="$(LINUX_KARCH)" \ CROSS_COMPILE="$(TARGET_CROSS)" \ SUBDIRS="$(PKG_BUILD_DIR)" \ EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ $(EXTRA_KCONFIG) define Build/Compile $(MAKE) -C "$(LINUX_DIR)" \ $(MAKE_OPTS) \ modules endef $(eval $(call KernelPackage,button-hotplug)) tion> xenJames
aboutsummaryrefslogtreecommitdiffstats
path: root/tools/ioemu/hostregs_helper.h
blob: 4fdf8ad9642cc47afa4d7b5e4980fb2c2107a291 (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*
 *  Save/restore host registrs.
 *
 *  Copyright (c) 2007 CodeSourcery
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

/* The GCC global register vairable extension is used to reserve some
   host registers for use by dyngen.  However only the core parts of the
   translation engine are compiled with these settings.  We must manually
   save/restore these registers when called from regular code.
   It is not sufficient to save/restore T0 et. al. as these may be declared
   with a datatype smaller than the actual register.  */

#if defined(DECLARE_HOST_REGS)

#define DO_REG(REG)					\
    register host_reg_t reg_AREG##REG asm(AREG##REG);	\
    volatile host_reg_t saved_AREG##REG;

#elif defined(SAVE_HOST_REGS)

#define DO_REG(REG)					\
    __asm__ __volatile__ ("" : "=r" (reg_AREG##REG));	\
    saved_AREG##REG = reg_AREG##REG;

#else

#define DO_REG(REG)                                     \
    reg_AREG##REG = saved_AREG##REG;		        \
    __asm__ __volatile__ ("" : : "r" (reg_AREG##REG));

#endif

#ifdef AREG0
DO_REG(0)
#endif

#ifdef AREG1
DO_REG(1)
#endif

#ifdef AREG2
DO_REG(2)
#endif

#ifdef AREG3
DO_REG(3)
#endif

#ifdef AREG4
DO_REG(4)
#endif

#ifdef AREG5
DO_REG(5)
#endif

#ifdef AREG6
DO_REG(6)
#endif

#ifdef AREG7
DO_REG(7)
#endif

#ifdef AREG8
DO_REG(8)
#endif

#ifdef AREG9
DO_REG(9)
#endif

#ifdef AREG10
DO_REG(10)
#endif

#ifdef AREG11
DO_REG(11)
#endif

#undef SAVE_HOST_REGS
#undef DECLARE_HOST_REGS
#undef DO_REG