From: Jan-Benedict Glaw <jbglaw@lug-owl.de>
To: SGI MIPS list <linux-mips@oss.sgi.com>
Subject: Re: [PATCH] Bring back R4600 V1.7 support
Date: Tue, 20 Aug 2002 16:10:13 +0200 [thread overview]
Message-ID: <20020820141013.GC10730@lug-owl.de> (raw)
In-Reply-To: <Pine.GSO.3.96.1020820152046.8700E-100000@delta.ds2.pg.gda.pl>
[-- Attachment #1: Type: text/plain, Size: 2621 bytes --]
On Tue, 2002-08-20 15:30:22 +0200, Maciej W. Rozycki <macro@ds2.pg.gda.pl>
wrote in message <Pine.GSO.3.96.1020820152046.8700E-100000@delta.ds2.pg.gda.pl>:
> On Tue, 20 Aug 2002, Jan-Benedict Glaw wrote:
>
> > Please accept the patch (from my previous mail). I'm using it now for
> > two days, and I've got one mail telling me that it works for its sender.
>
> Ugh, this should be a separate set of functions selected at the run time.
> It should be fairly trivial to rewrite it this way (best done with
> processor-specific functions expanded from common templates for ease of
Actually, I had written all that using separate functions before, but
neither I nor Ralf liked this approach (because it adds hundreds LOC to
.../c-r4k.c). Ralf then suggested writing it using macros, so I did.
-*- Proposal -*-
There are IMHO two goals, one for near future, one for following day
(after first goal has reached):
1. There are many (equally looking) functions in c-r4k.c . It
would be nice to not have the (more-or-less) function body 10
times there.
2. it would be nice to not have like 50 functions around, but to
better have a flexible way to do what needs to be done.
Something like an (initdata) array containing PRId and
function pointers (or other info) on "what needs to be
done".
The first one seems quite easy. Looking eg. at Alphas, they have a macro
defining a whole function (which inserts a correct function name by
supplied arguments etc.). This way,
static inline void r4k_flush_cache_all_s128d16i16(void)
static inline void r4k_flush_cache_all_s32d32i32(void)
static inline void r4k_flush_cache_all_s64d32i32(void)
..
could go away by: (there _will_ be bugs. 100% untested, and I'm a bad
preprocessor coder:-)
#define FUNC_R4K_FLUSH_CACHE_ALL(NAME, SC, DC, IC) \
static inline void \
r4k_flush_cache_all_##NAME(void) \
{ \
blast_dcache##DC(); \
blast_icache##IC(); \
blase_scache##SC(); \
}
and then writing:
FUNC_R4K_FLUSH_CACHE_ALL(s128d16i16, 128, 16, 16)
FUNC_R4K_FLUSH_CACHE_ALL(s32d32i32, 32, 32, 32)
FUNC_R4K_FLUSH_CACHE_ALL(s64d32i32, 64, 32, 32)
...
instead. The __save_and_cli()/__restore_flags() functions could be done
as well as all the remaining others. That would pollute namespace like
it does today, but the .c file will be 80% smaller or so:
$ wc -l c-r4k.c
2422 c-r4k.c
MfG, JBG
--
Jan-Benedict Glaw . jbglaw@lug-owl.de . +49-172-7608481
-- New APT-Proxy written in shell script --
http://lug-owl.de/~jbglaw/software/ap2/
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2002-08-20 14:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-18 0:28 [PATCH] Bring back R4600 V1.7 support Jan-Benedict Glaw
2002-08-20 11:33 ` Jan-Benedict Glaw
2002-08-20 13:30 ` Maciej W. Rozycki
2002-08-20 13:55 ` Maciej W. Rozycki
2002-08-20 14:03 ` Ralf Baechle
2002-08-20 14:36 ` Maciej W. Rozycki
2002-08-20 14:10 ` Jan-Benedict Glaw [this message]
2002-08-20 14:46 ` Maciej W. Rozycki
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=20020820141013.GC10730@lug-owl.de \
--to=jbglaw@lug-owl.de \
--cc=linux-mips@oss.sgi.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.