aboutsummaryrefslogtreecommitdiffstats
path: root/android/hw-kmsg.c
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-03 18:28:35 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-03 18:28:35 -0800
commitf721e3ac031f892af46f255a47d7f54a91317b30 (patch)
tree4b825dc642cb6eb9a060e54bf8d69288fbee4904 /android/hw-kmsg.c
parentbae1bc39312d5019bd9a5b8d840a529213a69a17 (diff)
downloadexternal_qemu-f721e3ac031f892af46f255a47d7f54a91317b30.zip
external_qemu-f721e3ac031f892af46f255a47d7f54a91317b30.tar.gz
external_qemu-f721e3ac031f892af46f255a47d7f54a91317b30.tar.bz2
auto import from //depot/cupcake/@135843
Diffstat (limited to 'android/hw-kmsg.c')
-rw-r--r--android/hw-kmsg.c70
1 files changed, 0 insertions, 70 deletions
diff --git a/android/hw-kmsg.c b/android/hw-kmsg.c
deleted file mode 100644
index 987943b..0000000
--- a/android/hw-kmsg.c
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Copyright (C) 2007-2008 The Android Open Source Project
-**
-** This software is licensed under the terms of the GNU General Public
-** License version 2, as published by the Free Software Foundation, and
-** may be copied, distributed, and modified under those terms.
-**
-** This program 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 General Public License for more details.
-*/
-#include "android/hw-kmsg.h"
-#include "qemu-char.h"
-#include "charpipe.h"
-#include "android/utils/debug.h"
-
-static CharDriverState* android_kmsg_cs;
-
-typedef struct {
- CharDriverState* cs;
- AndroidKmsgFlags flags;
-} KernelLog;
-
-static int
-kernel_log_can_read( void* opaque )
-{
- return 1024;
-}
-
-static void
-kernel_log_read( void* opaque, const uint8_t* from, int len )
-{
- KernelLog* k = opaque;
-
- if (k->flags & ANDROID_KMSG_PRINT_MESSAGES)
- printf( "%.*s", len, (const char*)from );
-
- /* XXXX: TODO: save messages into in-memory buffer for later retrieval */
-}
-
-static void
-kernel_log_init( KernelLog* k, AndroidKmsgFlags flags )
-{
- if ( qemu_chr_open_charpipe( &k->cs, &android_kmsg_cs ) < 0 ) {
- derror( "could not create kernel log charpipe" );
- exit(1);
- }
-
- qemu_chr_add_handlers( k->cs, kernel_log_can_read, kernel_log_read, NULL, k );
-
- k->flags = flags;
-}
-
-static KernelLog _kernel_log[1];
-
-void
-android_kmsg_init( AndroidKmsgFlags flags )
-{
- if (_kernel_log->cs == NULL)
- kernel_log_init( _kernel_log, flags );
-}
-
-
-CharDriverState* android_kmsg_get_cs( void )
-{
- if (android_kmsg_cs == NULL) {
- android_kmsg_init(0);
- }
- return android_kmsg_cs;
-}