From: Luigi 'Comio' Mantellini Date: Sun, 19 Oct 2008 13:15:04 +0200 Subject: [U-Boot] lookup tables: how can i manage them? Message-ID: <200810191315.05505.luigi.mantellini.ml@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi ML, in my code (for now a stupid SMI interface) I'm using a jump table like this: struct reg:{ callback_1 c1, callback_2 c2, ... }; struct reg mytable[100]={ ......... } c1 and c2 are pointer to functions. My problem is that U-boot relocates itself into ram and these pointers are calculated at linking time. Which is the best practice (into u.boot) to manage these loolup tables/jmps tables? is there a suggest way or a common place to put the needed relocation code (adding the gd->reloc_off to the pointers)? I'm working on mips, but I thinks that this is a general question. thanks in advance. best regards, luigi PS.: I made a stupid driver to manage smi interface, that is a "theme variation" on mii bus, to manage a tantos switch. I can send the code if there is interest. -- Luigi Mantellini R&D - Software Industrie Dial Face S.p.A. Via Canzo, 4 20068 Peschiera Borromeo (MI), Italy Tel.: +39 02 5167 2813 Fax: +39 02 5167 2459 Email: luigi.mantellini at idf-hit.com