On Sun, Dec 30, 2018 at 11:12 PM Finn Thain wrote:
> On Sun, 30 Dec 2018, LEROY Christophe wrote:
> But I'm over-simplifying. Arnd's alternative actually goes like this,
>
> #if defined(CONFIG_MAC) && !defined(CONFIG_ATARI)
> const struct nvram_ops arch_nvram_ops = {
> /* ... */
> }
>
On Sun, 30 Dec 2018, LEROY Christophe wrote:
> > >
> > > Since the operations are almost entirely distinct, why not have two
> > > separate 'nvram_ops' instances here that each refer to just the set
> > > they actually need?
> > >
> >
> > The reason for that is that I am alergic to code
Finn Thain a écrit :
On Sat, 29 Dec 2018, Arnd Bergmann wrote:
On Wed, Dec 26, 2018 at 1:43 AM Finn Thain
wrote:
> +
> +static ssize_t m68k_nvram_get_size(void)
> +{
> + if (MACH_IS_ATARI)
> + return atari_nvram_get_size();
> + else if (MACH_IS_MAC)
> +
On Sat, 29 Dec 2018, Arnd Bergmann wrote:
> On Wed, Dec 26, 2018 at 1:43 AM Finn Thain wrote:
>
> > +
> > +static ssize_t m68k_nvram_get_size(void)
> > +{
> > + if (MACH_IS_ATARI)
> > + return atari_nvram_get_size();
> > + else if (MACH_IS_MAC)
> > +
On Wed, Dec 26, 2018 at 1:43 AM Finn Thain wrote:
> +
> +static ssize_t m68k_nvram_get_size(void)
> +{
> + if (MACH_IS_ATARI)
> + return atari_nvram_get_size();
> + else if (MACH_IS_MAC)
> + return mac_pram_get_size();
> + return -ENODEV;
> +}
> +
>
A multi-platform kernel binary has to decide at run-time how to dispatch
the arch_nvram_ops calls. Add a platform-independent arch_nvram_ops
struct for this, to replace the atari-specific one.
Enable CONFIG_HAVE_ARCH_NVRAM_OPS for Macs.
Signed-off-by: Finn Thain
Tested-by: Christian T. Steigies
6 matches
Mail list logo