Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1897387ybi; Thu, 4 Jul 2019 01:35:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqw/6VyXhZDdq7QORcHP8R9DrCAh4YP7C5k/ElI1tkgK3md4jI/TJ85s5NN1phaz81s3RAH8 X-Received: by 2002:a17:902:246:: with SMTP id 64mr46790550plc.311.1562229348758; Thu, 04 Jul 2019 01:35:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562229348; cv=none; d=google.com; s=arc-20160816; b=Jz2ENwm9p0CbFQnNR+aAlrAr02Iy63YQBd1Gf7VkBCwPYlZbkKhuxo3OGEHFj+ESQS 8nn03Ukl5zs5X6eBgcbWchNa1B/2gHFaLL9QI8JeHWkmCQ0YHh7V6xx2K4+zbiKYvMjN t+X2beOowhQclYohHt7Amicb1A+UkCm38FAdeXClHZgRUribLb9CnNJ4MWGnygtCilvh iBNvuEG5vC8yKkwEo6LiIQizegRpq9eoYXk6gVJWJgZsMc2T2XNkiWtmZSdgIiDzjCzi fh0btyH9fZllgkn+WsJAqFTDqFsYYLiKD8saQaHzOstEN86S9qy0q8o1vF3oeDg1N4Oa pISQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=++/HKhsN/QQmLM6JQP1fW7J8KtQqaq40rFMcnPScN9I=; b=TAHpEK8F1Dadu+rlhB0ae4WGWZrWKUPZwRkEoQmOoFg2hdBPzYB10cLpXc+WlW9Ys6 QjQBfGgjpCjbwSHUsXG21NNIy71bqqf7iSglqonF8G6lMRu1oSARODk1EdX0WVHiW7Rw qlC+JS0Zd5S9rPx5ackAaf8J5uo0gQrFJUeGkTpfdWptNERbCsBge6fKkpI8wmoNyZHg M43jEOXpCSBUcQa23rzwpyYCmvG4hinj24/i/X/99L/+oJgCHnVv1rOdc1LLUBkdCuBj nqoFyLsIK52Ldf/B4QO5KLrw9ItgRvajsLSUiSELSfd96hKv5bzHGwjo8qf6RLzcHBez EHmA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 64si2104081plk.87.2019.07.04.01.35.33; Thu, 04 Jul 2019 01:35:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727046AbfGDIei (ORCPT + 99 others); Thu, 4 Jul 2019 04:34:38 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:35650 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726805AbfGDIei (ORCPT ); Thu, 4 Jul 2019 04:34:38 -0400 Received: by mail-qk1-f195.google.com with SMTP id r21so4709132qke.2 for ; Thu, 04 Jul 2019 01:34:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=++/HKhsN/QQmLM6JQP1fW7J8KtQqaq40rFMcnPScN9I=; b=QRy/VS145q02ewAmxoO+V1Q4m4YchBvIGn1kSzKdgzAIONmb1QfyiOfzyzJ5Q+96Tm XaGfl+lvMYoIT6bia7u3mjsU6LNRgwox7Hi8Lsy/Hd2MnKx9YtjZGk0c4eumZQ48KcQC OYLJIDVWjKwdY0VccRQh0tpxPW7p3M+w7oBvEZq4PwL21ji99pmpJZYB9R32Jps3Eb2o hxt1A/fsl4uslMBltVzsOtzQYCdK1PKGv+pNHUinNxv+aYuVOueO/AWdVWxpa9KQpbWA JaXrUOXLrp78Xvsd866g5uIjOsXZdRED6v5rHpH9M7mbNhM1loqGTkk3n/3SSsoOqhUc k3ww== X-Gm-Message-State: APjAAAUWGhyk8HpPn7l67sCZZ/G84hga6s0fkSE42kSjEC+nygreXdZ4 iBvVVuQLu73YrdcFj85bbDh68MEHYsNfoe2xYpg= X-Received: by 2002:a37:ad12:: with SMTP id f18mr33754444qkm.3.1562229277017; Thu, 04 Jul 2019 01:34:37 -0700 (PDT) MIME-Version: 1.0 References: <20190703001842.12238-1-alistair.francis@wdc.com> <20190703001842.12238-3-alistair.francis@wdc.com> In-Reply-To: From: Arnd Bergmann Date: Thu, 4 Jul 2019 10:34:20 +0200 Message-ID: Subject: Re: [PATCH 2/2] riscv/include/uapi: Define a custom __SIGINFO struct for RV32 To: Alistair Francis Cc: Alistair Francis , linux-riscv-bounces@lists.infradead.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 4, 2019 at 12:18 AM Alistair Francis wrote: > On Wed, Jul 3, 2019 at 12:47 PM Arnd Bergmann wrote: > > On Wed, Jul 3, 2019 at 8:45 PM Alistair Francis wrote: > > > What I don't understand though is how that impacted this struct, it > > > doesn't use clock_t at all, everything in the struct is an int or > > > void*. > > > > si_utime/si_stime in siginfo are clock_t. > > But they are further down the struct. I just assumed that GCC would > align those as required, I guess it aligns the start of the struct to > match some 64-bit members which seems strange. These are the regular struct alignment rules. Essentially you would get something like struct s { int a; int b; int c; union { int d; long long e; }; int f; }; Since 'e' has 8 byte alignment, the same is true for the union, and putting the union in a struct also requires the same alignment for the struct itself, so now you get padding after 'c' and 'f'. Arnd