ReactOS 0.4.15-dev-7958-gcd0bb1a
intrin_ppc.h File Reference

Go to the source code of this file.

Macros

#define PPC_QUAL   extern __inline__
 
#define _ReturnAddress()   (__builtin_return_address(0))
 
#define _AddressOfReturnAddress()   (&(((void **)(__builtin_frame_address(0)))[1]))
 
#define PPC_MakeInterlockedFunction(type, name, op, proto)
 
#define _ENABLE_DISABLE_DEFINED
 
#define __noop(...)   ((void)0)
 
#define __assume(x)   if (!(x)) __builtin_unreachable()
 

Functions

PPC_QUAL char _InterlockedCompareExchange8 (volatile char *const Destination, const char Exchange, const char Comperand)
 
PPC_QUAL short _InterlockedCompareExchange16 (volatile short *const Destination, const short Exchange, const short Comperand)
 
PPC_QUAL long _InterlockedCompareExchange (volatile long *const Destination, const long Exchange, const long Comperand)
 
PPC_QUAL long long _InterlockedCompareExchange64 (volatile long long *const Target, const long long Exchange, const long long Comperand)
 
PPC_QUAL void_InterlockedCompareExchangePointer (void *volatile *const Destination, void *const Exchange, void *const Comperand)
 
PPC_QUAL long _InterlockedExchange (volatile long *const Target, const long Value)
 
PPC_QUAL void_InterlockedExchangePointer (void *volatile *const Target, void *const Value)
 
