|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. ! 3: * ! 4: * @APPLE_LICENSE_HEADER_START@ ! 5: * ! 6: * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights ! 7: * Reserved. This file contains Original Code and/or Modifications of ! 8: * Original Code as defined in and that are subject to the Apple Public ! 9: * Source License Version 1.1 (the "License"). You may not use this file ! 10: * except in compliance with the License. Please obtain a copy of the ! 11: * License at http://www.apple.com/publicsource and read it before using ! 12: * this file. ! 13: * ! 14: * The Original Code and all software distributed under the License are ! 15: * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER ! 16: * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, ! 17: * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, ! 18: * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the ! 19: * License for the specific language governing rights and limitations ! 20: * under the License. ! 21: * ! 22: * @APPLE_LICENSE_HEADER_END@ ! 23: */ ! 24: ! 25: /* ! 26: * Copyright (c) 1997 Apple Computer, Inc. ! 27: * ! 28: * ! 29: * HISTORY ! 30: * ! 31: * Simon Douglas 22 Oct 97 ! 32: * - first checked in. From DriverServices ! 33: */ ! 34: ! 35: ! 36: #include <ppc/asm.h> ! 37: #include <ppc/proc_reg.h> ! 38: #include <mach/ppc/vm_param.h> ! 39: #include <assym.h> ! 40: ! 41: ! 42: /* ! 43: Boolean _eCompareAndSwap( ! 44: UInt32 old, UInt32 new, UInt32 * result ) ! 45: */ ! 46: ! 47: ! 48: ENTRY(_eCompareAndSwap, TAG_NO_FRAME_USED) ! 49: ! 50: .L_retry: ! 51: lwarx r6, 0,r5 ! 52: cmpw r6, r3 ! 53: bne- .L_fail ! 54: sync /* bug fix for 3.2 processors */ ! 55: stwcx. r4, 0,r5 ! 56: bne- .L_retry ! 57: isync ! 58: li r3, 1 ! 59: blr ! 60: .L_fail: ! 61: li r3, 0 ! 62: blr ! 63: ! 64: ENTRY(_eSynchronizeIO, TAG_NO_FRAME_USED) ! 65: ! 66: li r0, 0 ! 67: eieio ! 68: li r3, 0 ! 69: blr ! 70: ! 71: /* ! 72: ! 73: OSStatus CallTVector_NoRecover( ! 74: void * p1, void * p2, void * p3, void * p4, void * p5, void * p6, // r3-8 ! 75: LogicalAddress entry ) // r9 ! 76: ! 77: */ ! 78: ! 79: #define PARAM_SIZE 24 ! 80: ! 81: #if 0 ! 82: 0x5231204: lwz r12,0x000c(r2) ! 83: 0x5231208: stw r2,0x0014(r1) ! 84: 0x523120c: lwz r0,0x0000(r12) ! 85: 0x5231210: lwz r2,0x0004(r12) ! 86: 0x5231214: mtspr ctr,r0 ! 87: 0x5231218: bctr ! 88: #endif ! 89: ! 90: ENTRY(CallTVector_NoRecover, TAG_NO_FRAME_USED) ! 91: ! 92: mflr r0 ! 93: stw r0, FM_LR_SAVE(r1) ! 94: stw r2, FM_TOC_SAVE(r1) ! 95: ! 96: stwu r1, -(PARAM_SIZE+FM_SIZE)(r1) ! 97: ! 98: lwz r2, 4(r9) ! 99: lwz r0, 0(r9) ! 100: mtspr lr, r0 ! 101: mfspr r12, lr ! 102: blrl ! 103: ! 104: addi r1, r1,(PARAM_SIZE+FM_SIZE) ! 105: lwz r2, FM_TOC_SAVE(r1) ! 106: lwz r0, FM_LR_SAVE(r1) ! 107: mtlr r0 ! 108: blr ! 109: ! 110: ! 111:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.