Subject: Re: CVS commit: src/sys/arch/evbppc
To: None <shige@NetBSD.org>
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
List: source-changes
Date: 01/23/2005 06:00:42
> Powerpc/ibm4xx/machdep.c includes functions declared at kern/*.c.
> These functions are glue.

What are "glue functions"?
Why should these functions be in MI ibm4xx place?

> Powerpc/ibm4xx/ibmXXX_machdep.c includes real functions.
> 
> The reason of above layout is that I don't want the following situation:
>     evbppc/obs405/machdep.c:
>         cpu_reboot()
>     powerpc/ibm4xx/ibm4xx_machdep.c: [4xx-common functions]
>         cpu_configure()
>         cpu_startup()
>     powerpc/ibm4xx/ibm40x_machdep.c: [40x-common functions]
>         cpu_startup()
>         cpu_reboot()
> If I want to use ibm4xx_machdep.c:cpu_configure.c and 
> ibm40x_machdep.c:cpu_startup.c for obs405 machine,
> this layout causes object-linking-conflict.
>
> I have an another naming proposal bellow.
>    evbppc/xxx/machdep.c
>    powerpc/ibm4xx/machdep_glue.c
>    powerpc/ibm4xx/ibm4xx_machdep.c
>    powerpc/ibm4xx/ibm40x_machdep.c
>       :
> Is it ok?

I don't think so.
You should just move consinit() and cpu_startup() to MD machdep.c
and remove these "glue" functions in the MI place.
These glue functions are not needed at all if you don't
share the single binary among those ports.
(I don't know if all evbppc machine can share single
 kernel binary, though)

On the other hand, softnet() and softserial in ibm4xx/machdep.c
don't seem ibm4xx specific at all, then ibm4xx/machdep.c can be removed.
---
Izumi Tsutsui
tsutsui@ceres.dti.ne.jp