On Thu, 18 May 2000, Philip Blundell wrote:

> In message <[EMAIL PROTECTED]>, 
> "Hanske;Stefan" writes:
> >The following just won't work:
> >
> >     long long foo(long long test) {return test;}
> >
> >     int main() {
> >             long long test = 0x1010101010101010;
> >             if (foo(test) == test) printf("I'm happy");
> >     }
> 
> Pardon?  It works for me.  Here's the generated assembler.
> 

Here is what I get for a small llseek() test program using libc with
_FILE_OFFSET_BITS=64:

#include <sys/types.h>
#include <stdio.h>

int main() {
        FILE * file;
        loff_t offset;

        file = fopen("/dev/zero","r");
        offset = llseek(file, 0x1000, SEEK_SET);
        printf("The offset is: %lld.\n", offset);
}

=====>

0x20003bc <main>:       mov     r12, sp
0x20003c0 <main+4>:     stmdb   sp!, {r11, r12, lr, pc}
0x20003c4 <main+8>:     ldr     r0, [pc, #28]   ; 0x20003f4 <main+56>
0x20003c8 <main+12>:    ldr     r1, [pc, #28]   ; 0x20003f8 <main+60>
0x20003cc <main+16>:    sub     r11, r12, #4    ; 0x4
0x20003d0 <main+20>:    bl      0x20002f8 <fopen>
0x20003d4 <main+24>:    mov     r1, #4096       ; 0x1000
0x20003d8 <main+28>:    mov     r2, #0  ; 0x0
0x20003dc <main+32>:    bl      0x20002c8 <llseek>      <====
0x20003e0 <main+36>:    mov     r1, r0                  <====
0x20003e4 <main+40>:    mov     r2, r1, asr #31         <====
0x20003e8 <main+44>:    ldr     r0, [pc, #c]    ; 0x20003fc <main+64>
0x20003ec <main+48>:    bl      0x20002e8 <printf>
0x20003f0 <main+52>:    ldmdb   r11, {r11, sp, pc}
0x20003f4 <main+56>:    andeq   r0, r0, #1879048192     ; 0x70000000
0x20003f8 <main+60>:    andeq   r0, r0, #2080374784     ; 0x7c000000
0x20003fc <main+64>:    andeq   r0, r0, #-2147483648    ; 0x80000000
End of assembler dump.

This is using gcc version 2.95.3 19991030 (prerelease)



unsubscribe: body of `unsubscribe linux-arm' to [EMAIL PROTECTED]
++        Please use [EMAIL PROTECTED] for           ++
++                        kernel-related discussions.                      ++

Reply via email to