~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/powerpc/platforms/cell/spufs/spu_save_crt0.S

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-or-later */
  2 /*
  3  * crt0_s.S: Entry function for SPU-side context save.
  4  *
  5  * Copyright (C) 2005 IBM
  6  *
  7  * Entry function for SPU-side of the context save sequence.
  8  * Saves all 128 GPRs, sets up an initial stack frame, then
  9  * branches to 'main'.
 10  */
 11 
 12 #include <asm/spu_csa.h>
 13 
 14 .data
 15 .align 7
 16 .globl regs_spill
 17 regs_spill:
 18 .space SIZEOF_SPU_SPILL_REGS, 0x0
 19 
 20 .text
 21 .global _start
 22 _start:
 23         /* SPU Context Save Step 1: Save the first 16 GPRs. */
 24         stqa $0, regs_spill + 0
 25         stqa $1, regs_spill + 16
 26         stqa $2, regs_spill + 32
 27         stqa $3, regs_spill + 48
 28         stqa $4, regs_spill + 64
 29         stqa $5, regs_spill + 80
 30         stqa $6, regs_spill + 96
 31         stqa $7, regs_spill + 112
 32         stqa $8, regs_spill + 128
 33         stqa $9, regs_spill + 144
 34         stqa $10, regs_spill + 160
 35         stqa $11, regs_spill + 176
 36         stqa $12, regs_spill + 192
 37         stqa $13, regs_spill + 208
 38         stqa $14, regs_spill + 224
 39         stqa $15, regs_spill + 240
 40 
 41         /* SPU Context Save, Step 8: Save the remaining 112 GPRs. */
 42         ila     $3, regs_spill + 256
 43 save_regs:
 44         lqr     $4, save_reg_insts
 45 save_reg_loop:
 46         ai      $4, $4, 4
 47         .balignl 16, 0x40200000
 48 save_reg_insts:       /* must be quad-word aligned. */
 49         stqd    $16, 0($3)
 50         stqd    $17, 16($3)
 51         stqd    $18, 32($3)
 52         stqd    $19, 48($3)
 53         andi    $5, $4, 0x7F
 54         stqr    $4, save_reg_insts
 55         ai      $3, $3, 64
 56         brnz    $5, save_reg_loop
 57 
 58         /* Initialize the stack pointer to point to 16368
 59          * (16kb-16). The back chain pointer is initialized
 60          * to NULL.
 61          */
 62         il      $0, 0
 63         il      $SP, 16368
 64         stqd    $0, 0($SP)
 65 
 66         /* Allocate a minimum stack frame for the called main.
 67          * This is needed so that main has a place to save the
 68          * link register when it calls another function.
 69          */
 70         stqd    $SP, -160($SP)
 71         ai      $SP, $SP, -160
 72 
 73         /* Call the program's main function. */
 74         brsl    $0, main
 75 
 76         /* In this case main should not return; if it does
 77          * there has been an error in the sequence.  Execute
 78          * stop-and-signal with code=0.
 79          */
 80 .global exit
 81 .global _exit
 82 exit:
 83 _exit:
 84         stop    0x0
 85 
 86         /* Pad the size of this crt0.o to be multiple of 16 bytes. */
 87 .balignl 16, 0x0
 88 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php