Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: MIT
0002 /*
0003  * Copyright © 2018 Intel Corporation
0004  */
0005 
0006 #include <linux/preempt.h>
0007 #include <linux/bottom_half.h>
0008 #include <linux/irqflags.h>
0009 
0010 #include "igt_atomic.h"
0011 
0012 static void __preempt_begin(void)
0013 {
0014     preempt_disable();
0015 }
0016 
0017 static void __preempt_end(void)
0018 {
0019     preempt_enable();
0020 }
0021 
0022 static void __softirq_begin(void)
0023 {
0024     local_bh_disable();
0025 }
0026 
0027 static void __softirq_end(void)
0028 {
0029     local_bh_enable();
0030 }
0031 
0032 static void __hardirq_begin(void)
0033 {
0034     local_irq_disable();
0035 }
0036 
0037 static void __hardirq_end(void)
0038 {
0039     local_irq_enable();
0040 }
0041 
0042 const struct igt_atomic_section igt_atomic_phases[] = {
0043     { "preempt", __preempt_begin, __preempt_end },
0044     { "softirq", __softirq_begin, __softirq_end },
0045     { "hardirq", __hardirq_begin, __hardirq_end },
0046     { }
0047 };