| .. | .. |
|---|
| 1 | | -/* SPDX-License-Identifier: GPL-2.0 */ |
|---|
| 1 | +/* SPDX-License-Identifier: MIT */ |
|---|
| 2 | 2 | #ifndef __NVIF_OBJECT_H__ |
|---|
| 3 | 3 | #define __NVIF_OBJECT_H__ |
|---|
| 4 | | - |
|---|
| 5 | 4 | #include <nvif/os.h> |
|---|
| 6 | 5 | |
|---|
| 7 | 6 | struct nvif_sclass { |
|---|
| .. | .. |
|---|
| 11 | 10 | }; |
|---|
| 12 | 11 | |
|---|
| 13 | 12 | struct nvif_object { |
|---|
| 13 | + struct nvif_parent *parent; |
|---|
| 14 | 14 | struct nvif_client *client; |
|---|
| 15 | + const char *name; |
|---|
| 15 | 16 | u32 handle; |
|---|
| 16 | 17 | s32 oclass; |
|---|
| 17 | 18 | void *priv; /*XXX: hack */ |
|---|
| .. | .. |
|---|
| 21 | 22 | } map; |
|---|
| 22 | 23 | }; |
|---|
| 23 | 24 | |
|---|
| 24 | | -int nvif_object_init(struct nvif_object *, u32 handle, s32 oclass, void *, u32, |
|---|
| 25 | | - struct nvif_object *); |
|---|
| 26 | | -void nvif_object_fini(struct nvif_object *); |
|---|
| 25 | +int nvif_object_ctor(struct nvif_object *, const char *name, u32 handle, |
|---|
| 26 | + s32 oclass, void *, u32, struct nvif_object *); |
|---|
| 27 | +void nvif_object_dtor(struct nvif_object *); |
|---|
| 27 | 28 | int nvif_object_ioctl(struct nvif_object *, void *, u32, void **); |
|---|
| 28 | 29 | int nvif_object_sclass_get(struct nvif_object *, struct nvif_sclass **); |
|---|
| 29 | 30 | void nvif_object_sclass_put(struct nvif_sclass **); |
|---|
| .. | .. |
|---|
| 115 | 116 | _cid; \ |
|---|
| 116 | 117 | }) |
|---|
| 117 | 118 | |
|---|
| 119 | +#define NVIF_RD32_(p,o,dr) nvif_rd32((p), (o) + (dr)) |
|---|
| 120 | +#define NVIF_WR32_(p,o,dr,f) nvif_wr32((p), (o) + (dr), (f)) |
|---|
| 121 | +#define NVIF_RD32(p,A...) DRF_RD(NVIF_RD32_, (p), 0, ##A) |
|---|
| 122 | +#define NVIF_RV32(p,A...) DRF_RV(NVIF_RD32_, (p), 0, ##A) |
|---|
| 123 | +#define NVIF_TV32(p,A...) DRF_TV(NVIF_RD32_, (p), 0, ##A) |
|---|
| 124 | +#define NVIF_TD32(p,A...) DRF_TD(NVIF_RD32_, (p), 0, ##A) |
|---|
| 125 | +#define NVIF_WR32(p,A...) DRF_WR( NVIF_WR32_, (p), 0, ##A) |
|---|
| 126 | +#define NVIF_WV32(p,A...) DRF_WV( NVIF_WR32_, (p), 0, ##A) |
|---|
| 127 | +#define NVIF_WD32(p,A...) DRF_WD( NVIF_WR32_, (p), 0, ##A) |
|---|
| 128 | +#define NVIF_MR32(p,A...) DRF_MR(NVIF_RD32_, NVIF_WR32_, u32, (p), 0, ##A) |
|---|
| 129 | +#define NVIF_MV32(p,A...) DRF_MV(NVIF_RD32_, NVIF_WR32_, u32, (p), 0, ##A) |
|---|
| 130 | +#define NVIF_MD32(p,A...) DRF_MD(NVIF_RD32_, NVIF_WR32_, u32, (p), 0, ##A) |
|---|
| 131 | + |
|---|
| 118 | 132 | /*XXX*/ |
|---|
| 119 | 133 | #include <core/object.h> |
|---|
| 120 | 134 | #define nvxx_object(a) ({ \ |
|---|