|
From: Paul M. <le...@li...> - 2007-08-03 04:25:01
|
On Fri, Aug 03, 2007 at 12:09:51AM -0400, Mike Frysinger wrote: > On Friday 03 August 2007, Paul Mundt wrote: > > On Thu, Aug 02, 2007 at 11:56:49PM -0400, Mike Frysinger wrote: > > > On Thursday 02 August 2007, Adrian McMenamin wrote: > > > > This patch adds a set machine-ops callbacks > > > > > > what is the advantage here over using weaks ? seems like weaks would be > > > simpler and better because you could cull the default ones at link time > > > if a board provided its own ... > > > > Multiple machine support, basically. Weak symbols won't work for the case > > where multiple boards are linked in to the same image. We can have > > multiple machvecs packed in at once and simply discard the ones we don't > > care about at boot time (as per arch/sh/kernel/machvec.c). > > ah, i'd forgotten about that aspect ... is that the only upside ? i'm > debating doing this in Blackfin and at the moment i'd just use weaks since we > have no infrastructure to do multiple board support and we dont have plans to > add it anytime soon ... Hypervisors like to overload these as well, Xen has its own set of machine_ops on i386 for example. So unless you forsee caring about virtualization or supporting multiple machines, there's probably not a lot of gain in doing this for Blackfin. While it's not really a problem these days, old versions of GCC used to have some problems with the attribute -- hence the comment above the cond_syscall() definition (asm/unistd.h), which has since been copied verbatim by almost every other platform, sh and blackfin included ;-) In any event, supporting multiple boards is fairly trivial, but you give up link-time size savings and push most of that down to freeing of init memory. It works out the same in the end, the main factor is how constrained you are in kernel size. Some platforms (ie, hppa) also make function pointers quite expensive, so there are also performance reasons why you may wish to avoid the extra layer of indirection. |