From patchwork Wed Feb 19 10:35:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 24940 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f71.google.com (mail-qa0-f71.google.com [209.85.216.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7373D20A63 for ; Wed, 19 Feb 2014 10:36:51 +0000 (UTC) Received: by mail-qa0-f71.google.com with SMTP id j5sf269765qaq.2 for ; Wed, 19 Feb 2014 02:36:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=B4SAwwEYvz+QSMrg53TYNdL/8focDQFJAuB7DTIc7cM=; b=Lp8EiFUwCKmJ9JHJNMWqOpf7NGPTVhCB/OMExmbp9lEZfyPlogyx7SYRXC2vEChpHq mp3Wv1IL1xWRhAVcPWGJ4gzjxCAayL2XE/5E+QclGX1dut7OGZO7Nj4QbbkYd1vSKahn 1KdwRi+GfhrFyNB24cUxnCjorrOIzl7X3kUnEoC1JXIbAxNYnOgXn3wOSmvGj7b1es2D waogLewGEGn7XOlsjTaxoOFEicqx8qUoeotKfKZk+yxRTYM4dFu+tx7rIWY9EMszXNBS ES9bCQw9AXSgjHYXELLbtBGnj182ysrZfCJq+3IXvA9B/1fhEX1mknQWQ7TV4b9L/RsC JJbg== X-Gm-Message-State: ALoCoQlv9VtVX+NHMgqyMJ95qAqBWyjW2iBlnnxm5T3s6H5QLQXE+TjCtp7QyIll+FmJ/EK5ZNT9 X-Received: by 10.236.18.196 with SMTP id l44mr13603512yhl.52.1392806211201; Wed, 19 Feb 2014 02:36:51 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.95.134 with SMTP id i6ls43080qge.2.gmail; Wed, 19 Feb 2014 02:36:51 -0800 (PST) X-Received: by 10.220.103.141 with SMTP id k13mr20694809vco.25.1392806211101; Wed, 19 Feb 2014 02:36:51 -0800 (PST) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id ku3si2117492veb.136.2014.02.19.02.36.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Feb 2014 02:36:51 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.171; Received: by mail-ve0-f171.google.com with SMTP id pa12so178586veb.30 for ; Wed, 19 Feb 2014 02:36:51 -0800 (PST) X-Received: by 10.52.23.68 with SMTP id k4mr17649743vdf.24.1392806211007; Wed, 19 Feb 2014 02:36:51 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.174.196 with SMTP id u4csp286938vcz; Wed, 19 Feb 2014 02:36:50 -0800 (PST) X-Received: by 10.236.7.100 with SMTP id 64mr40120363yho.23.1392806210603; Wed, 19 Feb 2014 02:36:50 -0800 (PST) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id j55si29266267yhf.91.2014.02.19.02.36.50 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 19 Feb 2014 02:36:50 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:58088 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WG4WH-0008If-TR for patch@linaro.org; Wed, 19 Feb 2014 05:36:49 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49427) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WG4V9-00076r-33 for qemu-devel@nongnu.org; Wed, 19 Feb 2014 05:35:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WG4V3-0007Cx-AJ for qemu-devel@nongnu.org; Wed, 19 Feb 2014 05:35:38 -0500 Received: from afflict.kos.to ([92.243.29.197]:33843) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WG4V3-0007CD-1r for qemu-devel@nongnu.org; Wed, 19 Feb 2014 05:35:33 -0500 Received: from localhost.localdomain (afflict [92.243.29.197]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by afflict.kos.to (Postfix) with ESMTPSA id AAA1326563; Wed, 19 Feb 2014 11:35:30 +0100 (CET) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Wed, 19 Feb 2014 12:35:28 +0200 Message-Id: X-Mailer: git-send-email 1.7.2.5 In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 92.243.29.197 Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [Qemu-devel] [PATCH 5/6] linux-user: Implement BLKPG ioctl X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: riku.voipio@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Andreas Färber Signed-off-by: Andreas Färber Reviewed-by: Peter Maydell Signed-off-by: Riku Voipio --- linux-user/ioctls.h | 1 + linux-user/syscall.c | 1 + linux-user/syscall_defs.h | 1 + linux-user/syscall_types.h | 13 +++++++++++++ 4 files changed, 16 insertions(+) diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h index 7381012..309fb21 100644 --- a/linux-user/ioctls.h +++ b/linux-user/ioctls.h @@ -77,6 +77,7 @@ IOCTL(BLKRAGET, IOC_R, MK_PTR(TYPE_LONG)) IOCTL(BLKSSZGET, IOC_R, MK_PTR(TYPE_LONG)) IOCTL(BLKBSZGET, IOC_R, MK_PTR(TYPE_INT)) + IOCTL(BLKPG, IOC_W, MK_PTR(MK_STRUCT(STRUCT_blkpg_ioctl_arg))) #ifdef FIBMAP IOCTL(FIBMAP, IOC_W | IOC_R, MK_PTR(TYPE_LONG)) #endif diff --git a/linux-user/syscall.c b/linux-user/syscall.c index bb3e4b1..8f5a58e 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -107,6 +107,7 @@ int __clone2(int (*fn)(void *), void *child_stack_base, #include #include #include +#include #include "linux_loop.h" #include "cpu-uname.h" diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index ae30476..3c8869e 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -901,6 +901,7 @@ struct target_pollfd { #define TARGET_BLKSECTSET TARGET_IO(0x12,102)/* set max sectors per request (ll_rw_blk.c) */ #define TARGET_BLKSECTGET TARGET_IO(0x12,103)/* get max sectors per request (ll_rw_blk.c) */ #define TARGET_BLKSSZGET TARGET_IO(0x12,104)/* get block device sector size */ +#define TARGET_BLKPG TARGET_IO(0x12,105)/* Partition table and disk geometry handling */ /* A jump here: 108-111 have been used for various private purposes. */ #define TARGET_BLKBSZGET TARGET_IOR(0x12, 112, abi_ulong) #define TARGET_BLKBSZSET TARGET_IOW(0x12, 113, abi_ulong) diff --git a/linux-user/syscall_types.h b/linux-user/syscall_types.h index 44b6a58..9d0c92d 100644 --- a/linux-user/syscall_types.h +++ b/linux-user/syscall_types.h @@ -240,3 +240,16 @@ STRUCT(fiemap, TYPE_INT, /* fm_mapped_extents */ TYPE_INT, /* fm_extent_count */ TYPE_INT) /* fm_reserved */ + +STRUCT(blkpg_partition, + TYPE_LONGLONG, /* start */ + TYPE_LONGLONG, /* length */ + TYPE_INT, /* pno */ + MK_ARRAY(TYPE_CHAR, BLKPG_DEVNAMELTH), /* devname */ + MK_ARRAY(TYPE_CHAR, BLKPG_VOLNAMELTH)) /* volname */ + +STRUCT(blkpg_ioctl_arg, + TYPE_INT, /* op */ + TYPE_INT, /* flags */ + TYPE_INT, /* datalen */ + MK_PTR(MK_STRUCT(STRUCT_blkpg_partition))) /* data */