aboutsummaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@android.com>2011-05-19 20:51:01 +0200
committerXavier Ducrohet <xav@android.com>2011-08-05 12:27:24 -0700
commitf490aee025b3bab5bcdb065e5fc1b1abecf16b97 (patch)
treeace0400c734e32b1516cad415be4aaa6b8f9880c /hw
parent97d15562536c28f5a8bb079994cc526412cf506e (diff)
downloadexternal_qemu-f490aee025b3bab5bcdb065e5fc1b1abecf16b97.zip
external_qemu-f490aee025b3bab5bcdb065e5fc1b1abecf16b97.tar.gz
external_qemu-f490aee025b3bab5bcdb065e5fc1b1abecf16b97.tar.bz2
Merge c80340 from master to r13: Move charmap to hardware properties
The name of the emulated charmap must be passed to the guest kernel because it is used by the guest input handling code to load the proper charmap files from the system partition. This mandates that the name becomes a hardware property for the sake of supporting proper snapshotting and ui/core separation. From now on, the charmap name found in a skin will be ignored completely. This shouldn't be a problem in practice because all skins used the default name (qwerty2) anyway. The only reason to change the default value would be if emulating a guest system image that depends on a different charmap during emulation. Change-Id: If571684000b159ae9e9849661c9ff18e19b4cc75
Diffstat (limited to 'hw')
-rw-r--r--hw/goldfish_events_device.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/hw/goldfish_events_device.c b/hw/goldfish_events_device.c
index 3072e3b..a5b2a21 100644
--- a/hw/goldfish_events_device.c
+++ b/hw/goldfish_events_device.c
@@ -102,8 +102,6 @@ static int events_state_load(QEMUFile* f, void* opaque, int version_id)
return qemu_get_struct(f, events_state_fields, s);
}
-extern const char* android_skin_keycharmap;
-
static void enqueue_event(events_state *s, unsigned int type, unsigned int code, int value)
{
int enqueued = s->last - s->first;
@@ -169,22 +167,11 @@ static unsigned dequeue_event(events_state *s)
return n;
}
-static const char*
-get_charmap_name(events_state *s)
-{
- if (s->name != NULL)
- return s->name;
-
- s->name = android_get_charmap_name();
- return s->name;
-}
-
-
static int get_page_len(events_state *s)
{
int page = s->page;
if (page == PAGE_NAME) {
- const char* name = get_charmap_name(s);
+ const char* name = s->name;
return strlen(name);
} if (page >= PAGE_EVBITS && page <= PAGE_EVBITS + EV_MAX)
return s->ev_bits[page - PAGE_EVBITS].len;
@@ -200,7 +187,7 @@ static int get_page_data(events_state *s, int offset)
if (offset > page_len)
return 0;
if (page == PAGE_NAME) {
- const char* name = get_charmap_name(s);
+ const char* name = s->name;
return name[offset];
} if (page >= PAGE_EVBITS && page <= PAGE_EVBITS + EV_MAX)
return s->ev_bits[page - PAGE_EVBITS].bits[offset];
@@ -347,9 +334,6 @@ void events_dev_init(uint32_t base, qemu_irq irq)
s = (events_state *) qemu_mallocz(sizeof(events_state));
- // charmap name will be determined on demand
- s->name = NULL;
-
/* now set the events capability bits depending on hardware configuration */
/* apparently, the EV_SYN array is used to indicate which other
* event classes to consider.
@@ -514,6 +498,7 @@ void events_dev_init(uint32_t base, qemu_irq irq)
s->first = 0;
s->last = 0;
s->state = STATE_INIT;
+ s->name = qemu_strdup(config->hw_keyboard_charmap);
/* This function migh fire buffered events to the device, so
* ensure that it is called after initialization is complete