lkml.org 
[lkml]   [1998]   [Mar]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Question re: Alpha asm code
> 1) Where can I find documentation on the gas psuedo-ops:
>
> .prologue
> .frame

Somewhere I once found a PS version of the Digital assembler docs.
Perhaps someone else can point to it? Anyway,

.prologue [0|1]

indicates whether the function uses the GP or not. This fact is
recorded in the object file for an intelligent linker to do something
with (ours doesn't at the moment, but please record this accurately
so that when it does, stuff doesn't break). It should be placed at
the end of the function prologue.

.frame FP,FRAMESIZE,RA,SAVEDISP

describes how the frame is layed out: FP is the frame pointer used
(only $15 or $30 allowed), FRAMESIZE is the number of bytes allocated,
RA indicates which register contains the return address, SAVEDISP
(optional) indicates the offset of the saved registers from the
virtual frame pointer ($30 at first insn).

> 2) What does the 'ldgp' mnemonic do? Is this just, as I suspect, another
> way of saying 'ldq $29,nn($Rb)' ? If so, why the special syntax?

No, it means "LoaD GP". "ldgp A,N(B)" expands to

1: ldah A,%hi(GP-1b+N)(B)
lda A,%lo(GP-1b+N)(A)

where %hi and %lo are non-existant functions to extract the sign-extended
high and low portions of a number, and GP is the GP that the linker has
chosen for an object file.

> 3) I'm totally confused with regard to the calling conventions for gcc
> invoking asm functions, and with how function values are returned.

$0 integer return value
$9-$15 call-saved
$16-$21 integer arguments
$26 return address
$27 procedure vector -- set to address of called function
$29 global symbol pointer
$30 stack pointer
$f0 fp return value
$f2-$f9 call-saved
$f16-$f21 fp arguments

> 4) What is the cryptic "we can be called from a module" implying?

That we must load the gp before accessing symbols. The kernel
proper uses only one GP, so we can get away with not loading
the GP in many places; this is not one of them.



r~

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

\
 
 \ /
  Last update: 2005-03-22 13:42    [W:0.525 / U:1.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site