public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Hollis Blanchard <hollisb@us.ibm.com>
To: Olaf Hering <olh@suse.de>
Cc: Dave Boutcher <boutcher@us.ibm.com>,
	linuxppc64-dev@lists.linuxppc.org, linux-kernel@vger.kernel.org,
	Rusty Russell <rusty@rustcorp.com.au>
Subject: Re: module.viomap support for ppc64
Date: Thu, 12 Aug 2004 14:34:38 -0500	[thread overview]
Message-ID: <1092339278.19137.8.camel@localhost> (raw)
In-Reply-To: <20040812173751.GA30564@suse.de>

On Thu, 2004-08-12 at 12:37, Olaf Hering wrote:
> Current MODULE_DEVICE_TABLE(vio, $table); defines 2 char pointers. I'm
> not sure if depmod can really handle it. Where do they point to in the
> module binary? I could find an answer, so far. I just declared an array.

Olaf explained on irc that output_vio_entry() below was finding NULL for
the name and compat pointers. Perhaps some additional relocation needs
to take place before those can be used?

> diff -p -purN module-init-tools-3.0-pre10.orig/moduleops_core.c module-init-tools-3.0-pre10/moduleops_core.c
> --- module-init-tools-3.0-pre10.orig/moduleops_core.c	2003-12-24 06:17:07.000000000 +0100
> +++ module-init-tools-3.0-pre10/moduleops_core.c	2004-08-12 15:21:44.000000000 +0200
> @@ -176,6 +176,10 @@ static void PERBIT(fetch_tables)(struct
>  	module->ccw_table = PERBIT(deref_sym)(module->data,
>  					"__mod_ccw_device_table");
> 
> +	module->vio_size = PERBIT(VIO_DEVICE_SIZE);
> +	module->vio_table = PERBIT(deref_sym)(module->data,
> +					"__mod_vio_device_table");
> +
>  	module->ieee1394_size = PERBIT(IEEE1394_DEVICE_SIZE);
>  	module->ieee1394_table = PERBIT(deref_sym)(module->data,
>  					"__mod_ieee1394_device_table");
> diff -p -purN module-init-tools-3.0-pre10.orig/tables.c module-init-tools-3.0-pre10/tables.c
> --- module-init-tools-3.0-pre10.orig/tables.c	2003-12-24 06:23:38.000000000 +0100
> +++ module-init-tools-3.0-pre10/tables.c	2004-08-12 19:19:01.708780583 +0200
> @@ -127,7 +127,31 @@ void output_ieee1394_table(struct module
>  			output_ieee1394_entry(fw, shortname, out);
>  	}
>  }
> +static void output_vio_entry(struct vio_device_id *fw, char *name, FILE *out)
> +{
> +	fprintf(out, "%-20s %-32s %s\n",
> +		name, fw->name, fw->compat);
> +}
> 
> +void output_vio_table(struct module *modules, FILE *out)
> +{
> +	struct module *i;
> +
> +	fprintf(out, "%-20s %-32s compatible\n", "# vio module", "name");
> +
> +	for (i = modules; i; i = i->next) {
> +		struct vio_device_id *fw;
> +		char shortname[strlen(i->pathname) + 1];
> +
> +		if (!i->vio_table)
> +			continue;
> +
> +		make_shortname(shortname, i->pathname);
> +		for (fw = i->vio_table; *fw->name;
> +		     fw = (void *) fw + i->vio_size)
> +			output_vio_entry(fw, shortname, out);
> +	}
> +}
> 
>  /* We set driver_data to zero */
>  static void output_ccw_entry(struct ccw_device_id *ccw, char *name, FILE *out)

-- 
Hollis Blanchard
IBM Linux Technology Center


  reply	other threads:[~2004-08-12 19:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-12 17:37 module.viomap support for ppc64 Olaf Hering
2004-08-12 19:34 ` Hollis Blanchard [this message]
2004-08-12 23:43   ` Rusty Russell
2004-08-13  9:40     ` Olaf Hering
2004-08-13 13:42       ` Rusty Russell
2004-08-13 20:22         ` Marcelo Tosatti
2004-08-19 21:28         ` Olaf Hering
2004-08-20  3:47           ` Rusty Russell
2004-08-20  5:57             ` Olaf Hering
2004-08-20  7:25               ` Rusty Russell

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=1092339278.19137.8.camel@localhost \
    --to=hollisb@us.ibm.com \
    --cc=boutcher@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc64-dev@lists.linuxppc.org \
    --cc=olh@suse.de \
    --cc=rusty@rustcorp.com.au \
    /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