mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-20 06:17:45 +07:00
drm/nouveau/device: type-safe register accessor macros
These require an explit struct nvkm_device pointer, unlike the previous macros which take a void *, and assume it's any old nvkm_subdev. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:
parent
8699745a2b
commit
dd64694208
@ -147,6 +147,20 @@ struct nvkm_device {
|
||||
struct nvkm_device *nvkm_device_find(u64 name);
|
||||
int nvkm_device_list(u64 *name, int size);
|
||||
|
||||
/* privileged register interface accessor macros */
|
||||
#define nvkm_rd08(d,a) ioread8((d)->engine.subdev.mmio + (a))
|
||||
#define nvkm_rd16(d,a) ioread16_native((d)->engine.subdev.mmio + (a))
|
||||
#define nvkm_rd32(d,a) ioread32_native((d)->engine.subdev.mmio + (a))
|
||||
#define nvkm_wr08(d,a,v) iowrite8((v), (d)->engine.subdev.mmio + (a))
|
||||
#define nvkm_wr16(d,a,v) iowrite16_native((v), (d)->engine.subdev.mmio + (a))
|
||||
#define nvkm_wr32(d,a,v) iowrite32_native((v), (d)->engine.subdev.mmio + (a))
|
||||
#define nvkm_mask(d,a,m,v) ({ \
|
||||
struct nvkm_device *_device = (d); \
|
||||
u32 _addr = (a), _temp = nvkm_rd32(_device, _addr); \
|
||||
nvkm_wr32(_device, _addr, (_temp & ~(m)) | (v)); \
|
||||
_temp; \
|
||||
})
|
||||
|
||||
struct nvkm_device *nv_device(void *obj);
|
||||
|
||||
static inline bool
|
||||
|
Loading…
Reference in New Issue
Block a user