[Cbe-oss-dev] [patch 3/6] spufs: support multi-platform priv1 access

Christoph Hellwig hch at lst.de
Fri Apr 28 01:40:31 EST 2006


On Wed, Apr 26, 2006 at 02:52:39PM -0700, Geoff Levand wrote:
> To support muti-platform binaries the spu hypervisor accessor
> routines must have runtime binding.
> 
> I removed the existing statically linked routines in spu.h
> and spu_priv1.c and created new accessor routines in spu_priv1.h
> that operate indirectly through an ops struct spu_priv1_ops.  Now
> spu_priv1.c contains the instance of the accessor routines
> for running on raw hardware in hypervisor state.
> 
> Signed-off-by: Geoff Levand <geoffrey.levand at am.sony.com>
> 
> Index: cell--alp--1/arch/powerpc/platforms/cell/setup.c
> ===================================================================
> --- cell--alp--1.orig/arch/powerpc/platforms/cell/setup.c	2006-04-26 11:47:22.000000000 -0700
> +++ cell--alp--1/arch/powerpc/platforms/cell/setup.c	2006-04-26 11:47:43.000000000 -0700
> @@ -49,6 +49,7 @@
>  #include <asm/ppc-pci.h>
>  #include <asm/irq.h>
>  #include <asm/spu.h>
> +#include <asm/spu_priv1.h>
> 
>  #include "interrupt.h"
>  #include "iommu.h"
> @@ -60,6 +61,7 @@
>  #define DBG(fmt...)
>  #endif
>  extern void cell_final_fixup(void);
> +extern const struct spu_priv1_ops spu_raw_priv1_ops;

never use externs in .c files, always put them into a proper header,
else you defeat all the prototype checking abilities the C compiler has.

> - * access to SPU privileged registers
> + * spu_priv1.c - This file implements the spu hypervisor abstractions
> + * for running on raw hardware in hypervisor state.

this sentence doesn't make any sense.  it's just direct hardware access,
no need to mention the buzzword of the day two times.  also never
mention the file name in such comments, it's redundant information that
gets out of sync easily.

> + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + *  GNU General Public License for more details.
> + *
> + *  You should have received a copy of the GNU General Public License
> + *  along with this program; if not, write to the Free Software
> + *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
>   */

just scrap this.  The COPYING file in the toplevel dir implies all this.




More information about the cbe-oss-dev mailing list