Path: blob/master/arch/powerpc/platforms/cell/beat_hvCall.S
10818 views
/*1* Beat hypervisor call I/F2*3* (C) Copyright 2007 TOSHIBA CORPORATION4*5* This code is based on arch/powerpc/platforms/pseries/hvCall.S.6*7* This program is free software; you can redistribute it and/or modify8* it under the terms of the GNU General Public License as published by9* the Free Software Foundation; either version 2 of the License, or10* (at your option) any later version.11*12* This program is distributed in the hope that it will be useful,13* but WITHOUT ANY WARRANTY; without even the implied warranty of14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the15* GNU General Public License for more details.16*17* You should have received a copy of the GNU General Public License along18* with this program; if not, write to the Free Software Foundation, Inc.,19* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.20*/2122#include <asm/ppc_asm.h>2324#define STK_PARM(i) (48 + ((i)-3)*8)2526/* Not implemented on Beat, now */27#define HCALL_INST_PRECALL28#define HCALL_INST_POSTCALL2930.text3132#define HVSC .long 0x440000223334/* Note: takes only 7 input parameters at maximum */35_GLOBAL(beat_hcall_norets)36HMT_MEDIUM3738mfcr r039stw r0,8(r1)4041HCALL_INST_PRECALL4243mr r11,r344mr r3,r445mr r4,r546mr r5,r647mr r6,r748mr r7,r849mr r8,r95051HVSC /* invoke the hypervisor */5253HCALL_INST_POSTCALL5455lwz r0,8(r1)56mtcrf 0xff,r05758blr /* return r3 = status */5960/* Note: takes 8 input parameters at maximum */61_GLOBAL(beat_hcall_norets8)62HMT_MEDIUM6364mfcr r065stw r0,8(r1)6667HCALL_INST_PRECALL6869mr r11,r370mr r3,r471mr r4,r572mr r5,r673mr r6,r774mr r7,r875mr r8,r976ld r10,STK_PARM(r10)(r1)7778HVSC /* invoke the hypervisor */7980HCALL_INST_POSTCALL8182lwz r0,8(r1)83mtcrf 0xff,r08485blr /* return r3 = status */8687/* Note: takes only 6 input parameters, 1 output parameters at maximum */88_GLOBAL(beat_hcall1)89HMT_MEDIUM9091mfcr r092stw r0,8(r1)9394HCALL_INST_PRECALL9596std r4,STK_PARM(r4)(r1) /* save ret buffer */9798mr r11,r399mr r3,r5100mr r4,r6101mr r5,r7102mr r6,r8103mr r7,r9104mr r8,r10105106HVSC /* invoke the hypervisor */107108HCALL_INST_POSTCALL109110ld r12,STK_PARM(r4)(r1)111std r4, 0(r12)112113lwz r0,8(r1)114mtcrf 0xff,r0115116blr /* return r3 = status */117118/* Note: takes only 6 input parameters, 2 output parameters at maximum */119_GLOBAL(beat_hcall2)120HMT_MEDIUM121122mfcr r0123stw r0,8(r1)124125HCALL_INST_PRECALL126127std r4,STK_PARM(r4)(r1) /* save ret buffer */128129mr r11,r3130mr r3,r5131mr r4,r6132mr r5,r7133mr r6,r8134mr r7,r9135mr r8,r10136137HVSC /* invoke the hypervisor */138139HCALL_INST_POSTCALL140141ld r12,STK_PARM(r4)(r1)142std r4, 0(r12)143std r5, 8(r12)144145lwz r0,8(r1)146mtcrf 0xff,r0147148blr /* return r3 = status */149150/* Note: takes only 6 input parameters, 3 output parameters at maximum */151_GLOBAL(beat_hcall3)152HMT_MEDIUM153154mfcr r0155stw r0,8(r1)156157HCALL_INST_PRECALL158159std r4,STK_PARM(r4)(r1) /* save ret buffer */160161mr r11,r3162mr r3,r5163mr r4,r6164mr r5,r7165mr r6,r8166mr r7,r9167mr r8,r10168169HVSC /* invoke the hypervisor */170171HCALL_INST_POSTCALL172173ld r12,STK_PARM(r4)(r1)174std r4, 0(r12)175std r5, 8(r12)176std r6, 16(r12)177178lwz r0,8(r1)179mtcrf 0xff,r0180181blr /* return r3 = status */182183/* Note: takes only 6 input parameters, 4 output parameters at maximum */184_GLOBAL(beat_hcall4)185HMT_MEDIUM186187mfcr r0188stw r0,8(r1)189190HCALL_INST_PRECALL191192std r4,STK_PARM(r4)(r1) /* save ret buffer */193194mr r11,r3195mr r3,r5196mr r4,r6197mr r5,r7198mr r6,r8199mr r7,r9200mr r8,r10201202HVSC /* invoke the hypervisor */203204HCALL_INST_POSTCALL205206ld r12,STK_PARM(r4)(r1)207std r4, 0(r12)208std r5, 8(r12)209std r6, 16(r12)210std r7, 24(r12)211212lwz r0,8(r1)213mtcrf 0xff,r0214215blr /* return r3 = status */216217/* Note: takes only 6 input parameters, 5 output parameters at maximum */218_GLOBAL(beat_hcall5)219HMT_MEDIUM220221mfcr r0222stw r0,8(r1)223224HCALL_INST_PRECALL225226std r4,STK_PARM(r4)(r1) /* save ret buffer */227228mr r11,r3229mr r3,r5230mr r4,r6231mr r5,r7232mr r6,r8233mr r7,r9234mr r8,r10235236HVSC /* invoke the hypervisor */237238HCALL_INST_POSTCALL239240ld r12,STK_PARM(r4)(r1)241std r4, 0(r12)242std r5, 8(r12)243std r6, 16(r12)244std r7, 24(r12)245std r8, 32(r12)246247lwz r0,8(r1)248mtcrf 0xff,r0249250blr /* return r3 = status */251252/* Note: takes only 6 input parameters, 6 output parameters at maximum */253_GLOBAL(beat_hcall6)254HMT_MEDIUM255256mfcr r0257stw r0,8(r1)258259HCALL_INST_PRECALL260261std r4,STK_PARM(r4)(r1) /* save ret buffer */262263mr r11,r3264mr r3,r5265mr r4,r6266mr r5,r7267mr r6,r8268mr r7,r9269mr r8,r10270271HVSC /* invoke the hypervisor */272273HCALL_INST_POSTCALL274275ld r12,STK_PARM(r4)(r1)276std r4, 0(r12)277std r5, 8(r12)278std r6, 16(r12)279std r7, 24(r12)280std r8, 32(r12)281std r9, 40(r12)282283lwz r0,8(r1)284mtcrf 0xff,r0285286blr /* return r3 = status */287288289