The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/powerpc/ps3/ps3-hv-asm.awk

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 # This script generates the PS3 hypervisor call stubs from an HV
    2 # interface definition file. The PS3 HV calling convention is very
    3 # similar to the PAPR one, except that the function token is passed in
    4 # r11 instead of r3.
    5 #
    6 # Invoke like so: awk -f ps3-hv-asm.awk < ps3-hvcall.master > ps3-hvcall.S
    7 #
    8 
    9 # $FreeBSD$
   10 
   11 BEGIN {
   12         printf("/* $FreeBSD$ */\n\n");
   13         printf("#include <machine/asm.h>\n\n");
   14         printf("#define hc .long 0x44000022\n\n");
   15 }
   16 
   17 /HVCALL.*/ {
   18         code = $2;
   19         ins = split($4, a, ",")
   20         outs = split($5, a, ",")
   21         
   22         printf("ASENTRY(%s)\n",$3);
   23         printf("\tmflr  %%r0\n");
   24         printf("\tstd   %%r0,16(%%r1)\n");
   25         printf("\tstdu  %%r1,-%d(%%r1)\n", 48+8*outs);
   26 
   27         if ($4 == "UNUSED")
   28                 ins = 0
   29         
   30         # Save output reg addresses to the stack
   31         for (i = 0; i < outs; i++) {
   32                 if (ins+i >= 8) {
   33                    printf("\tld %%r11,%d(%%r1)\n", 48+8*outs + 48 + 8*(i+ins));
   34                    printf("\tstd        %%r11,%d(%%r1)\n", 48+8*i);
   35                 } else {
   36                    printf("\tstd        %%r%d,%d(%%r1)\n", 3+ins+i, 48+8*i);
   37                 }
   38         }
   39 
   40         printf("\tli    %%r11,%d\n", code);
   41         printf("\thc\n");
   42         printf("\textsw %%r3,%%r3\n");
   43                 
   44         for (i = 0; i < outs; i++) {
   45                 printf("\tld    %%r11,%d(%%r1)\n", 48+8*i);
   46                 printf("\tstd   %%r%d,0(%%r11)\n", 4+i);
   47         }
   48 
   49         printf("\tld    %%r1,0(%%r1)\n");
   50         printf("\tld    %%r0,16(%%r1)\n");
   51         printf("\tmtlr  %%r0\n");
   52         printf("\tblr\n\n");
   53 }

Cache object: 5cd6fd478710b0d5b95e262eb03f7266


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.