linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Axtens <dja@axtens.net>
To: Masahiro Yamada <yamada.masahiro@socionext.com>,
	Nicholas Piggin <npiggin@gmail.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: powerpc asm-prototypes.h seems odd
Date: Wed, 28 Aug 2019 00:04:38 +1000	[thread overview]
Message-ID: <871rx64scp.fsf@dja-thinkpad.axtens.net> (raw)
In-Reply-To: <CAK7LNATg7O0ZQQ4fe2maNqf0ascHU8b2Mfnqkrxzpzj8D_X7pQ@mail.gmail.com>

Masahiro Yamada <yamada.masahiro@socionext.com> writes:

> Hi.
>
> Lots of powerpc files include <asm/asm-prototypes.h>,
> and powerpc is the only architecture that does this.
>
> <asm/asm-prototypes.h> exists to support modversion for asm.
> So, it is supposed to be parsed by genksysms, not to be
> included from other files.  Right?

It exists to support sparse, squashing a bunch of sparse warnings.

From the commit where I introduced it:

commit 42f5b4cacd783faf05e3ff8bf85e8be31f3dfa9d
Author: Daniel Axtens <dja@axtens.net>
Date:   Wed May 18 11:16:50 2016 +1000

    powerpc: Introduce asm-prototypes.h
    
    Sparse picked up a number of functions that are implemented in C and
    then only referred to in asm code.
    
    This introduces asm-prototypes.h, which provides a place for
    prototypes of these functions.
    
    This silences some sparse warnings.
    
    Signed-off-by: Daniel Axtens <dja@axtens.net>
    [mpe: Add include guards, clean up copyright & GPL text]
    Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

Regards,
Daniel

>
>
> $  git grep  asm/asm-prototypes.h
> arch/arm64/include/asm/asm-prototypes.h: * ... kbuild will
> automatically pick these up from <asm/asm-prototypes.h> and
> arch/powerpc/kernel/early_32.c:#include <asm/asm-prototypes.h>
> arch/powerpc/kernel/irq.c:#include <asm/asm-prototypes.h>
> arch/powerpc/kernel/machine_kexec_64.c:#include <asm/asm-prototypes.h>
> arch/powerpc/kernel/process.c:#include <asm/asm-prototypes.h>
> arch/powerpc/kernel/prom_init.c:#include <asm/asm-prototypes.h>
> arch/powerpc/kernel/ptrace.c:#include <asm/asm-prototypes.h>
> arch/powerpc/kernel/security.c:#include <asm/asm-prototypes.h>
> arch/powerpc/kernel/setup_32.c:#include <asm/asm-prototypes.h>
> arch/powerpc/kernel/signal_32.c:#include <asm/asm-prototypes.h>
> arch/powerpc/kernel/signal_64.c:#include <asm/asm-prototypes.h>
> arch/powerpc/kernel/smp.c:#include <asm/asm-prototypes.h>
> arch/powerpc/kernel/syscalls.c:#include <asm/asm-prototypes.h>
> arch/powerpc/kernel/tau_6xx.c:#include <asm/asm-prototypes.h>
> arch/powerpc/kernel/time.c:#include <asm/asm-prototypes.h>
> arch/powerpc/kernel/trace/ftrace.c:#include <asm/asm-prototypes.h>
> arch/powerpc/kernel/traps.c:#include <asm/asm-prototypes.h>
> arch/powerpc/kvm/book3s_emulate.c:#include <asm/asm-prototypes.h>
> arch/powerpc/kvm/book3s_hv.c:#include <asm/asm-prototypes.h>
> arch/powerpc/kvm/book3s_hv_builtin.c:#include <asm/asm-prototypes.h>
> arch/powerpc/kvm/book3s_hv_rm_xive.c:#include <asm/asm-prototypes.h>
> arch/powerpc/kvm/book3s_pr.c:#include <asm/asm-prototypes.h>
> arch/powerpc/lib/vmx-helper.c:#include <asm/asm-prototypes.h>
> arch/powerpc/mm/book3s64/hash_utils.c:#include <asm/asm-prototypes.h>
> arch/powerpc/mm/book3s64/slb.c:#include <asm/asm-prototypes.h>
> arch/powerpc/platforms/powernv/idle.c:#include <asm/asm-prototypes.h>
> arch/powerpc/platforms/powernv/opal-call.c:#include <asm/asm-prototypes.h>
> arch/powerpc/platforms/powernv/opal-tracepoints.c:#include
> <asm/asm-prototypes.h>
> arch/powerpc/platforms/pseries/lpar.c:#include <asm/asm-prototypes.h>
> scripts/Makefile.build:# .S file exports must have their C prototypes
> defined in asm/asm-prototypes.h
> scripts/Makefile.build:     echo "\#include <asm/asm-prototypes.h>" ;
>                             \
> scripts/Makefile.build:ASM_PROTOTYPES := $(wildcard
> $(srctree)/arch/$(SRCARCH)/include/asm/asm-prototypes.h)
>
>
>
> -- 
> Best Regards
> Masahiro Yamada

      reply	other threads:[~2019-08-27 14:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-27 11:04 powerpc asm-prototypes.h seems odd Masahiro Yamada
2019-08-27 14:04 ` Daniel Axtens [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871rx64scp.fsf@dja-thinkpad.axtens.net \
    --to=dja@axtens.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.com \
    --cc=yamada.masahiro@socionext.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).