Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: David Alan Gilbert <dg@cogency.co.uk>
Subject: Re: Please Explain Traps
Date: Fri, 09 Jan 1998 09:51:47 +0000	[thread overview]
Message-ID: <aae8c699ae6e1e702afa0e5a81364a12.axp-list@archive.invalid> (raw)

Just Scott wrote:
> 
> Could someplease explain what unaligned traps are and what causes them. I
> get them on my system and so do other users, but they do not seem to cause
> problems.

Say you want to read an integer which is 4 bytes long from memory; the machine
can do this by itself quite happily if the memory address is divisible by 4.
If its not divisible by 4 then it has to load two separate integers and munge
them together to get the effect of loading some of the bytes from one and some
of them from the other one. The hardware won't do this, but what it will do
is generate a trap which causes the operating system to go off and do this
itself.

Generally you probably shouldn't be loading integers which aren't aligned;
but there are some cases where it is a REAL pain to avoid it - mainly
networking type stuff, but perghaps some graphics stuff as well.
On some architectures (x86?) it just works without anyone having to do
anything.

(Note I don't actually know if the problem is integers on 4 byte boundaries
on Alpha but thats the type of problem).

Dave

-- 
----------------------------------------------------------------------
- Dr. David Alan Gilbert - WARNING! This is a beta release .signature-
- Work:    dg @ cogency.co.uk        -    0161-428-9444              -
- Home:    gro.gilbert @ treblig.org -                               -
----------------------------------------------------------------------

-- 
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

             reply	other threads:[~1998-01-09  9:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-01-09  9:51 David Alan Gilbert [this message]
     [not found] <01bd1c5d$a4a6e820$f675e3c7@sackel-1.uworld.net>
1998-01-09  2:48 ` Please Explain Traps Jay.Estabrook
  -- strict thread matches above, loose matches on Subject: below --
1998-01-08 17:48 Just Scott
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox