Back to home page

OSCL-LXR

 
 

    


0001 #ifndef _ASM_POWERPC_DTL_H
0002 #define _ASM_POWERPC_DTL_H
0003 
0004 #include <asm/lppaca.h>
0005 #include <linux/spinlock_types.h>
0006 
0007 /*
0008  * Layout of entries in the hypervisor's dispatch trace log buffer.
0009  */
0010 struct dtl_entry {
0011     u8  dispatch_reason;
0012     u8  preempt_reason;
0013     __be16  processor_id;
0014     __be32  enqueue_to_dispatch_time;
0015     __be32  ready_to_enqueue_time;
0016     __be32  waiting_to_ready_time;
0017     __be64  timebase;
0018     __be64  fault_addr;
0019     __be64  srr0;
0020     __be64  srr1;
0021 };
0022 
0023 #define DISPATCH_LOG_BYTES  4096    /* bytes per cpu */
0024 #define N_DISPATCH_LOG      (DISPATCH_LOG_BYTES / sizeof(struct dtl_entry))
0025 
0026 /*
0027  * Dispatch trace log event enable mask:
0028  *   0x1: voluntary virtual processor waits
0029  *   0x2: time-slice preempts
0030  *   0x4: virtual partition memory page faults
0031  */
0032 #define DTL_LOG_CEDE        0x1
0033 #define DTL_LOG_PREEMPT     0x2
0034 #define DTL_LOG_FAULT       0x4
0035 #define DTL_LOG_ALL     (DTL_LOG_CEDE | DTL_LOG_PREEMPT | DTL_LOG_FAULT)
0036 
0037 extern struct kmem_cache *dtl_cache;
0038 extern rwlock_t dtl_access_lock;
0039 
0040 /*
0041  * When CONFIG_VIRT_CPU_ACCOUNTING_NATIVE = y, the cpu accounting code controls
0042  * reading from the dispatch trace log.  If other code wants to consume
0043  * DTL entries, it can set this pointer to a function that will get
0044  * called once for each DTL entry that gets processed.
0045  */
0046 extern void (*dtl_consumer)(struct dtl_entry *entry, u64 index);
0047 
0048 extern void register_dtl_buffer(int cpu);
0049 extern void alloc_dtl_buffers(unsigned long *time_limit);
0050 extern long hcall_vphn(unsigned long cpu, u64 flags, __be32 *associativity);
0051 
0052 #endif /* _ASM_POWERPC_DTL_H */