hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/arch/mips/include/asm/sn/addrs.h
....@@ -27,16 +27,11 @@
2727
2828 #ifndef __ASSEMBLY__
2929
30
-#define PS_UINT_CAST (unsigned long)
3130 #define UINT64_CAST (unsigned long)
32
-
33
-#define HUBREG_CAST (volatile hubreg_t *)
3431
3532 #else /* __ASSEMBLY__ */
3633
37
-#define PS_UINT_CAST
3834 #define UINT64_CAST
39
-#define HUBREG_CAST
4035
4136 #endif /* __ASSEMBLY__ */
4237
....@@ -256,40 +251,21 @@
256251 * Otherwise, the recommended approach is to use *_HUB_L() and *_HUB_S().
257252 * They're always safe.
258253 */
259
-#define LOCAL_HUB_ADDR(_x) (HUBREG_CAST (IALIAS_BASE + (_x)))
260
-#define REMOTE_HUB_ADDR(_n, _x) (HUBREG_CAST (NODE_SWIN_BASE(_n, 1) + \
261
- 0x800000 + (_x)))
262
-#ifdef CONFIG_SGI_IP27
263
-#define REMOTE_HUB_PI_ADDR(_n, _sn, _x) (HUBREG_CAST (NODE_SWIN_BASE(_n, 1) + \
264
- 0x800000 + (_x)))
265
-#endif /* CONFIG_SGI_IP27 */
254
+#define LOCAL_HUB_ADDR(_x) (IALIAS_BASE + (_x))
255
+#define REMOTE_HUB_ADDR(_n, _x) ((NODE_SWIN_BASE(_n, 1) + 0x800000 + (_x)))
266256
267257 #ifndef __ASSEMBLY__
268258
269
-#define HUB_L(_a) *(_a)
270
-#define HUB_S(_a, _d) *(_a) = (_d)
259
+#define LOCAL_HUB_PTR(_x) ((u64 *)LOCAL_HUB_ADDR((_x)))
260
+#define REMOTE_HUB_PTR(_n, _x) ((u64 *)REMOTE_HUB_ADDR((_n), (_x)))
271261
272
-#define LOCAL_HUB_L(_r) HUB_L(LOCAL_HUB_ADDR(_r))
273
-#define LOCAL_HUB_S(_r, _d) HUB_S(LOCAL_HUB_ADDR(_r), (_d))
274
-#define REMOTE_HUB_L(_n, _r) HUB_L(REMOTE_HUB_ADDR((_n), (_r)))
275
-#define REMOTE_HUB_S(_n, _r, _d) HUB_S(REMOTE_HUB_ADDR((_n), (_r)), (_d))
276
-#define REMOTE_HUB_PI_L(_n, _sn, _r) HUB_L(REMOTE_HUB_PI_ADDR((_n), (_sn), (_r)))
277
-#define REMOTE_HUB_PI_S(_n, _sn, _r, _d) HUB_S(REMOTE_HUB_PI_ADDR((_n), (_sn), (_r)), (_d))
262
+#define LOCAL_HUB_L(_r) __raw_readq(LOCAL_HUB_PTR(_r))
263
+#define LOCAL_HUB_S(_r, _d) __raw_writeq((_d), LOCAL_HUB_PTR(_r))
264
+#define REMOTE_HUB_L(_n, _r) __raw_readq(REMOTE_HUB_PTR((_n), (_r)))
265
+#define REMOTE_HUB_S(_n, _r, _d) __raw_writeq((_d), \
266
+ REMOTE_HUB_PTR((_n), (_r)))
278267
279268 #endif /* !__ASSEMBLY__ */
280
-
281
-/*
282
- * The following macros are used to get to a hub/bridge register, given
283
- * the base of the register space.
284
- */
285
-#define HUB_REG_PTR(_base, _off) \
286
- (HUBREG_CAST((__psunsigned_t)(_base) + (__psunsigned_t)(_off)))
287
-
288
-#define HUB_REG_PTR_L(_base, _off) \
289
- HUB_L(HUB_REG_PTR((_base), (_off)))
290
-
291
-#define HUB_REG_PTR_S(_base, _off, _data) \
292
- HUB_S(HUB_REG_PTR((_base), (_off)), (_data))
293269
294270 /*
295271 * Software structure locations -- permanently fixed
....@@ -387,43 +363,13 @@
387363
388364 #define SYMMON_STK_END(nasid) (SYMMON_STK_ADDR(nasid, 0) + KLD_SYMMON_STK(nasid)->size)
389365
390
-/* loading symmon 4k below UNIX. the arcs loader needs the topaddr for a
391
- * relocatable program
392
- */
393
-#define UNIX_DEBUG_LOADADDR 0x300000
394
-#define SYMMON_LOADADDR(nasid) \
395
- TO_NODE(nasid, PHYS_TO_K0(UNIX_DEBUG_LOADADDR - 0x1000))
396
-
397
-#define FREEMEM_OFFSET(nasid) KLD_FREEMEM(nasid)->offset
398
-#define FREEMEM_ADDR(nasid) SYMMON_STK_END(nasid)
399
-/*
400
- * XXX
401
- * Fix this. FREEMEM_ADDR should be aware of if symmon is loaded.
402
- * Also, it should take into account what prom thinks to be a safe
403
- * address
404
- PHYS_TO_K0(NODE_OFFSET(nasid) + FREEMEM_OFFSET(nasid))
405
- */
406
-#define FREEMEM_SIZE(nasid) KLD_FREEMEM(nasid)->size
407
-
408
-#define PI_ERROR_OFFSET(nasid) KLD_PI_ERROR(nasid)->offset
409
-#define PI_ERROR_ADDR(nasid) \
410
- TO_NODE_UNCAC((nasid), PI_ERROR_OFFSET(nasid))
411
-#define PI_ERROR_SIZE(nasid) KLD_PI_ERROR(nasid)->size
412
-
413366 #define NODE_OFFSET_TO_K0(_nasid, _off) \
414367 PHYS_TO_K0((NODE_OFFSET(_nasid) + (_off)) | CAC_BASE)
415368 #define NODE_OFFSET_TO_K1(_nasid, _off) \
416369 TO_UNCAC((NODE_OFFSET(_nasid) + (_off)) | UNCAC_BASE)
417
-#define K0_TO_NODE_OFFSET(_k0addr) \
418
- ((__psunsigned_t)(_k0addr) & NODE_ADDRSPACE_MASK)
419370
420371 #define KERN_VARS_ADDR(nasid) KLD_KERN_VARS(nasid)->pointer
421372 #define KERN_VARS_SIZE(nasid) KLD_KERN_VARS(nasid)->size
422
-
423
-#define KERN_XP_ADDR(nasid) KLD_KERN_XP(nasid)->pointer
424
-#define KERN_XP_SIZE(nasid) KLD_KERN_XP(nasid)->size
425
-
426
-#define GPDA_ADDR(nasid) TO_NODE_CAC(nasid, GPDA_OFFSET)
427373
428374 #endif /* !__ASSEMBLY__ */
429375