ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

ke.h
Go to the documentation of this file.
00001 /*
00002  *  ReactOS kernel
00003  *  Copyright (C) 1998, 1999, 2000, 2001 ReactOS Team
00004  *
00005  *  This program is free software; you can redistribute it and/or modify
00006  *  it under the terms of the GNU General Public License as published by
00007  *  the Free Software Foundation; either version 2 of the License, or
00008  *  (at your option) any later version.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU General Public License along
00016  *  with this program; if not, write to the Free Software Foundation, Inc.,
00017  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00018  */
00019 
00020 #pragma once
00021 
00022 #include <ndk/powerpc/ketypes.h>
00023 
00024 /* Possible values for KTHREAD's NpxState */
00025 #define KPCR_BASE 0xff000000
00026 #define NPX_STATE_INVALID   0x01
00027 #define NPX_STATE_VALID     0x02
00028 #define NPX_STATE_DIRTY     0x04
00029 
00030 #ifndef __ASM__
00031 
00032 typedef struct _KIRQ_TRAPFRAME
00033 {
00034 } KIRQ_TRAPFRAME, *PKIRQ_TRAPFRAME;
00035 
00036 extern ULONG KePPCCacheAlignment;
00037 
00038 //#define KD_BREAKPOINT_TYPE
00039 //#define KD_BREAKPOINT_SIZE
00040 //#define KD_BREAKPOINT_VALUE
00041 
00042 //
00043 // Macro to get the second level cache size field name which differs between
00044 // CISC and RISC architectures, as the former has unified I/D cache
00045 //
00046 #define KiGetSecondLevelDCacheSize() ((PKIPCR)KeGetPcr())->SecondLevelDcacheSize
00047 
00048 //
00049 // Macros for getting and setting special purpose registers in portable code
00050 //
00051 #define KeGetContextPc(Context) \
00052     ((Context)->Dr0)
00053 
00054 #define KeSetContextPc(Context, ProgramCounter) \
00055     ((Context)->Dr0 = (ProgramCounter))
00056 
00057 #define KeGetTrapFramePc(TrapFrame) \
00058     ((TrapFrame)->Dr0)
00059 
00060 #define KeGetContextReturnRegister(Context) \
00061     ((Context)->Gpr3)
00062 
00063 #define KeSetContextReturnRegister(Context, ReturnValue) \
00064     ((Context)->Gpr3 = (ReturnValue))
00065 
00066 //
00067 // Returns the Interrupt State from a Trap Frame.
00068 // ON = TRUE, OFF = FALSE
00069 //
00070 //#define KeGetTrapFrameInterruptState(TrapFrame) \
00071 
00072 #define KePPCRdmsr(msr,val1,val2) __asm__ __volatile__("mfmsr 3")
00073 
00074 #define KePPCWrmsr(msr,val1,val2) __asm__ __volatile__("mtmsr 3")
00075 
00076 #define PPC_MIN_CACHE_LINE_SIZE 32
00077 
00078 FORCEINLINE struct _KPCR * NTHALAPI KeGetCurrentKPCR(
00079     VOID)
00080 {
00081     return (struct _KPCR *)__readfsdword(0x1c);
00082 }
00083 
00084 FORCEINLINE
00085 VOID
00086 KeFlushProcessTb(VOID)
00087 {
00088     /* Flush the TLB */
00089     __asm__("sync\n\tisync\n\t");
00090 }
00091 
00092 FORCEINLINE
00093 PRKTHREAD
00094 KeGetCurrentThread(VOID)
00095 {
00096     /* Return the current thread */
00097     return KeGetCurrentPrcb()->CurrentThread;
00098 }
00099 
00100 FORCEINLINE
00101 VOID
00102 KiRundownThread(IN PKTHREAD Thread)
00103 {
00104     /* FIXME */
00105 }
00106 
00107 #ifdef _NTOSKRNL_ /* FIXME: Move flags above to NDK instead of here */
00108 VOID
00109 NTAPI
00110 KiThreadStartup(PKSYSTEM_ROUTINE SystemRoutine,
00111                 PKSTART_ROUTINE StartRoutine,
00112                 PVOID StartContext,
00113                 BOOLEAN UserThread,
00114                 KTRAP_FRAME TrapFrame);
00115 #endif
00116 
00117 #endif /* __ASM__ */
00118 
00119 /* EOF */

Generated on Fri May 25 2012 04:31:55 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.