Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright © 2017 Intel Corporation
0003  *
0004  * Permission is hereby granted, free of charge, to any person obtaining a
0005  * copy of this software and associated documentation files (the "Software"),
0006  * to deal in the Software without restriction, including without limitation
0007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
0008  * and/or sell copies of the Software, and to permit persons to whom the
0009  * Software is furnished to do so, subject to the following conditions:
0010  *
0011  * The above copyright notice and this permission notice (including the next
0012  * paragraph) shall be included in all copies or substantial portions of the
0013  * Software.
0014  *
0015  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0016  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0017  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
0018  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
0019  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
0020  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
0021  * IN THE SOFTWARE.
0022  *
0023  */
0024 
0025 #include "mock_uncore.h"
0026 
0027 #define __nop_write(x) \
0028 static void \
0029 nop_write##x(struct intel_uncore *uncore, i915_reg_t reg, u##x val, bool trace) { }
0030 __nop_write(8)
0031 __nop_write(16)
0032 __nop_write(32)
0033 
0034 #define __nop_read(x) \
0035 static u##x \
0036 nop_read##x(struct intel_uncore *uncore, i915_reg_t reg, bool trace) { return 0; }
0037 __nop_read(8)
0038 __nop_read(16)
0039 __nop_read(32)
0040 __nop_read(64)
0041 
0042 void mock_uncore_init(struct intel_uncore *uncore,
0043               struct drm_i915_private *i915)
0044 {
0045     intel_uncore_init_early(uncore, to_gt(i915));
0046 
0047     ASSIGN_RAW_WRITE_MMIO_VFUNCS(uncore, nop);
0048     ASSIGN_RAW_READ_MMIO_VFUNCS(uncore, nop);
0049 }