xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_sparc64_openbsd.s

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* -*- Mode: asm; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     2  *
     3  * This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7         .global SharedStub
     9 /*
    10     in the frame for the function that called SharedStub are the
    11     rest of the parameters we need
    13 */
    15 SharedStub:
    16 ! we don't create a new frame yet, but work within the frame of the calling
    17 ! function to give ourselves the other parameters we want
    19         mov     %o0, %o1               ! shuffle the index up to 2nd place
    20         mov     %i0, %o0               ! the original 'this'
    21         add     %fp, 0x7ff + 136, %o2  ! previous stack top adjusted to the first argument slot (beyond 'this')
    23 ! save off the original incoming parameters that arrived in 
    24 ! registers, the ABI guarantees the space for us to do this
    25         stx     %i1, [%fp + 0x7ff + 136]
    26         stx     %i2, [%fp + 0x7ff + 144]
    27         stx     %i3, [%fp + 0x7ff + 152]
    28         stx     %i4, [%fp + 0x7ff + 160]
    29         stx     %i5, [%fp + 0x7ff + 168]
    30 ! now we can build our own stack frame
    31         save    %sp,-(128 + 64),%sp    ! room for the register window and
    32                                        ! struct pointer, rounded up to 0 % 64
    33 ! our function now appears to have been called
    34 ! as SharedStub(nsISupports* that, uint32_t index, uint32_t* args)
    35 ! so we can just copy these through
    37         mov     %i0, %o0
    38         mov     %i1, %o1
    39         mov     %i2, %o2
    40         call    PrepareAndDispatch
    41         nop
    42         mov     %o0,%i0             ! propagate return value
    43         b .LL1
    44         nop
    45 .LL1:
    46         ret
    47         restore
    49        .size    SharedStub, .-SharedStub
    50        .type    SharedStub, #function

mercurial