From nobody Sun Feb 8 22:43:09 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1492987662071307.38445326473413; Sun, 23 Apr 2017 15:47:42 -0700 (PDT) Received: from localhost ([::1]:40855 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2QI8-0005Xb-Ok for importer@patchew.org; Sun, 23 Apr 2017 18:47:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56060) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2QCF-0000cy-99 for qemu-devel@nongnu.org; Sun, 23 Apr 2017 18:41:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d2QCC-0000Y4-SR for qemu-devel@nongnu.org; Sun, 23 Apr 2017 18:41:35 -0400 Received: from mail-it0-x241.google.com ([2607:f8b0:4001:c0b::241]:34182) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d2QCC-0000Xw-Nv for qemu-devel@nongnu.org; Sun, 23 Apr 2017 18:41:32 -0400 Received: by mail-it0-x241.google.com with SMTP id c26so4021211itd.1 for ; Sun, 23 Apr 2017 15:41:32 -0700 (PDT) Received: from localhost (z64.124-44-184.ppp.wakwak.ne.jp. [124.44.184.64]) by smtp.gmail.com with ESMTPSA id r86sm1777560pfb.24.2017.04.23.15.41.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 23 Apr 2017 15:41:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=1ULqFvCAucxpqTx+6eOt1U2rQEOVWS/jn5Ic4C9K95s=; b=ahOlOLT4sbk5ySP48uECFY4uuE8Oi4aaaGjMqns3Zt8TO/9vRIbv6dtxXTyr681oZ5 Bw2j2IKcVYnU1jUZoAK079OIZhWQj6coLs48O4BcYZ5WdAReY0/HnVTNPKoJeK8mLHBd o9KIHYBtiVnzYo/MAt9XyERFQ256X0jVnaVHZArO2C7/IRnQcBqdyGqrI9JYvctIWghq uHL0ILkjmMFr9Z8mMfHU2+WRkaTII0lXPZFHF7B4CgeCAg9+zFOtIk3fKcyyNHe28PVi fLUvArzQ6uThBQ8Ve/OmpGAsOZgoJz1KTqCvpN/u9+w0nWdJ4arsJscHZSkYvRwiWIUl xAIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=1ULqFvCAucxpqTx+6eOt1U2rQEOVWS/jn5Ic4C9K95s=; b=mhutDrCHHMqYsgPqpKes0Ble4SlrId7mgHooJ066r4ztu6Mo1IxIBtg2govjnnWJcn 0EymAmV71uBwFTka9NgFUxBwz8Gm/0Gy7YV7jPr1AA23BWzwLwDws4w3Lzx8vGy/szpO B21lJtNvkyObSW1967KoWquOy6AzPWW+Avu+zQBuEq4GhSgOPhkZ5+C8ipLcVyPUW84A LNvYP6lGZDlX9Q9EO6py8iIa+//5XgQ7jfMJkMdLMwnyKYIAakcXbKfd6dbrGfTgKdPX eACPPN5PtCjtDYEcVLq5AgPkArhpwHLl4AmlJOUT6zO9lTxkA2dqJqgAVr+NHZomP4BX 1ktw== X-Gm-Message-State: AN3rC/7BVOwFaDnqmWEK5YkqSydDxfyXy4/NjhPJZt715NKA95YOOGgI wzXVgm0Ub7zEYg== X-Received: by 10.84.168.131 with SMTP id f3mr28999633plb.160.1492987292036; Sun, 23 Apr 2017 15:41:32 -0700 (PDT) From: Stafford Horne To: QEMU Development Date: Mon, 24 Apr 2017 07:40:55 +0900 Message-Id: <565b9678ec7335762a290afce68f7062bdaf0ce9.1492986468.git.shorne@gmail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4001:c0b::241 Subject: [Qemu-devel] [PATCH v2 7/9] migration: Add VMSTATE_STRUCT_2DARRAY() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stafford Horne , Openrisc , "Tim \\'mithro\\' Ansell" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" For openrisc we implement tlb state as a 2d array of tlb entry structs. This is added to allow easy storing of state of 2d arrays. Signed-off-by: Stafford Horne --- include/migration/vmstate.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index f2dbf84..9b7dcdc 100644 --- a/include/migration/vmstate.h +++ b/include/migration/vmstate.h @@ -499,6 +499,17 @@ extern const VMStateInfo vmstate_info_qtailq; .offset =3D vmstate_offset_array(_state, _field, _type, _num),\ } =20 +#define VMSTATE_STRUCT_2DARRAY_TEST(_field, _state, _n1, _n2, _test, _vers= ion, _vmsd, _type) { \ + .name =3D (stringify(_field)), = \ + .num =3D (_n1) * (_n2), = \ + .field_exists =3D (_test), = \ + .version_id =3D (_version), = \ + .vmsd =3D &(_vmsd), = \ + .size =3D sizeof(_type), = \ + .flags =3D VMS_STRUCT|VMS_ARRAY, = \ + .offset =3D vmstate_offset_2darray(_state, _field, _type, _n1, _= n2),\ +} + #define VMSTATE_STRUCT_VARRAY_UINT8(_field, _state, _field_num, _version, = _vmsd, _type) { \ .name =3D (stringify(_field)), \ .num_offset =3D vmstate_offset_value(_state, _field_num, uint8_t), \ @@ -746,6 +757,10 @@ extern const VMStateInfo vmstate_info_qtailq; VMSTATE_STRUCT_ARRAY_TEST(_field, _state, _num, NULL, _version, \ _vmsd, _type) =20 +#define VMSTATE_STRUCT_2DARRAY(_field, _state, _n1, _n2, _version, _vmsd, = _type) \ + VMSTATE_STRUCT_2DARRAY_TEST(_field, _state, _n1, _n2, NULL, _version, = \ + _vmsd, _type) + #define VMSTATE_BUFFER_UNSAFE_INFO(_field, _state, _version, _info, _size)= \ VMSTATE_BUFFER_UNSAFE_INFO_TEST(_field, _state, NULL, _version, _info,= \ _size) --=20 2.9.3