本文整理汇总了C++中mfmsr函数的典型用法代码示例。如果您正苦于以下问题:C++ mfmsr函数的具体用法?C++ mfmsr怎么用?C++ mfmsr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mfmsr函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: do_reset
int do_reset (cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
{
uint pvr;
uint ver;
unsigned long val, msr;
pvr = get_pvr();
ver = PVR_VER(pvr);
if (ver & 1){
/* e500 v2 core has reset control register */
volatile unsigned int * rstcr;
rstcr = (volatile unsigned int *)(CFG_IMMR + 0xE00B0);
*rstcr = 0x2; /* HRESET_REQ */
udelay(100);
}
/*
* Fallthrough if the code above failed
* Initiate hard reset in debug control register DBCR0
* Make sure MSR[DE] = 1
*/
msr = mfmsr ();
msr |= MSR_DE;
mtmsr (msr);
val = mfspr(DBCR0);
val |= 0x70000000;
mtspr(DBCR0,val);
return 1;
}
开发者ID:Februar0218,项目名称:u-boot-omap-pandora,代码行数:33,代码来源:cpu.c
示例2: rs64_start
static void rs64_start(struct op_counter_config *ctr)
{
int i;
unsigned int mmcr0;
/* set the PMM bit (see comment below) */
mtmsrd(mfmsr() | MSR_PMM);
for (i = 0; i < num_counters; ++i) {
if (ctr[i].enabled) {
ctr_write(i, reset_value[i]);
ctrl_write(i, ctr[i].event);
} else {
ctr_write(i, 0);
}
}
mmcr0 = mfspr(SPRN_MMCR0);
/*
* now clear the freeze bit, counting will not start until we
* rfid from this excetion, because only at that point will
* the PMM bit be cleared
*/
mmcr0 &= ~MMCR0_FC;
mtspr(SPRN_MMCR0, mmcr0);
dbg("start on cpu %d, mmcr0 %x\n", smp_processor_id(), mmcr0);
}
开发者ID:Antonio-Zhou,项目名称:Linux-2.6.11,代码行数:29,代码来源:op_model_rs64.c
示例3: fsl_emb_handle_interrupt
static void fsl_emb_handle_interrupt(struct pt_regs *regs,
struct op_counter_config *ctr)
{
unsigned long pc;
int is_kernel;
int val;
int i;
/* set the PMM bit (see comment below) */
mtmsr(mfmsr() | MSR_PMM);
pc = regs->nip;
is_kernel = is_kernel_addr(pc);
for (i = 0; i < num_counters; ++i) {
val = ctr_read(i);
if (val < 0) {
if (oprofile_running && ctr[i].enabled) {
oprofile_add_ext_sample(pc, regs, i, is_kernel);
ctr_write(i, reset_value[i]);
} else {
ctr_write(i, 0);
}
}
}
/* The freeze bit was set by the interrupt. */
/* Clear the freeze bit, and reenable the interrupt.
* The counters won't actually start until the rfi clears
* the PMM bit */
pmc_start_ctrs(1);
}
开发者ID:mikuhatsune001,项目名称:linux2.6.32,代码行数:32,代码来源:op_model_fsl_emb.c
示例4: XIo_DcrIndirectAddrWriteReg
/**
* Writes the register at specified DCR address using the indirect addressing
* method.
*
*
* @param DcrBase is the base of the block of DCR registers
* @param DcrRegister is the intended destination DCR register
* @param Data is the value to be placed into the specified DRC register
*
* @return
*
* None
*
* @note
*
* C-style signature:
* void XIo_DcrIndirectAddrWriteReg(u32 DcrBase, u32 DcrRegister,
* u32 Data)
*
* Assumes auto-buslocking feature is ON.
* In order to make this operation atomic, interrupts are disabled before
* and enabled after the DCR accesses.
*
******************************************************************************/
inline void XIo_DcrIndirectAddrWriteReg(u32 DcrBase, u32 DcrRegister, u32 Data)
{
unsigned int oldMSR = mfmsr();
mtmsr(oldMSR & XDCR_DISABLE_EXCEPTIONS);
switch (DcrBase)
{
case XDCR_0_BASEADDR:
XIo_mDcrWriteReg(XDCR_0_BASEADDR | XDCR_IDA_ADDR, XDCR_0_BASEADDR | DcrRegister);
XIo_mDcrWriteReg(XDCR_0_BASEADDR | XDCR_IDA_ACC, Data);
break;
case XDCR_1_BASEADDR:
XIo_mDcrWriteReg(XDCR_1_BASEADDR | XDCR_IDA_ADDR, XDCR_1_BASEADDR | DcrRegister);
XIo_mDcrWriteReg(XDCR_1_BASEADDR | XDCR_IDA_ACC, Data);
break;
case XDCR_2_BASEADDR:
XIo_mDcrWriteReg(XDCR_2_BASEADDR | XDCR_IDA_ADDR, XDCR_2_BASEADDR | DcrRegister);
XIo_mDcrWriteReg(XDCR_2_BASEADDR | XDCR_IDA_ACC, Data);
break;
case XDCR_3_BASEADDR:
XIo_mDcrWriteReg(XDCR_3_BASEADDR | XDCR_IDA_ADDR, XDCR_3_BASEADDR | DcrRegister);
XIo_mDcrWriteReg(XDCR_3_BASEADDR | XDCR_IDA_ACC, Data);
break;
default:
XIo_mDcrWriteReg(XDCR_0_BASEADDR | XDCR_IDA_ADDR, XDCR_0_BASEADDR | DcrRegister);
XIo_mDcrWriteReg(XDCR_0_BASEADDR | XDCR_IDA_ACC, Data);
break;
}
mtmsr(oldMSR);
return;
}
开发者ID:aalonso,项目名称:xilinx-ml507-updated,代码行数:55,代码来源:xio_dcr.c
示例5: XIo_DcrWriteAPUUDIReg
/**
* Writes the data to the APU UDI register at the specified APU address.
*
*
* @param DcrBase is the base of the block of DCR registers
* @param UDInum is the intended source APU register
* @param Data is the value to be placed into the specified APU register
*
* @return
*
* None
*
* @note
*
* C-style signature:
* void XIo_DcrWriteAPUUDIReg(u32 DcrRegister, u32 UDInum, u32 Data)
*
* Since writing an APU UDI DCR requires a dummy write to the same DCR,
* the target UDI number is required. In order to make this operation atomic,
* interrupts are disabled before and enabled after the DCR accesses.
* Because an APU UDI access involves two DCR accesses, the DCR bus must be
* locked to ensure that another master doesn't access the APU UDI register
* at the same time.
* Care must be taken to not write a '1' to either timeout bit because
* it will be cleared.
* Steps:
* - save old MSR
* - disable interrupts by writing mask to MSR
* - acquire lock, since the PPC440 supports timeout wait, it will wait until
* it successfully acquires the DCR bus lock
* - shift and mask the UDI number to its bit position of [22:25]
* - add DCR base address to UDI number offset and perform the write
* - release DCR bus lock
* - restore MSR
*
*******************************************************************************/
inline void XIo_DcrWriteAPUUDIReg(u32 DcrBase, u32 UDInum, u32 Data)
{
u32 oldMSR = mfmsr();
mtmsr(oldMSR & XDCR_DISABLE_EXCEPTIONS);
XIo_DcrLock(DcrBase);
switch (DcrBase) {
case XDCR_0_BASEADDR:
mtdcr(XDCR_0_BASEADDR | XDCR_APU_UDI, (((UDInum) << 6) & 0x000003c0) | 0x00000030);
mtdcr(XDCR_0_BASEADDR | XDCR_APU_UDI, (Data));
break;
case XDCR_1_BASEADDR:
mtdcr(XDCR_1_BASEADDR | XDCR_APU_UDI, (((UDInum) << 6) & 0x000003c0) | 0x00000030);
mtdcr(XDCR_1_BASEADDR | XDCR_APU_UDI, (Data));
break;
case XDCR_2_BASEADDR:
mtdcr(XDCR_2_BASEADDR | XDCR_APU_UDI, (((UDInum) << 6) & 0x000003c0) | 0x00000030);
mtdcr(XDCR_2_BASEADDR | XDCR_APU_UDI, (Data));
break;
case XDCR_3_BASEADDR:
mtdcr(XDCR_3_BASEADDR | XDCR_APU_UDI, (((UDInum) << 6) & 0x000003c0) | 0x00000030);
mtdcr(XDCR_3_BASEADDR | XDCR_APU_UDI, (Data));
break;
default:
mtdcr(XDCR_0_BASEADDR | XDCR_APU_UDI, (((UDInum) << 6) & 0x000003c0) | 0x00000030);
mtdcr(XDCR_0_BASEADDR | XDCR_APU_UDI, (Data));
break;
}
XIo_DcrUnlock(DcrBase);
mtmsr(oldMSR);
}
开发者ID:aalonso,项目名称:xilinx-ml507-updated,代码行数:68,代码来源:xio_dcr.c
示例6: XIo_DcrReadAPUUDIReg
/**
* Reads the APU UDI register at the specified APU address.
*
*
* @param DcrBase is the base of the block of DCR registers
* @param UDInum is the intended source APU register
*
* @return
*
* Contents of the specified APU register.
*
* @note
*
* C-style signature:
* u32 XIo_DcrReadAPUUDIReg(u32 DcrRegister, u32 UDInum)
*
* Since reading an APU UDI DCR requires a dummy write to the same DCR,
* the target UDI number is required. In order to make this operation atomic,
* interrupts are disabled before and enabled after the DCR accesses.
* Because an APU UDI access involves two DCR accesses, the DCR bus must be
* locked to ensure that another master doesn't access the APU UDI register
* at the same time.
* Care must be taken to not write a '1' to either timeout bit because
* it will be cleared.
* Steps:
* - save old MSR
* - disable interrupts by writing mask to MSR
* - acquire lock; since the PPC440 supports timeout wait, it will wait until
* it successfully acquires the DCR bus lock
* - shift and mask the UDI number to its bit position of [22:25]
* - add the DCR base address to the UDI number and perform the read
* - release DCR bus lock
* - restore MSR
* - return value read
*
*******************************************************************************/
inline u32 XIo_DcrReadAPUUDIReg(u32 DcrBase, u32 UDInum)
{
u32 rVal;
u32 oldMSR = mfmsr();
mtmsr(oldMSR & XDCR_DISABLE_EXCEPTIONS);
XIo_DcrLock(DcrBase);
switch (DcrBase) {
case XDCR_0_BASEADDR:
mtdcr(XDCR_0_BASEADDR | XDCR_APU_UDI, (((UDInum) << 6) & 0x000003c0) | 0x00000030);
rVal = mfdcr(XDCR_0_BASEADDR | XDCR_APU_UDI);
break;
case XDCR_1_BASEADDR:
mtdcr(XDCR_1_BASEADDR | XDCR_APU_UDI, (((UDInum) << 6) & 0x000003c0) | 0x00000030);
rVal = mfdcr(XDCR_1_BASEADDR | XDCR_APU_UDI);
break;
case XDCR_2_BASEADDR:
mtdcr(XDCR_2_BASEADDR | XDCR_APU_UDI, (((UDInum) << 6) & 0x000003c0) | 0x00000030);
rVal = mfdcr(XDCR_2_BASEADDR | XDCR_APU_UDI);
break;
case XDCR_3_BASEADDR:
mtdcr(XDCR_3_BASEADDR | XDCR_APU_UDI, (((UDInum) << 6) & 0x000003c0) | 0x00000030);
rVal = mfdcr(XDCR_3_BASEADDR | XDCR_APU_UDI);
break;
default:
mtdcr(XDCR_0_BASEADDR | XDCR_APU_UDI, (((UDInum) << 6) & 0x000003c0) | 0x00000030);
rVal = mfdcr(XDCR_0_BASEADDR | XDCR_APU_UDI);
break;
}
XIo_DcrUnlock(DcrBase);
mtmsr(oldMSR);
return (rVal);
}
开发者ID:aalonso,项目名称:xilinx-ml507-updated,代码行数:70,代码来源:xio_dcr.c
示例7: fsl_emb_start
static int fsl_emb_start(struct op_counter_config *ctr)
{
int i;
mtmsr(mfmsr() | MSR_PMM);
for (i = 0; i < num_counters; ++i) {
if (ctr[i].enabled) {
ctr_write(i, reset_value[i]);
/* Set each enabled counter to only
* count when the Mark bit is *not* set */
set_pmc_marked(i, 1, 0);
pmc_start_ctr(i, 1);
} else {
ctr_write(i, 0);
/* Set the ctr to be stopped */
pmc_start_ctr(i, 0);
}
}
/* Clear the freeze bit, and enable the interrupt.
* The counters won't actually start until the rfi clears
* the PMM bit */
pmc_start_ctrs(1);
oprofile_running = 1;
pr_debug("start on cpu %d, pmgc0 %x\n", smp_processor_id(),
mfpmr(PMRN_PMGC0));
return 0;
}
开发者ID:mikuhatsune001,项目名称:linux2.6.32,代码行数:33,代码来源:op_model_fsl_emb.c
示例8: fsl_emb_handle_interrupt
static void fsl_emb_handle_interrupt(struct pt_regs *regs,
struct op_counter_config *ctr)
{
unsigned long pc;
int is_kernel;
int val;
int i;
pc = regs->nip;
is_kernel = is_kernel_addr(pc);
for (i = 0; i < num_counters; ++i) {
val = ctr_read(i);
if (val < 0) {
if (oprofile_running && ctr[i].enabled) {
oprofile_add_ext_sample(pc, regs, i, is_kernel);
ctr_write(i, reset_value[i]);
} else {
ctr_write(i, 0);
}
}
}
/* The freeze bit was set by the interrupt. */
/* Clear the freeze bit, and reenable the interrupt. The
* counters won't actually start until the rfi clears the PMM
* bit. The PMM bit should not be set until after the interrupt
* is cleared to avoid it getting lost in some hypervisor
* environments.
*/
mtmsr(mfmsr() | MSR_PMM);
pmc_start_ctrs(1);
}
开发者ID:007kumarraja,项目名称:rockchip-rk3188-mk908,代码行数:33,代码来源:op_model_fsl_emb.c
示例9: enable_vec
void
enable_vec(struct thread *td)
{
int msr;
struct pcb *pcb;
struct trapframe *tf;
pcb = td->td_pcb;
tf = trapframe(td);
/*
* Save the thread's Altivec CPU number, and set the CPU's current
* vector thread
*/
td->td_pcb->pcb_veccpu = PCPU_GET(cpuid);
PCPU_SET(vecthread, td);
/*
* Enable the vector unit for when the thread returns from the
* exception. If this is the first time the unit has been used by
* the thread, initialise the vector registers and VSCR to 0, and
* set the flag to indicate that the vector unit is in use.
*/
tf->srr1 |= PSL_VEC;
if (!(pcb->pcb_flags & PCB_VEC)) {
memset(&pcb->pcb_vec, 0, sizeof pcb->pcb_vec);
pcb->pcb_flags |= PCB_VEC;
}
/*
* Temporarily enable the vector unit so the registers
* can be restored.
*/
msr = mfmsr();
mtmsr(msr | PSL_VEC);
isync();
/*
* Restore VSCR by first loading it into a vector and then into VSCR.
* (this needs to done before loading the user's vector registers
* since we need to use a scratch vector register)
*/
__asm __volatile("vxor 0,0,0; lvewx 0,0,%0; mtvscr 0" \
:: "b"(&pcb->pcb_vec.vscr));
#define LVX(n) __asm ("lvx " #n ",0,%0" \
:: "b"(&pcb->pcb_vec.vr[n]));
LVX(0); LVX(1); LVX(2); LVX(3);
LVX(4); LVX(5); LVX(6); LVX(7);
LVX(8); LVX(9); LVX(10); LVX(11);
LVX(12); LVX(13); LVX(14); LVX(15);
LVX(16); LVX(17); LVX(18); LVX(19);
LVX(20); LVX(21); LVX(22); LVX(23);
LVX(24); LVX(25); LVX(26); LVX(27);
LVX(28); LVX(29); LVX(30); LVX(31);
#undef LVX
isync();
mtmsr(msr);
}
开发者ID:2asoft,项目名称:freebsd,代码行数:60,代码来源:altivec.c
示例10: do_reset
int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
/* Everything after the first generation of PQ3 parts has RSTCR */
#if defined(CONFIG_MPC8540) || defined(CONFIG_MPC8541) || \
defined(CONFIG_MPC8555) || defined(CONFIG_MPC8560)
unsigned long val, msr;
/*
* Initiate hard reset in debug control register DBCR0
* Make sure MSR[DE] = 1. This only resets the core.
*/
msr = mfmsr ();
msr |= MSR_DE;
mtmsr (msr);
val = mfspr(DBCR0);
val |= 0x70000000;
mtspr(DBCR0,val);
#else
volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
out_be32(&gur->rstcr, 0x2); /* HRESET_REQ */
udelay(100);
#endif
return 1;
}
开发者ID:CTSRD-CHERI,项目名称:u-boot,代码行数:26,代码来源:cpu.c
示例11: opal_check
int
opal_check(void)
{
phandle_t opal;
cell_t val[2];
if (opal_initialized)
return (0);
opal = OF_finddevice("/ibm,opal");
if (opal == -1)
return (ENOENT);
if (!OF_hasprop(opal, "opal-base-address") ||
!OF_hasprop(opal, "opal-entry-address"))
return (ENOENT);
OF_getencprop(opal, "opal-base-address", val, sizeof(val));
opal_data = ((uint64_t)val[0] << 32) | val[1];
OF_getencprop(opal, "opal-entry-address", val, sizeof(val));
opal_entrypoint = ((uint64_t)val[0] << 32) | val[1];
opal_msr = mfmsr() & ~(PSL_EE | PSL_IR | PSL_DR | PSL_SE);
opal_initialized = 1;
return (0);
}
开发者ID:FreeBSDFoundation,项目名称:freebsd,代码行数:28,代码来源:opal.c
示例12: rtaspci_attach
static int
rtaspci_attach(device_t dev)
{
struct rtaspci_softc *sc;
sc = device_get_softc(dev);
sc->read_pci_config = rtas_token_lookup("read-pci-config");
sc->write_pci_config = rtas_token_lookup("write-pci-config");
sc->ex_read_pci_config = rtas_token_lookup("ibm,read-pci-config");
sc->ex_write_pci_config = rtas_token_lookup("ibm,write-pci-config");
sc->sc_extended_config = 0;
OF_getprop(ofw_bus_get_node(dev), "ibm,pci-config-space-type",
&sc->sc_extended_config, sizeof(sc->sc_extended_config));
bus_dma_tag_create(bus_get_dma_tag(dev),
1, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR,
NULL, NULL, BUS_SPACE_MAXSIZE, BUS_SPACE_UNRESTRICTED,
BUS_SPACE_MAXSIZE, 0, NULL, NULL, &sc->dma_tag);
#ifdef __powerpc64__
if (!(mfmsr() & PSL_HV))
phyp_iommu_set_dma_tag(dev, dev, sc->dma_tag);
#endif
return (ofw_pci_attach(dev));
}
开发者ID:ChaosJohn,项目名称:freebsd,代码行数:27,代码来源:rtas_pci.c
示例13: chrp_attach
static int
chrp_attach(platform_t plat)
{
#ifdef __powerpc64__
/* XXX: check for /rtas/ibm,hypertas-functions? */
if (!(mfmsr() & PSL_HV)) {
struct mem_region *phys, *avail;
int nphys, navail;
mem_regions(&phys, &nphys, &avail, &navail);
realmaxaddr = phys[0].mr_size;
pmap_mmu_install("mmu_phyp", BUS_PROBE_SPECIFIC);
cpu_idle_hook = phyp_cpu_idle;
/* Set up important VPA fields */
bzero(splpar_vpa, sizeof(splpar_vpa));
splpar_vpa[4] = (uint8_t)((sizeof(splpar_vpa) >> 8) & 0xff);
splpar_vpa[5] = (uint8_t)(sizeof(splpar_vpa) & 0xff);
splpar_vpa[0xba] = 1; /* Maintain FPRs */
splpar_vpa[0xbb] = 1; /* Maintain PMCs */
splpar_vpa[0xfc] = 0xff; /* Maintain full SLB */
splpar_vpa[0xfd] = 0xff;
splpar_vpa[0xff] = 1; /* Maintain Altivec */
mb();
/* Set up hypervisor CPU stuff */
chrp_smp_ap_init(plat);
}
#endif
/* Some systems (e.g. QEMU) need Open Firmware to stand down */
ofw_quiesce();
return (0);
}
开发者ID:OpenKod,项目名称:src,代码行数:35,代码来源:platform_chrp.c
示例14: power4_start
static int power4_start(struct op_counter_config *ctr)
{
int i;
unsigned int mmcr0;
mtmsrd(mfmsr() | MSR_PMM);
for (i = 0; i < cur_cpu_spec->num_pmcs; ++i) {
if (ctr[i].enabled) {
classic_ctr_write(i, reset_value[i]);
} else {
classic_ctr_write(i, 0);
}
}
mmcr0 = mfspr(SPRN_MMCR0);
mmcr0 &= ~MMCR0_PMAO;
mmcr0 &= ~MMCR0_FC;
mtspr(SPRN_MMCR0, mmcr0);
oprofile_running = 1;
dbg("start on cpu %d, mmcr0 %x\n", smp_processor_id(), mmcr0);
return 0;
}
开发者ID:Blackburn29,项目名称:PsycoKernel,代码行数:28,代码来源:op_model_power4.c
示例15: smp_85xx_mach_cpu_die
static void __cpuinit smp_85xx_mach_cpu_die(void)
{
unsigned int cpu = smp_processor_id();
u32 tmp;
local_irq_disable();
idle_task_exit();
generic_set_cpu_dead(cpu);
mb();
mtspr(SPRN_TCR, 0);
__flush_disable_L1();
tmp = (mfspr(SPRN_HID0) & ~(HID0_DOZE|HID0_SLEEP)) | HID0_NAP;
mtspr(SPRN_HID0, tmp);
isync();
/* Enter NAP mode. */
tmp = mfmsr();
tmp |= MSR_WE;
mb();
mtmsr(tmp);
isync();
while (1)
;
}
开发者ID:AllenDou,项目名称:linux,代码行数:27,代码来源:smp.c
示例16: fsl7450_handle_interrupt
static void fsl7450_handle_interrupt(struct pt_regs *regs,
struct op_counter_config *ctr)
{
unsigned long pc;
int is_kernel;
int val;
int i;
/* */
mtmsr(mfmsr() | MSR_PMM);
pc = mfspr(SPRN_SIAR);
is_kernel = is_kernel_addr(pc);
for (i = 0; i < num_pmcs; ++i) {
val = classic_ctr_read(i);
if (val < 0) {
if (oprofile_running && ctr[i].enabled) {
oprofile_add_ext_sample(pc, regs, i, is_kernel);
classic_ctr_write(i, reset_value[i]);
} else {
classic_ctr_write(i, 0);
}
}
}
/* */
/*
*/
pmc_start_ctrs();
}
开发者ID:romanbb,项目名称:android_kernel_lge_d851,代码行数:32,代码来源:op_model_7450.c
示例17: powerpc_interrupt
/*
* A very short dispatch, to try and maximise assembler code use
* between all exception types. Maybe 'true' interrupts should go
* here, and the trap code can come in separately
*/
void
powerpc_interrupt(struct trapframe *framep)
{
struct thread *td;
struct clockframe ckframe;
td = curthread;
switch (framep->exc) {
case EXC_EXI:
atomic_add_int(&td->td_intr_nesting_level, 1);
(*powerpc_extintr_handler)();
atomic_subtract_int(&td->td_intr_nesting_level, 1);
break;
case EXC_DECR:
atomic_add_int(&td->td_intr_nesting_level, 1);
ckframe.srr0 = framep->srr0;
ckframe.srr1 = framep->srr1;
decr_intr(&ckframe);
atomic_subtract_int(&td->td_intr_nesting_level, 1);
break;
default:
/*
* Re-enable interrupts and call the generic trap code
*/
#if 0
printf("powerpc_interrupt: got trap\n");
#endif
mtmsr(mfmsr() | PSL_EE);
isync();
trap(framep);
}
}
开发者ID:MarginC,项目名称:kame,代码行数:40,代码来源:interrupt.c
示例18: sys_arch_protect
/*
* This optional function does a "fast" critical region protection and returns
* the previous protection level. This function is only called during very short
* critical regions. An embedded system which supports ISR-based drivers might
* want to implement this function by disabling interrupts. Task-based systems
* might want to implement this by using a mutex or disabling tasking. This
* function should support recursive calls from the same task or interrupt. In
* other words, sys_arch_protect() could be called while already protected. In
* that case the return value indicates that it is already protected.
* sys_arch_protect() is only required if your port is supporting an operating
* system.
*/
sys_prot_t
sys_arch_protect()
{
sys_prot_t cur;
#ifdef __MICROBLAZE__
cur = mfmsr();
mtmsr(cur & ~0x2);
#elif __PPC__
cur = mfmsr();
mtmsr(cur & ~XEXC_ALL);
#elif __arm__
cur = mfcpsr();
mtcpsr(cur & ~XIL_EXCEPTION_IRQ);
#endif
return cur;
}
开发者ID:ghjh31531,项目名称:BPM_acquisition,代码行数:28,代码来源:sys_arch_raw.c
示例19: PpcGetInterruptState
BOOLEAN
EFIAPI
PpcGetInterruptState (
VOID
)
{
return (mfmsr() & MSR_EE) != 0;
}
开发者ID:ozbenh,项目名称:edk2,代码行数:8,代码来源:Ppc64Lib.c
示例20: cpu_halt
/* Shutdown the CPU as much as possible. */
void
cpu_halt(void)
{
mtmsr(mfmsr() & ~(PSL_CE | PSL_EE | PSL_ME | PSL_DE));
while (1)
;
}
开发者ID:cyrilmagsuci,项目名称:freebsd,代码行数:9,代码来源:booke_machdep.c
注:本文中的mfmsr函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论