|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved. ! 3: * ! 4: * @APPLE_LICENSE_HEADER_START@ ! 5: * ! 6: * The contents of this file constitute Original Code as defined in and ! 7: * are subject to the Apple Public Source License Version 1.1 (the ! 8: * "License"). You may not use this file except in compliance with the ! 9: * License. Please obtain a copy of the License at ! 10: * http://www.apple.com/publicsource and read it before using this file. ! 11: * ! 12: * This Original Code and all software distributed under the License are ! 13: * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER ! 14: * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, ! 15: * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, ! 16: * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the ! 17: * License for the specific language governing rights and limitations ! 18: * under the License. ! 19: * ! 20: * @APPLE_LICENSE_HEADER_END@ ! 21: */ ! 22: /* ! 23: * Copyright (c) 1998-1999 Apple Computer ! 24: * ! 25: * Interface for hardware dependent (relatively) code ! 26: * for the UniN Ethernet chip ! 27: * ! 28: * HISTORY ! 29: * ! 30: */ ! 31: ! 32: ! 33: #include "UniNEnet.h" ! 34: #include "UniNEnetMII.h" ! 35: ! 36: // ! 37: // Hacks, get rid of this! ! 38: // ! 39: extern "C" ! 40: { ! 41: extern unsigned splimp(void); ! 42: extern void splx(unsigned level); ! 43: extern unsigned splhigh(void); ! 44: } ! 45: ! 46: ! 47: void WriteUniNRegister( IOPPCAddress ioEnetBase, u_int32_t reg_offset, u_int32_t data); ! 48: volatile u_int32_t ReadUniNRegister( IOPPCAddress ioEnetBase, u_int32_t reg_offset); ! 49: ! 50: static __inline__ u_int16_t EndianSwap16(volatile u_int16_t y) ! 51: { ! 52: u_int16_t result; ! 53: volatile u_int16_t x; ! 54: ! 55: x = y; ! 56: __asm__ volatile("lhbrx %0, 0, %1" : "=r" (result) : "r" (&x) : "r0"); ! 57: return result; ! 58: } ! 59: ! 60: static __inline__ u_int32_t EndianSwap32(u_int32_t y) ! 61: { ! 62: u_int32_t result; ! 63: volatile u_int32_t x; ! 64: ! 65: x = y; ! 66: __asm__ volatile("lwbrx %0, 0, %1" : "=r" (result) : "r" (&x) : "r0"); ! 67: return result; ! 68: } ! 69: ! 70:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.