The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/arm/include/cpu.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /* $NetBSD: cpu.h,v 1.2 2001/02/23 21:23:52 reinoud Exp $ */
    2 /* $FreeBSD$ */
    3 
    4 #ifndef MACHINE_CPU_H
    5 #define MACHINE_CPU_H
    6 
    7 #include <machine/armreg.h>
    8 #include <machine/frame.h>
    9 
   10 void    cpu_halt(void);
   11 
   12 #ifdef _KERNEL
   13 #include <machine/cpu-v6.h>
   14 
   15 static __inline uint64_t
   16 get_cyclecount(void)
   17 {
   18 #if __ARM_ARCH > 6 || (__ARM_ARCH == 6 && defined(CPU_ARM1176))
   19 #if (__ARM_ARCH > 6) && defined(DEV_PMU)
   20         if (pmu_attched) {
   21                 u_int cpu;
   22                 uint64_t h, h2;
   23                 uint32_t l, r;
   24 
   25                 cpu = PCPU_GET(cpuid);
   26                 h = (uint64_t)atomic_load_acq_32(&ccnt_hi[cpu]);
   27                 l = cp15_pmccntr_get();
   28                 /* In case interrupts are disabled we need to check for overflow. */
   29                 r = cp15_pmovsr_get();
   30                 if (r & PMU_OVSR_C) {
   31                         atomic_add_32(&ccnt_hi[cpu], 1);
   32                         /* Clear the event. */
   33                         cp15_pmovsr_set(PMU_OVSR_C);
   34                 }
   35                 /* Make sure there was no wrap-around while we read the lo half. */
   36                 h2 = (uint64_t)atomic_load_acq_32(&ccnt_hi[cpu]);
   37                 if (h != h2)
   38                         l = cp15_pmccntr_get();
   39                 return (h2 << 32 | l);
   40         } else
   41 #endif
   42                 return cp15_pmccntr_get();
   43 #else /* No performance counters, so use nanotime(9). */
   44         struct timespec tv;
   45 
   46         nanotime(&tv);
   47         return (tv.tv_sec * (uint64_t)1000000000ull + tv.tv_nsec);
   48 #endif
   49 }
   50 #endif
   51 
   52 #define TRAPF_USERMODE(frame)   ((frame->tf_spsr & PSR_MODE) == PSR_USR32_MODE)
   53 
   54 #define TRAPF_PC(tfp)           ((tfp)->tf_pc)
   55 
   56 #define cpu_getstack(td)        ((td)->td_frame->tf_usr_sp)
   57 #define cpu_setstack(td, sp)    ((td)->td_frame->tf_usr_sp = (sp))
   58 #define cpu_spinwait()          /* nothing */
   59 #define cpu_lock_delay()        DELAY(1)
   60 
   61 #define ARM_NVEC                8
   62 #define ARM_VEC_ALL             0xffffffff
   63 
   64 extern vm_offset_t vector_page;
   65 
   66 /*
   67  * Params passed into initarm. If you change the size of this you will
   68  * need to update locore.S to allocate more memory on the stack before
   69  * it calls initarm.
   70  */
   71 struct arm_boot_params {
   72         register_t      abp_size;       /* Size of this structure */
   73         register_t      abp_r0;         /* r0 from the boot loader */
   74         register_t      abp_r1;         /* r1 from the boot loader */
   75         register_t      abp_r2;         /* r2 from the boot loader */
   76         register_t      abp_r3;         /* r3 from the boot loader */
   77         vm_offset_t     abp_physaddr;   /* The kernel physical address */
   78         vm_offset_t     abp_pagetable;  /* The early page table */
   79 };
   80 
   81 void    arm_vector_init(vm_offset_t, int);
   82 void    fork_trampoline(void);
   83 void    identify_arm_cpu(void);
   84 void    *initarm(struct arm_boot_params *);
   85 
   86 extern char btext[];
   87 extern char etext[];
   88 int badaddr_read(void *, size_t, void *);
   89 #endif /* !MACHINE_CPU_H */

Cache object: 3f7282e7002de7367ef14ebf765ceedc


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.