|
|
1.1 root 1: /******************************************************************************
2: * Copyright (c) 2004, 2008 IBM Corporation
3: * All rights reserved.
4: * This program and the accompanying materials
5: * are made available under the terms of the BSD License
6: * which accompanies this distribution, and is available at
7: * http://www.opensource.org/licenses/bsd-license.php
8: *
9: * Contributors:
10: * IBM Corporation - initial implementation
11: *****************************************************************************/
12:
13: #include <macros.h>
14: #include "takeover.h"
15:
16: .globl _wrapclient
17: .section ".start"
18: .align 3
19:
20: _wrapclient:
21: bcl 20,31,over # branch after pointer table
1.1.1.2 ! root 22: base:
1.1 root 23: .align 3
24: .LCgot: .quad _got-base+0x8000
1.1.1.2 ! root 25: over:
1.1 root 26: mflr r8 # gpr 8 is the base
27: ld r2, .LCgot-base(r8) # load got pointer
28: add r2, r2, r8 # add base
29: li 14, 0
30: oris 14, 14, __bssSize@h
31: ori 14, 14, __bssSize@l
32: addi 14,14,7
33: srwi 14,14,3
34: mtctr 14
35: li 14, 0
36: oris 14, 14, __bssStart@h
37: ori 14, 14, __bssStart@l
38: subi 14, 14, 8
39: li 15, 0
40: 1:
41: stdu 15,8(14)
42: bdnz 1b
1.1.1.2 ! root 43:
1.1 root 44: bl ._entry
45:
46:
47:
48: .globl slaveLoopNoTakeover
49: slaveLoopNoTakeover:
50: mr 28,3
51:
52: li 14,0
53: oris 14, 14, slaveQuitt@h
54: ori 14, 14, slaveQuitt@l
55:
56: li 3,0
57: std 3,0(14)
58: 1:
59: ld 3,0(14)
60: cmpld 3,28
61: bne 1b
62:
63: li 3,0
64: std 3,0(14)
65:
66: LOAD64(r3, (TAKEOVERBASEADDRESS+0x150))
67: mtctr r3
68: bctr
69:
70:
71: .globl slaveLoop
72: slaveLoop:
73: mr 28,3
1.1.1.2 ! root 74: li r3, 0x5124
! 75: li r0, -1; .long 0x44000022
1.1 root 76:
77: li 14,0
78: oris 14, 14, slaveQuitt@h
79: ori 14, 14, slaveQuitt@l
80: li 3,0
81: std 3,0(14)
82: 1:
83: ld 3,0(14)
84: cmpld 3,28
85: bne 1b
86:
87: li 3,0
88: std 3,0(14)
89:
90: LOAD64(r3, (TAKEOVERBASEADDRESS+0x150))
91: mtctr r3
92: bctr
93:
1.1.1.2 ! root 94:
! 95: C_ENTRY(m_sync)
! 96: isync
! 97: sync
! 98: nop
! 99: blr
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.