Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* tbia() on DEC 3000 question
@ 1999-08-16  7:24 Craig P Prescott
  1999-08-16  8:36 ` Wes Bauske
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Craig P Prescott @ 1999-08-16  7:24 UTC (permalink / raw)
  To: axp-list


Plodding forward trying to get linux to netboot on the on the DEC 3000...

In paging_init (arch/alpha/mm/init.c), the call to tbia() results in a
machine check on the model 500 and model 600 DEC 3000 machines I am
using for development.  I am not sure why (I am a *complete* newbie to
assembly.).

Anyhow, changing tbia() in include/asm-alpha/system.h from

<snip>

#define __tbi(nr,arg,arg1...)					\
({								\
	register unsigned long __r16 __asm__("$16") = (nr);	\
	register unsigned long __r17 __asm__("$17"); arg;	\
	__asm__ __volatile__(					\
		"call_pal %3 #__tbi"				\
		:"=r" (__r16),"=r" (__r17)			\
		:"0" (__r16),"i" (PAL_tbi) ,##arg1		\
		:"$0", "$1", "$22", "$23", "$24", "$25");	\
})
....
#define tbia()		__tbi(-2, /* no second argument */)

</snip> 

to 

#define tbia()							\
({								\
	register unsigned long __r16 __asm__("$16") = -2;	\
        __asm__ __volatile__(                                   \
                "call_pal 0x0033"                               \
                :                                               \
                :                                               \
		:"$1", "$16", "$17", "$22", "$23", "$24", "$25");	\
})

*seems* to work - I no longer crap out (in tbia()) when netbooting.
(PAL_tbi is 0x0033).

So, my main two questions are:

1) is what I did actually "correct"?  (apart from the unused __r16)

2) why would the original tbia() fail on a DEC 3000 but work on
everything else?  __tbi is generalized beyond the immediate needs of
tbia() and tbiap(); could this be causing some problem?

Also, I am sure there is a "better" way to do this (if what I did was
even right in the first place).  But my knowledge level is a bit too
low to make full use of the examples I could find...  It sounds simple 
enough - all I have to do is stick a "-2" into $a0 ($r16) and
"call_pal 0x0033"? 

This is using linux-2.2.9, BTW, and the firmware on the DEC 3000
machines is the latest.

Thanks in advance,
Craig

P.S. This is a bit off-topic, but if someone could spell out in full detail
__tbi above, I'd be grateful, as I could learn more from this
example. I.e. what do the #__tbi and ##arg1 do?  And I learned from a
gcc doc what the "=r" and "0" mean, but what about "i"?

If anyone knows where an "Alpha Assembly for Dummies" style tutorial
is, or any other useful references, I'd appreciate it if they could
point me at them.  If one wanted to learn a bit of Alpha Assembly -
with no prior knowledge of any assembly language - what would one do?
I have the Alpha Architecture Reference Manual and other reference
materials, but I am looking for more of a tutorial with lots of
examples.


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~1999-08-20  7:11 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-08-16  7:24 tbia() on DEC 3000 question Craig P Prescott
1999-08-16  8:36 ` Wes Bauske
1999-08-16  8:50   ` Craig P Prescott
1999-08-16  8:37 ` Richard Henderson
1999-08-16 10:16   ` Craig P Prescott
1999-08-17  0:16     ` Richard Henderson
1999-08-18  9:36       ` Craig P Prescott
1999-08-18  9:35         ` Diagram for DEC3000 power supply Jason Irons
1999-08-18 23:49         ` tbia() on DEC 3000 question Richard Henderson
1999-08-19 18:45           ` Craig P Prescott
1999-08-19 23:02             ` Richard Henderson
1999-08-20  2:10 ` Ping all: DEC 3000 support question Ken Shiring
1999-08-20  7:11   ` Craig P Prescott

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