PPC_QUAL unsigned char _interlockedbittestandreset (volatile long *const a, const long b)
 
 PPC_MakeInterlockedFunction (long, _InterlockedExchangeAdd,+,(volatile long *const value, const long modify)) PPC_MakeInterlockedFunction(char
 
volatile char *const const char modify PPC_MakeInterlockedFunction (short, _InterlockedAnd16,&,(volatile short *const value, const short modify)) PPC_MakeInterlockedFunction(long
 
volatile char *const const char modify volatile long *const const long modify PPC_MakeInterlockedFunction (char, _InterlockedOr8,|,(volatile char *const value, const char modify)) PPC_MakeInterlockedFunction(short
 
volatile char *const const char modify volatile long *const const long modify volatile short *const const short modify PPC_MakeInterlockedFunction (long, _InterlockedOr,|,(volatile long *const value, const long modify)) PPC_MakeInterlockedFunction(char
 
volatile char *const const char modify volatile long *const const long modify volatile short *const const short modify volatile char *const const char modify PPC_MakeInterlockedFunction (short, _InterlockedXor16,^,(volatile short *const value, const short modify)) PPC_MakeInterlockedFunction(long
 
volatile char *const const char modify volatile long *const const long modify volatile short *const const short modify volatile char *const const char modify volatile long *const const long modify PPC_QUAL unsigned char _interlockedbittestandset (volatile long *const a, const long b)
 
PPC_QUAL long _InterlockedDecrement (volatile long *const lpAddend)
 
PPC_QUAL long _InterlockedIncrement (volatile long *const lpAddend)
 
PPC_QUAL void __stosb (unsigned char *Dest, const unsigned char Data, unsigned long Count)
 
PPC_QUAL void __stosw (unsigned short *Dest, const unsigned short Data, unsigned long Count)
 
PPC_QUAL void __stosd (unsigned long *Dest, const unsigned long Data, unsigned long Count)
 
PPC_QUAL void __movsb (unsigned char *Destination, const unsigned char *Source, unsigned long Count)
 
PPC_QUAL void __movsw (unsigned short *Destination, const unsigned short *Source, unsigned long Count)
 
PPC_QUAL void __movsd (unsigned long *Destination, const unsigned long *Source, unsigned long Count)
 
PPC_QUAL void __writefsbyte (const unsigned long Offset, const unsigned char Data)
 
PPC_QUAL void __writefsword (const unsigned long Offset, const unsigned short Data)
 
PPC_QUAL void __writefsdword (const unsigned long Offset, const unsigned long Data)
 
PPC_QUAL unsigned char __readfsbyte (const unsigned long Offset)
 
PPC_QUAL unsigned short __readfsword (const unsigned long Offset)
 
PPC_QUAL unsigned long __readfsdword (const unsigned long Offset)
 
PPC_QUAL void __incfsbyte (const unsigned long Offset)
 
PPC_QUAL void __incfsword (const unsigned long Offset)
 
PPC_QUAL void __incfsdword (const unsigned long Offset)
 
PPC_QUAL void __addfsbyte (const unsigned long Offset, const unsigned char Data)
 
PPC_QUAL void __addfsword (const unsigned long Offset, const unsigned short Data)
 
PPC_QUAL void __addfsdword (const unsigned long Offset, const unsigned int Data)
 
PPC_QUAL unsigned char _BitScanForward (unsigned long *const Index, const unsigned long Mask)
 
PPC_QUAL unsigned char _BitScanReverse (unsigned long *const Index, const unsigned long Mask)
 
PPC_QUAL unsigned char _bittest (const long *const a, const long b)
 
PPC_QUAL unsigned char _bittestandcomplement (long *const a, const long b)
 
PPC_QUAL unsigned char _bittestandreset (long *const a, const long b)
 
PPC_QUAL unsigned char _bittestandset (long *const a, const long b)
 
PPC_QUAL unsigned char _rotl8 (const unsigned char value, const unsigned char shift)
 
PPC_QUAL unsigned short _rotl16 (const unsigned short value, const unsigned char shift)
 
PPC_QUAL unsigned char _rotr8 (const unsigned char value, const unsigned char shift)
 
PPC_QUAL unsigned short _rotr16 (const unsigned short value, const unsigned char shift)
 
PPC_QUAL unsigned long long __ll_lshift (const unsigned long long Mask, int Bit)
 
PPC_QUAL long long __ll_rshift (const long long Mask, const int Bit)
 
PPC_QUAL unsigned long long __ull_rshift (const unsigned long long Mask, int Bit)
 
PPC_QUAL long long __emul (const int a, const int b)
 
PPC_QUAL unsigned long long __emulu (const unsigned int a, const unsigned int b)
 
PPC_QUAL unsigned char __inbyte (const unsigned long Port)
 
PPC_QUAL unsigned short __inword (const unsigned long Port)
 
PPC_QUAL unsigned long __indword (const unsigned long Port)
 
PPC_QUAL void __inbytestring (unsigned long Port, unsigned char *Buffer, unsigned long Count)
 
PPC_QUAL void __inwordstring (unsigned long Port, unsigned short *Buffer, unsigned long Count)
 
PPC_QUAL void __indwordstring (unsigned long Port, unsigned long *Buffer, unsigned long Count)
 
PPC_QUAL void __outbyte (unsigned long const Port, const unsigned char Data)
 
PPC_QUAL void __outword (unsigned long const Port, const unsigned short Data)
 
PPC_QUAL void __outdword (unsigned long const Port, const unsigned long Data)
 
PPC_QUAL void __outbytestring (unsigned long const Port, const unsigned char *const Buffer, const unsigned long Count)
 
PPC_QUAL void __outwordstring (unsigned long const Port, const unsigned short *const Buffer, const unsigned long Count)
 
PPC_QUAL void __outdwordstring (unsigned long const Port, const unsigned long *const Buffer, const unsigned long Count)
 
PPC_QUAL void __cpuid (int CPUInfo[], const int InfoType)
 
PPC_QUAL unsigned long long __rdtsc (void)
 
PPC_QUAL void __debugbreak (void)
 
PPC_QUAL void __int2c (void)
 
PPC_QUAL void _disable (void)
 
PPC_QUAL void _enable (void)
 
PPC_QUAL unsigned long __readsdr1 (void)
 
PPC_QUAL void __writesdr1 (const unsigned long long Data)
 
PPC_QUAL unsigned long long __readmsr ()
 
PPC_QUAL void __writemsr (const unsigned long Value)
 
PPC_QUAL void __wbinvd (void)
 
PPC_QUAL long _InterlockedAddLargeStatistic (volatile long long *const Addend, const long Value)
 

Variables

 _InterlockedAnd8
 
volatile char *const value
 
volatile char *const const char modify _InterlockedAnd
 
volatile char *const const char modify volatile long *const const long modify _InterlockedOr16
 
volatile char *const const char modify volatile long *const const long modify volatile short *const const short modify _InterlockedXor8
 
volatile char *const const char modify volatile long *const const long modify volatile short *const const short modify volatile char *const const char modify _InterlockedXor
 

Macro Definition Documentation

◆ __assume

#define __assume (   x)    if (!(x)) __builtin_unreachable()

Definition at line 788 of file intrin_ppc.h.

◆ __noop

#define __noop (   ...)    ((void)0)

Definition at line 786 of file intrin_ppc.h.

◆ _AddressOfReturnAddress

#define _AddressOfReturnAddress (   void)    (&(((void **)(__builtin_frame_address(0)))[1]))

Definition at line 40 of file intrin_ppc.h.

◆ _ENABLE_DISABLE_DEFINED

#define _ENABLE_DISABLE_DEFINED

Definition at line 709 of file intrin_ppc.h.

◆ _ReturnAddress

#define _ReturnAddress (   void)    (__builtin_return_address(0))

Definition at line 39 of file intrin_ppc.h.

◆ PPC_MakeInterlockedFunction

#define PPC_MakeInterlockedFunction (   type,
  name,
  op,
  proto 
)
Value:
{ \
long addend, y; \
do \
{ \
addend = *value; \
y = _InterlockedCompareExchange(value, addend op modify, addend); \
} \
while(y != addend); \
\
return y; \
}
UINT op
Definition: effect.c:236
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define PPC_QUAL
Definition: intrin_ppc.h:32
volatile char *const value
Definition: intrin_ppc.h:265
PPC_QUAL long _InterlockedCompareExchange(volatile long *const Destination, const long Exchange, const long Comperand)
Definition: intrin_ppc.h:183
Definition: name.c:39
Definition: pdh_main.c:94

Definition at line 234 of file intrin_ppc.h.

◆ PPC_QUAL

#define PPC_QUAL   extern __inline__

Definition at line 32 of file intrin_ppc.h.

Function Documentation

◆ __addfsbyte()

PPC_QUAL void __addfsbyte ( const unsigned long  Offset,
const unsigned char  Data 
)

Definition at line 410 of file intrin_ppc.h.

411{
413}
PPC_QUAL unsigned char __readfsbyte(const unsigned long Offset)
Definition: intrin_ppc.h:360
PPC_QUAL void __writefsbyte(const unsigned long Offset, const unsigned char Data)
Definition: intrin_ppc.h:342
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101

◆ __addfsdword()

PPC_QUAL void __addfsdword ( const unsigned long  Offset,
const unsigned int  Data 
)

Definition at line 420 of file intrin_ppc.h.

421{
423}
PPC_QUAL void __writefsdword(const unsigned long Offset, const unsigned long Data)
Definition: intrin_ppc.h:354
PPC_QUAL unsigned long __readfsdword(const unsigned long Offset)
Definition: intrin_ppc.h:382

◆ __addfsword()

PPC_QUAL void __addfsword ( const unsigned long  Offset,
const unsigned short  Data 
)

Definition at line 415 of file intrin_ppc.h.

416{
418}
PPC_QUAL void __writefsword(const unsigned long Offset, const unsigned short Data)
Definition: intrin_ppc.h:348
PPC_QUAL unsigned short __readfsword(const unsigned long Offset)
Definition: intrin_ppc.h:371

◆ __cpuid()

PPC_QUAL void __cpuid ( int  CPUInfo[],
const int  InfoType 
)

Definition at line 682 of file intrin_ppc.h.

683{
684 unsigned long lo32;
685 __asm__("mfpvr" : "=b" (lo32));
686}
__asm__(".p2align 4, 0x90\n" ".seh_proc __seh2_global_filter_func\n" "__seh2_global_filter_func:\n" "\tpush %rbp\n" "\t.seh_pushreg %rbp\n" "\tsub $32, %rsp\n" "\t.seh_stackalloc 32\n" "\t.seh_endprologue\n" "\tmov %rdx, %rbp\n" "\tjmp *%rax\n" "__seh2_global_filter_func_exit:\n" "\t.p2align 4\n" "\tadd $32, %rsp\n" "\tpop %rbp\n" "\tret\n" "\t.seh_endproc")

Referenced by _CRTALLOC(), BlArchIsCpuIdFunctionSupported(), BlpTimeCalibratePerformanceCounter(), BlpTimeMeasureTscFrequency(), DetermineCpuFeatures(), DetermineCpuVendor(), FrLdrCheckCpuCompatibility(), HalpFlushTLB(), KiGetFeatureBits(), WinLdrpMapApic(), and ZSTD_cpuid().

◆ __debugbreak()

PPC_QUAL void __debugbreak ( void  )

Definition at line 698 of file intrin_ppc.h.

699{
700
701}

◆ __emul()

PPC_QUAL long long __emul ( const int  a,
const int  b 
)

Definition at line 527 of file intrin_ppc.h.

528{
529 return a * b;
530}
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
#define b
Definition: ke_i.h:79

◆ __emulu()

Definition at line 532 of file intrin_ppc.h.

533{
534 return a * b;
535}

◆ __inbyte()

PPC_QUAL unsigned char __inbyte ( const unsigned long  Port)

Definition at line 539 of file intrin_ppc.h.

540{
541 int ret;
542 __asm__(
543 "mfmsr 5\n\t"
544 "andi. 6,5,0xffef\n\t"/* turn off MSR[DR] */
545 "mtmsr 6\n\t"
546 "isync\n\t"
547 "sync\n\t"
548 "lbz %0,0(%1)\n\t" /* Get actual value at phys addr r3 */
549 "mtmsr 5\n\t" : "=r" (ret) : "b" (Port)
550 );
551 return ret;
552}
CPPORT Port[4]
Definition: headless.c:35
int ret

Referenced by __inbytestring(), _HalpDismissIrqGeneric(), _HalpDismissIrqLevel(), HalDisableSystemInterrupt(), HalHandleNMI(), HalMakeBeep(), HalpDismissIrq07(), HalpDismissIrq07Level(), HalpDismissIrq15(), HalpDismissIrq15Level(), HalpInitializeClockPc98(), HalpInitializePICs(), HalpRead8254Value(), HalStopProfileInterrupt(), and READ_PORT_UCHAR().

◆ __inbytestring()

PPC_QUAL void __inbytestring ( unsigned long  Port,
unsigned char Buffer,
unsigned long  Count 
)

Definition at line 584 of file intrin_ppc.h.

585{
586 while(Count--) {
587 *Buffer++ = __inbyte(Port);
588 }
589}
Definition: bufpool.h:45
PPC_QUAL unsigned char __inbyte(const unsigned long Port)
Definition: intrin_ppc.h:539
int Count
Definition: noreturn.cpp:7

Referenced by READ_PORT_BUFFER_UCHAR(), and ScsiPortReadPortBufferUchar().

◆ __incfsbyte()

PPC_QUAL void __incfsbyte ( const unsigned long  Offset)

Definition at line 393 of file intrin_ppc.h.

394{
396}

◆ __incfsdword()

PPC_QUAL void __incfsdword ( const unsigned long  Offset)

Definition at line 403 of file intrin_ppc.h.

◆ __incfsword()

PPC_QUAL void __incfsword ( const unsigned long  Offset)

Definition at line 398 of file intrin_ppc.h.

399{
401}

◆ __indword()

PPC_QUAL unsigned long __indword ( const unsigned long  Port)

Definition at line 569 of file intrin_ppc.h.

570{
571 int ret;
572 __asm__(
573 "mfmsr 5\n\t"
574 "andi. 6,5,0xffef\n\t"/* turn off MSR[DR] */
575 "mtmsr 6\n\t"
576 "isync\n\t"
577 "sync\n\t"
578 "lwz %0,0(%1)\n\t" /* Get actual value at phys addr r3 */
579 "mtmsr 5\n\t" : "=r" (ret) : "b" (Port)
580 );
581 return ret;
582}

Referenced by __indwordstring(), and READ_PORT_ULONG().

◆ __indwordstring()

PPC_QUAL void __indwordstring ( unsigned long  Port,
unsigned long Buffer,
unsigned long  Count 
)

Definition at line 598 of file intrin_ppc.h.

599{
600 while(Count--) {
601 *Buffer++ = __indword(Port);
602 }
603}
PPC_QUAL unsigned long __indword(const unsigned long Port)
Definition: intrin_ppc.h:569

Referenced by NmiDbgCallback(), READ_PORT_BUFFER_ULONG(), and ScsiPortReadPortBufferUlong().

◆ __int2c()

PPC_QUAL void __int2c ( void  )

Definition at line 703 of file intrin_ppc.h.

704{
705 /* Not sure yet */
706}

◆ __inword()

PPC_QUAL unsigned short __inword ( const unsigned long  Port)

Definition at line 554 of file intrin_ppc.h.

555{
556 int ret;
557 __asm__(
558 "mfmsr 5\n\t"
559 "andi. 6,5,0xffef\n\t"/* turn off MSR[DR] */
560 "mtmsr 6\n\t"
561 "isync\n\t"
562 "sync\n\t"
563 "lhz %0,0(%1)\n\t" /* Get actual value at phys addr r3 */
564 "mtmsr 5\n\t" : "=r" (ret) : "b" (Port)
565 );
566 return ret;
567}

Referenced by __inwordstring(), and READ_PORT_USHORT().

◆ __inwordstring()

PPC_QUAL void __inwordstring ( unsigned long  Port,
unsigned short Buffer,
unsigned long  Count 
)

Definition at line 591 of file intrin_ppc.h.

592{
593 while(Count--) {
594 *Buffer++ = __inword(Port);
595 }
596}
PPC_QUAL unsigned short __inword(const unsigned long Port)
Definition: intrin_ppc.h:554

Referenced by READ_PORT_BUFFER_USHORT(), and ScsiPortReadPortBufferUshort().

◆ __ll_lshift()

PPC_QUAL unsigned long long __ll_lshift ( const unsigned long long  Mask,
int  Bit 
)

Definition at line 510 of file intrin_ppc.h.

511{
512 return Mask << Bit;
513}
unsigned int Mask
Definition: fpcontrol.c:82

◆ __ll_rshift()

PPC_QUAL long long __ll_rshift ( const long long  Mask,
const int  Bit 
)

Definition at line 515 of file intrin_ppc.h.

516{
517 return Mask >> Bit;
518}

◆ __movsb()

PPC_QUAL void __movsb ( unsigned char Destination,
const unsigned char Source,
unsigned long  Count 
)

Definition at line 323 of file intrin_ppc.h.

324{
326}
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
Definition: ndis.h:3169
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
Definition: rtlfuncs.h:3004

Referenced by DoScroll(), MemFastMoveMemory(), and PreserveRow().

◆ __movsd()

PPC_QUAL void __movsd ( unsigned long Destination,
const unsigned long Source,
unsigned long  Count 
)

Definition at line 333 of file intrin_ppc.h.

334{
335 memcpy(Destination, Source, Count * sizeof(*Source));
336}

Referenced by MemFastMoveMemory().

◆ __movsw()

PPC_QUAL void __movsw ( unsigned short Destination,
const unsigned short Source,
unsigned long  Count 
)

Definition at line 328 of file intrin_ppc.h.

329{
330 memcpy(Destination, Source, Count * sizeof(*Source));
331}

Referenced by MemFastMoveMemory().

◆ __outbyte()

PPC_QUAL void __outbyte ( unsigned long const  Port,
const unsigned char  Data 
)

Definition at line 605 of file intrin_ppc.h.

606{
607 __asm__(
608 "mfmsr 5\n\t"
609 "andi. 6,5,0xffef\n\t"/* turn off MSR[DR] */
610 "mtmsr 6\n\t"
611 "sync\n\t"
612 "eieio\n\t"
613 "stb %1,0(%0)\n\t" /* Set actual value at phys addr r3 */
614 "dcbst 0,%1\n\t"
615 "mtmsr 5\n\t"
616 "sync\n\t"
617 "eieio\n\t" : : "b" (Port), "r" (Data)
618 );
619}

Referenced by __outbytestring(), _HalpDismissIrqGeneric(), _HalpDismissIrqLevel(), _Requires_lock_held_(), HalDisableSystemInterrupt(), HalEnableSystemInterrupt(), HalEndSystemInterrupt2(), HalMakeBeep(), HalpDismissIrq07(), HalpDismissIrq07Level(), HalpDismissIrq13(), HalpDismissIrq13Level(), HalpDismissIrq15(), HalpDismissIrq15Level(), HalpDispatchInterrupt2(), HalpEndSoftwareInterrupt2(), HalpInitializeLegacyPICs(), HalpIoWait(), HalpRead8254Value(), HalpSetTimerRollOver(), HalStartProfileInterrupt(), KfLowerIrql(), and WRITE_PORT_UCHAR().

◆ __outbytestring()

PPC_QUAL void __outbytestring ( unsigned long const  Port,
const unsigned char *const  Buffer,
const unsigned long  Count 
)

Definition at line 653 of file intrin_ppc.h.

654{
655 unsigned long count = Count;
656 const unsigned char *buffer = Buffer;
657 while(count--) {
658 __outbyte(Port, *buffer++);
659 }
660}
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint buffer
Definition: glext.h:5915
PPC_QUAL void __outbyte(unsigned long const Port, const unsigned char Data)
Definition: intrin_ppc.h:605

Referenced by ScsiPortWritePortBufferUchar(), and WRITE_PORT_BUFFER_UCHAR().

◆ __outdword()

PPC_QUAL void __outdword ( unsigned long const  Port,
const unsigned long  Data 
)

Definition at line 637 of file intrin_ppc.h.

638{
639 __asm__(
640 "mfmsr 5\n\t"
641 "andi. 6,5,0xffef\n\t"/* turn off MSR[DR] */
642 "mtmsr 6\n\t"
643 "sync\n\t"
644 "eieio\n\t"
645 "stw %1,0(%0)\n\t" /* Set actual value at phys addr r3 */
646 "dcbst 0,%1\n\t"
647 "mtmsr 5\n\t"
648 "sync\n\t"
649 "eieio\n\t" : : "b" (Port), "b" (Data)
650 );
651}

Referenced by __outdwordstring(), and WRITE_PORT_ULONG().

◆ __outdwordstring()

PPC_QUAL void __outdwordstring ( unsigned long const  Port,
const unsigned long *const  Buffer,
const unsigned long  Count 
)

Definition at line 671 of file intrin_ppc.h.

672{
673 unsigned long count = Count;
674 const unsigned long *buffer = Buffer;
675 while(count--) {
677 }
678}
PPC_QUAL void __outdword(unsigned long const Port, const unsigned long Data)
Definition: intrin_ppc.h:637

Referenced by ScsiPortWritePortBufferUlong(), and WRITE_PORT_BUFFER_ULONG().

◆ __outword()

PPC_QUAL void __outword ( unsigned long const  Port,
const unsigned short  Data 
)

Definition at line 621 of file intrin_ppc.h.

622{
623 __asm__(
624 "mfmsr 5\n\t"
625 "andi. 6,5,0xffef\n\t"/* turn off MSR[DR] */
626 "mtmsr 6\n\t"
627 "sync\n\t"
628 "eieio\n\t"
629 "sth %1,0(%0)\n\t" /* Set actual value at phys addr r3 */
630 "dcbst 0,%1\n\t"
631 "mtmsr 5\n\t"
632 "sync\n\t"
633 "eieio\n\t" : : "b" (Port), "b" (Data)
634 );
635}

Referenced by __outwordstring(), and WRITE_PORT_USHORT().

◆ __outwordstring()

PPC_QUAL void __outwordstring ( unsigned long const  Port,
const unsigned short *const  Buffer,
const unsigned long  Count 
)

Definition at line 662 of file intrin_ppc.h.

663{
664 unsigned long count = Count;
665 const unsigned short *buffer = Buffer;
666 while(count--) {
667 __outword(Port, *buffer++);
668 }
669}
PPC_QUAL void __outword(unsigned long const Port, const unsigned short Data)
Definition: intrin_ppc.h:621

Referenced by ScsiPortWritePortBufferUshort(), and WRITE_PORT_BUFFER_USHORT().

◆ __rdtsc()

◆ __readfsbyte()

PPC_QUAL unsigned char __readfsbyte ( const unsigned long  Offset)

Definition at line 360 of file intrin_ppc.h.

361{
362 unsigned short result;
363 __asm__("\tadd 7,13,%1\n"
364 "\tlbz %0,0(7)\n"
365 : "=r" (result)
366 : "r" (Offset)
367 : "r7");
368 return result;
369}
GLuint64EXT * result
Definition: glext.h:11304

Referenced by __addfsbyte(), __incfsbyte(), ApicGetCurrentIrql(), HalpLowerIrql(), KeGetCurrentIrql(), KeGetCurrentProcessorIndex(), and KeGetCurrentProcessorNumber().

◆ __readfsdword()

PPC_QUAL unsigned long __readfsdword ( const unsigned long  Offset)

Definition at line 382 of file intrin_ppc.h.

383{
384 unsigned long result;
385 __asm__("\tadd 7,13,%1\n"
386 "\tlwz %0,0(7)\n"
387 : "=r" (result)
388 : "r" (Offset)
389 : "r7");
390 return result;
391}

Referenced by __addfsdword(), __incfsdword(), __wine_push_frame(), _SEH2CurrentRegistration(), call_test(), KeGetCurrentPrcb(), KiSystemStartup(), KiSystemStartupBootStack(), NtCurrentTeb(), and START_TEST().

◆ __readfsword()

PPC_QUAL unsigned short __readfsword ( const unsigned long  Offset)

Definition at line 371 of file intrin_ppc.h.

372{
373 unsigned short result;
374 __asm__("\tadd 7,13,%1\n"
375 "\tlhz %0,0(7)\n"
376 : "=r" (result)
377 : "r" (Offset)
378 : "r7");
379 return result;
380}

Referenced by __addfsword(), and __incfsword().

◆ __readmsr()

◆ __readsdr1()

PPC_QUAL unsigned long __readsdr1 ( void  )

Definition at line 726 of file intrin_ppc.h.

727{
728 unsigned long value;
729 __asm__("mfsdr1 %0" : "=b" (value));
730 return value;
731}

◆ __stosb()

PPC_QUAL void __stosb ( unsigned char Dest,
const unsigned char  Data,
unsigned long  Count 
)

Definition at line 306 of file intrin_ppc.h.

307{
308 memset(Dest, Data, Count);
309}
#define memset(x, y, z)
Definition: compat.h:39

Referenced by RtlSecureZeroMemory().

◆ __stosd()

PPC_QUAL void __stosd ( unsigned long Dest,
const unsigned long  Data,
unsigned long  Count 
)

Definition at line 317 of file intrin_ppc.h.

318{
319 while(Count--)
320 *Dest++ = Data;
321}

◆ __stosw()

PPC_QUAL void __stosw ( unsigned short Dest,
const unsigned short  Data,
unsigned long  Count 
)

Definition at line 311 of file intrin_ppc.h.

312{
313 while(Count--)
314 *Dest++ = Data;
315}

◆ __ull_rshift()

PPC_QUAL unsigned long long __ull_rshift ( const unsigned long long  Mask,
int  Bit 
)

Definition at line 520 of file intrin_ppc.h.

521{
522 return Mask >> Bit;
523}

◆ __wbinvd()

PPC_QUAL void __wbinvd ( void  )

Definition at line 759 of file intrin_ppc.h.

760{
761 __asm__("eieio\n\t"
762 "dcs\n\t"
763 "sync\n\t"
764 "isync\n\t");
765}

Referenced by KeInvalidateAllCaches(), KeSweepICache(), and XboxMemInit().

◆ __writefsbyte()

PPC_QUAL void __writefsbyte ( const unsigned long  Offset,
const unsigned char  Data 
)

Definition at line 342 of file intrin_ppc.h.

343{
344 char *addr;
345 __asm__("\tadd %0,13,%1\n\tstb %2,0(%0)" : "=r" (addr) : "r" (Offset), "r" (Data));
346}
GLenum const GLvoid * addr
Definition: glext.h:9621

Referenced by __addfsbyte(), __incfsbyte(), ApicLowerIrql(), ApicSetIrql(), HalpLowerIrql(), HalRequestSoftwareInterrupt(), and KeSetCurrentIrql().

◆ __writefsdword()

PPC_QUAL void __writefsdword ( const unsigned long  Offset,
const unsigned long  Data 
)

Definition at line 354 of file intrin_ppc.h.

355{
356 char *addr;
357 __asm__("\tadd %0,13,%1\n\tstw %2,0(%0)" : "=r" (addr) : "r" (Offset), "r" (Data));
358}

Referenced by __addfsdword(), __incfsdword(), __SEH2EnterFrame(), __SEH2LeaveFrame(), __wine_pop_frame(), __wine_push_frame(), call_test(), and KiSystemStartup().

◆ __writefsword()

PPC_QUAL void __writefsword ( const unsigned long  Offset,
const unsigned short  Data 
)

Definition at line 348 of file intrin_ppc.h.

349{
350 char *addr;
351 __asm__("\tadd %0,13,%1\n\tsth %2,0(%0)" : "=r" (addr) : "r" (Offset), "r" (Data));
352}

Referenced by __addfsword(), and __incfsword().

◆ __writemsr()

PPC_QUAL void __writemsr ( const unsigned long  Value)

Definition at line 748 of file intrin_ppc.h.

749{
750 __asm__("mtmsr %0" : : "b" (Value));
751}
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:413

Referenced by ApicInitializeLocalApic(), BlpArchInitialize(), HalpInitializeTsc(), KdpSysWriteMsr(), KiGetFeatureBits(), KiInitializeCpu(), KiLoadFastSyscallMachineSpecificRegisters(), KiRestoreProcessorControlState(), KiSwapContextResume(), OslpMain(), and VerifyLocalAPIC().

◆ __writesdr1()

PPC_QUAL void __writesdr1 ( const unsigned long long  Data)

Definition at line 733 of file intrin_ppc.h.

734{
735 __asm__("mtsdr1 %0" : : "b" (Data));
736}

◆ _BitScanForward()

PPC_QUAL unsigned char _BitScanForward ( unsigned long *const  Index,
const unsigned long  Mask 
)

Definition at line 427 of file intrin_ppc.h.

428{
429 if(Mask == 0) return 0;
430 else {
431 unsigned long mask = Mask;
432 mask &= -mask;
433 *Index =
434 ((mask & 0xffff0000) ? 16 : 0) +
435 ((mask & 0xff00ff00) ? 8 : 0) +
436 ((mask & 0xf0f0f0f0) ? 4 : 0) +
437 ((mask & 0xcccccccc) ? 2 : 0) +
438 ((mask & 0xaaaaaaaa) ? 1 : 0);
439 return 1;
440 }
441}
GLenum GLint GLuint mask
Definition: glext.h:6028
_In_ WDFCOLLECTION _In_ ULONG Index

◆ _BitScanReverse()

PPC_QUAL unsigned char _BitScanReverse ( unsigned long *const  Index,
const unsigned long  Mask 
)

Definition at line 444 of file intrin_ppc.h.

445{
446 unsigned long check = 16, checkmask;
447 if(Mask == 0) return 0;
448 else {
449 unsigned long mask = Mask;
450 *Index = 0;
451 while(check) {
452 checkmask = ((1<<check)-1) << check;
453 if( mask & checkmask ) {
454 mask >>= check;
455 *Index += check;
456 }
457 check >>= 1;
458 }
459 return 1;
460 }
461}
#define check(expected, result)
Definition: dplayx.c:32

◆ _bittest()

PPC_QUAL unsigned char _bittest ( const long *const  a,
const long  b 
)

Definition at line 464 of file intrin_ppc.h.

465{
466 return ((*a) & (1<<b)) != 0;
467}
GLboolean GLboolean GLboolean b
Definition: glext.h:6204

◆ _bittestandcomplement()

PPC_QUAL unsigned char _bittestandcomplement ( long *const  a,
const long  b 
)

Definition at line 469 of file intrin_ppc.h.

470{
471 unsigned char ret = ((*a) & (1<<b)) != 0;
472 (*a) ^= (1<<b);
473 return ret;
474}

◆ _bittestandreset()

PPC_QUAL unsigned char _bittestandreset ( long *const  a,
const long  b 
)

Definition at line 476 of file intrin_ppc.h.

477{
478 unsigned char ret = ((*a) & (1<<b)) != 0;
479 (*a) &= ~(1<<b);
480 return ret;
481}

◆ _bittestandset()

PPC_QUAL unsigned char _bittestandset ( long *const  a,
const long  b 
)

Definition at line 483 of file intrin_ppc.h.

484{
485 unsigned char ret = ((*a) & (1<<b)) != 0;
486 (*a) |= (1<<b);
487 return ret;
488}

◆ _disable()

PPC_QUAL void _disable ( void  )

Definition at line 710 of file intrin_ppc.h.

711{
712 __asm__ __volatile__("mfmsr 0\n\t" \
713 "li 8,0x7fff\n\t" \
714 "and 0,8,0\n\t" \
715 "mtmsr 0\n\t");
716}

◆ _enable()

PPC_QUAL void _enable ( void  )

Definition at line 718 of file intrin_ppc.h.

719{
720 __asm__ __volatile__("mfmsr 8\n\t" \
721 "ori 8,8,0x8000\n\t" \
722 "mtmsr 8\n\t");
723}

◆ _InterlockedAddLargeStatistic()

PPC_QUAL long _InterlockedAddLargeStatistic ( volatile long long *const  Addend,
const long  Value 
)

Definition at line 768 of file intrin_ppc.h.

769{
770#if 0
771 __asm__
772 (
773 "lock; add %[Value], %[Lo32];"
774 "jae LABEL%=;"
775 "lock; adc $0, %[Hi32];"
776 "LABEL%=:;" :
777 [Lo32] "=m" (*((volatile long *)(Addend) + 0)), [Hi32] "=m" (*((volatile long *)(Addend) + 1)) :
778 [Value] "ir" (Value)
779 );
780#endif
781 return Value;
782}
IN OUT PLONG Addend
Definition: CrNtStubs.h:25

◆ _interlockedbittestandreset()

PPC_QUAL unsigned char _interlockedbittestandreset ( volatile long *const  a,
const long  b 
)

Definition at line 248 of file intrin_ppc.h.

249{
250 long x;
251 long y;
252 long mask = ~(1<<b);
253
254 do
255 {
256 x = *a;
258 }
259 while(y != x);
260
261 return (y & ~mask) != 0;
262}
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define a
Definition: ke_i.h:78

◆ _interlockedbittestandset()

Definition at line 275 of file intrin_ppc.h.

276{
277 long x;
278 long y;
279 long mask = 1<<b;
280
281 do
282 {
283 x = *a;
285 }
286 while(y != x);
287
288 return (y & ~mask) != 0;
289}

◆ _InterlockedCompareExchange()

PPC_QUAL long _InterlockedCompareExchange ( volatile long *const  Destination,
const long  Exchange,
const long  Comperand 
)

Definition at line 183 of file intrin_ppc.h.

184{
185 volatile long retval __asm__("r8") = 0;
186 __asm__ __volatile__ (
187 "sync\n"
188 "1: lwarx %0,0,%1\n"
189 : "=&r" (retval) : "r" (Destination));
190 __asm__ __volatile__ (
191 " cmpw %3,%1\n"
192 " bne- 2f\n"
193 " stwcx. %2,0,%0\n"
194 " bne- 1b\n"
195 "2: isync"
196 :
197 : "r" (Destination), "r" (Comperand), "r" (Exchange), "r" (retval));
198 return retval;
199}

Referenced by _interlockedbittestandreset(), _interlockedbittestandset(), and _InterlockedCompareExchangePointer().

◆ _InterlockedCompareExchange16()

PPC_QUAL short _InterlockedCompareExchange16 ( volatile short *const  Destination,
const short  Exchange,
const short  Comperand 
)

Definition at line 165 of file intrin_ppc.h.

166{
167 volatile long retval __asm__("r8") = 0;
168 __asm__ __volatile__ (
169 "sync\n"
170 "1: lharx %0,0,%1\n"
171 : "=&r" (retval) : "r" (Destination));
172 __asm__ __volatile__ (
173 " cmpw %3,%1\n"
174 " bne- 2f\n"
175 " sthcx. %2,0,%0\n"
176 " bne- 1b\n"
177 "2: isync"
178 :
179 : "r" (Destination), "r" (Comperand), "r" (Exchange), "r" (retval));
180 return retval;
181}

◆ _InterlockedCompareExchange64()

PPC_QUAL long long _InterlockedCompareExchange64 ( volatile long long *const  Target,
const long long  Exchange,
const long long  Comperand 
)

Definition at line 201 of file intrin_ppc.h.

202{
203 long long capture = *Target;
204 if (*Target == Comperand) *Target = Exchange;
205 return capture;
206}
_In_ WDFIOTARGET Target
Definition: wdfrequest.h:306

◆ _InterlockedCompareExchange8()

PPC_QUAL char _InterlockedCompareExchange8 ( volatile char *const  Destination,
const char  Exchange,
const char  Comperand 
)

Definition at line 147 of file intrin_ppc.h.

148{
149 volatile long retval __asm__("r8") = 0;
150 __asm__ __volatile__ (
151 "sync\n"
152 "1: lbarx %0,0,%1\n"
153 : "=r" (retval) : "r" (Destination));
154 __asm__ __volatile__ (
155 " cmpw %3,%1\n"
156 " bne- 2f\n"
157 " stbcx. %2,0,%0\n"
158 " bne- 1b\n"
159 "2: isync"
160 :
161 : "r" (Destination), "r" (Comperand), "r" (Exchange), "r" (retval));
162 return retval;
163}

◆ _InterlockedCompareExchangePointer()

PPC_QUAL void * _InterlockedCompareExchangePointer ( void *volatile *const  Destination,
void *const  Exchange,
void *const  Comperand 
)

Definition at line 208 of file intrin_ppc.h.

209{
210 return (void *)_InterlockedCompareExchange
211 ((long *)Destination, (long) Exchange, (long) Comperand);
212}

◆ _InterlockedDecrement()

PPC_QUAL long _InterlockedDecrement ( volatile long *const  lpAddend)

Definition at line 292 of file intrin_ppc.h.

293{
294 return _InterlockedExchangeAdd(lpAddend, -1) - 1;
295}
long __cdecl _InterlockedExchangeAdd(_Interlocked_operand_ long volatile *_Addend, long _Value)

◆ _InterlockedExchange()

PPC_QUAL long _InterlockedExchange ( volatile long *const  Target,
const long  Value 
)

Definition at line 214 of file intrin_ppc.h.

215{
216 long retval __asm__("r8");
217 __asm__ __volatile__ (
218 "sync\n"
219 "1: lwarx 8,0,3\n"
220 " stwcx. 4,0,3\n"
221 " bne- 1b\n"
222 " mr 3,8\n"
223 : "=b" (retval)
224 : "b" (Target), "b" (Value)
225 : "cr0", "memory");
226 return retval;
227}

Referenced by _InterlockedExchangePointer().

◆ _InterlockedExchangePointer()

PPC_QUAL void * _InterlockedExchangePointer ( void *volatile *const  Target,
void *const  Value 
)

Definition at line 229 of file intrin_ppc.h.

230{
231 return (void *)_InterlockedExchange((long *)Target, (long)Value);
232}
PPC_QUAL long _InterlockedExchange(volatile long *const Target, const long Value)
Definition: intrin_ppc.h:214

◆ _InterlockedIncrement()

PPC_QUAL long _InterlockedIncrement ( volatile long *const  lpAddend)

Definition at line 297 of file intrin_ppc.h.

298{
299 return _InterlockedExchangeAdd(lpAddend, 1) + 1;
300}

◆ _rotl16()

PPC_QUAL unsigned short _rotl16 ( const unsigned short  value,
const unsigned char  shift 
)

Definition at line 495 of file intrin_ppc.h.

496{
497 return (value << shift) | (value >> (16-shift));
498}
#define shift
Definition: input.c:1755

◆ _rotl8()

PPC_QUAL unsigned char _rotl8 ( const unsigned char  value,
const unsigned char  shift 
)

Definition at line 490 of file intrin_ppc.h.

491{
492 return (value << shift) | (value >> (8-shift));
493}

◆ _rotr16()

PPC_QUAL unsigned short _rotr16 ( const unsigned short  value,
const unsigned char  shift 
)

Definition at line 505 of file intrin_ppc.h.

506{
507 return (value >> shift) | (value << (16-shift));
508}

◆ _rotr8()

PPC_QUAL unsigned char _rotr8 ( const unsigned char  value,
const unsigned char  shift 
)

Definition at line 500 of file intrin_ppc.h.

501{
502 return (value >> shift) | (value << (8-shift));
503}

◆ PPC_MakeInterlockedFunction() [1/5]

volatile char *const const char modify volatile long *const const long modify PPC_MakeInterlockedFunction ( char  ,
_InterlockedOr8  ,
,
(volatile char *const value, const char modify)   
)

◆ PPC_MakeInterlockedFunction() [2/5]

PPC_MakeInterlockedFunction ( long  ,
_InterlockedExchangeAdd  ,
,
(volatile long *const value, const long modify)   
)

◆ PPC_MakeInterlockedFunction() [3/5]

volatile char *const const char modify volatile long *const const long modify volatile short *const const short modify PPC_MakeInterlockedFunction ( long  ,
_InterlockedOr  ,
,
(volatile long *const value, const long modify)   
)

◆ PPC_MakeInterlockedFunction() [4/5]

volatile char *const const char modify PPC_MakeInterlockedFunction ( short  ,
_InterlockedAnd16  ,
,
(volatile short *const value, const short modify)   
)

◆ PPC_MakeInterlockedFunction() [5/5]

volatile char *const const char modify volatile long *const const long modify volatile short *const const short modify volatile char *const const char modify PPC_MakeInterlockedFunction ( short  ,
_InterlockedXor16  ,
,
(volatile short *const value, const short modify)   
)

Variable Documentation

◆ _InterlockedAnd

volatile char *const const char modify _InterlockedAnd

Definition at line 267 of file intrin_ppc.h.

Referenced by _Init_thread_abort(), and _interlockedbittestandreset().

◆ _InterlockedAnd8

_InterlockedAnd8

Definition at line 265 of file intrin_ppc.h.

◆ _InterlockedOr16

volatile char *const const char modify volatile long *const const long modify _InterlockedOr16

Definition at line 269 of file intrin_ppc.h.

◆ _InterlockedXor

Definition at line 273 of file intrin_ppc.h.

◆ _InterlockedXor8

volatile char *const const char modify volatile long *const const long modify volatile short *const const short modify _InterlockedXor8

Definition at line 271 of file intrin_ppc.h.

◆ value

Definition at line 265 of file intrin_ppc.h.

Referenced by __readsdr1().