From patchwork Mon Oct 18 17:40:00 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?Q?Llu=C3=ADs?= X-Patchwork-Id: 68944 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 65642B70CB for ; Sat, 23 Oct 2010 06:44:19 +1100 (EST) Received: from localhost ([127.0.0.1]:59802 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P9NXD-0002e4-6D for incoming@patchwork.ozlabs.org; Fri, 22 Oct 2010 15:44:15 -0400 Received: from [140.186.70.92] (port=45628 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P9Mt1-0001zd-BK for qemu-devel@nongnu.org; Fri, 22 Oct 2010 15:02:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P9Moh-0005RA-UY for qemu-devel@nongnu.org; Fri, 22 Oct 2010 14:58:17 -0400 Received: from mailout-de.gmx.net ([213.165.64.22]:39750 helo=mail.gmx.net) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1P9Moh-0005R3-I4 for qemu-devel@nongnu.org; Fri, 22 Oct 2010 14:58:15 -0400 Received: (qmail invoked by alias); 22 Oct 2010 18:58:13 -0000 Received: from unknown (EHLO localhost) [84.88.53.92] by mail.gmx.net (mp026) with SMTP; 22 Oct 2010 20:58:13 +0200 X-Authenticated: #12333383 X-Provags-ID: V01U2FsdGVkX1/gMagcKFXgkWiyh3ytuQLYbDCbEuz31H7HtHgoNX EWJsnF5hnMs2kF From: xscript@gmx.net (=?utf-8?Q?Llu=C3=ADs?=) To: qemu-devel@nongnu.org In-Reply-To: Date: Mon, 18 Oct 2010 19:40:00 +0200 References: Message-Id: <0bce3e1c0a41bd1d7c0036c9086fd9c2678c8057.1287772676.git.vilanova@ac.upc.edu> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH 04/18] backdoor: Declare guest-side interface macros X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Header for the user to include when compiling guest applications that want to communicate with QEMU through backdoor instructions. Signed-off-by: Lluís Vilanova --- backdoor/guest.h | 36 ++++++++++++++++++++++++++++++++++++ 1 files changed, 36 insertions(+), 0 deletions(-) create mode 100644 backdoor/guest.h diff --git a/backdoor/guest.h b/backdoor/guest.h new file mode 100644 index 0000000..58847e2 --- /dev/null +++ b/backdoor/guest.h @@ -0,0 +1,36 @@ +/* + * Guest-side interface for instruction-based backdoor communication. + * + * Copyright (c) 2010 Lluís Vilanova + * + * 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, see . + */ + +#ifndef BACKDOOR_GUEST_H +#define BACKDOOR_GUEST_H + +/* Backdoor macro names define the types of its arguments: + * + * - i8: immediate of 8 bits + * - V: value passed in register + */ + +#error Undefined instruction-based backdoor interface for guest architecture + +#define __str(s) #s +#define __xstr(s) __str(s) + +#define __BACKDOOR_i8(b) asm volatile (".byte " __xstr(b)) + +#endif /* BACKDOOR_GUEST_H */