| To: | linux-mips@fnet.fr |
|---|---|
| Subject: | Re: M700 partition problem |
| From: | Systemkennung Linux <linux@mailhost.uni-koblenz.de> |
| Date: | Thu, 18 Apr 1996 21:29:39 +0200 (MET DST) |
| In-reply-to: | <199604181703.TAA18541@gordon.enea.se> from "Per Fogelstrom" at Apr 18, 96 07:03:37 pm |
Hi,
> Ok!
>
> #define ldunaligned(x) \
> ({ int __result; \
> __asm__("lwr %0,0(%1);lwl %0,3(%1)" \
> : "&=r" (__result) : "r" (x)); __result; })
>
> int nn = ldunaligned(*arbitrary address*);
>
> You have to swap "lwr" and "lwl" if you run in big endian mode.
> And the order too perhaps, if the last one ends up as a nop if "x" is
> aligned.
You can also use the macro instructions uld, ulw, ulh, ulhu, usd, usw, ush,
ushu provided by the assembler. That way you won't have to worry about byte
order. Btw - GAS generates bad code for these under some circumstances.
Ralf
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: M700 partition problem, Systemkennung Linux |
|---|---|
| Next by Date: | Fix for M700 partition problem, Systemkennung Linux |
| Previous by Thread: | Re: M700 partition problem, Per Fogelstrom |
| Next by Thread: | Re: M700 partition problem, Systemkennung Linux |
| Indexes: | [Date] [Thread] [Top] [All Lists] |