Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151668946
D13586.id36925.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D13586.id36925.diff
View Options
Index: head/sys/mips/include/atomic.h
===================================================================
--- head/sys/mips/include/atomic.h
+++ head/sys/mips/include/atomic.h
@@ -341,24 +341,6 @@
ATOMIC_STORE_LOAD(32)
ATOMIC_STORE_LOAD(64)
-#if !defined(__mips_n64) && !defined(__mips_n32)
-void atomic_store_64(__volatile uint64_t *, uint64_t);
-uint64_t atomic_load_64(__volatile uint64_t *);
-#elif defined (__mips_n32)
-static __inline void
-atomic_store_64(__volatile uint64_t *p, uint64_t v)
-{
- *p = v;
-}
-
-static __inline uint64_t
-atomic_load_64(__volatile uint64_t *p)
-{
- return (*p);
-}
-/* #else atomic_common.h definitions of atomic_load/store_64 are used */
-#endif
-
#undef ATOMIC_STORE_LOAD
/*
Index: head/sys/mips/mips/db_interface.c
===================================================================
--- head/sys/mips/mips/db_interface.c
+++ head/sys/mips/mips/db_interface.c
@@ -152,6 +152,7 @@
/*
* 'addr' could be a memory-mapped I/O address. Try to
* do atomic load/store in unit of size requested.
+ * size == 8 is only atomic on 64bit or n32 kernel.
*/
if ((size == 2 || size == 4 || size == 8) &&
((addr & (size -1)) == 0) &&
@@ -164,8 +165,7 @@
*(uint32_t *)data = *(uint32_t *)addr;
break;
case 8:
- *(uint64_t *)data = atomic_load_64(
- (void *)addr);
+ *(uint64_t *)data = *(uint64_t *)addr;
break;
}
} else {
@@ -195,6 +195,7 @@
/*
* 'addr' could be a memory-mapped I/O address. Try to
* do atomic load/store in unit of size requested.
+ * size == 8 is only atomic on 64bit or n32 kernel.
*/
if ((size == 2 || size == 4 || size == 8) &&
((addr & (size -1)) == 0) &&
@@ -207,8 +208,7 @@
*(uint32_t *)addr = *(uint32_t *)data;
break;
case 8:
- atomic_store_64((uint64_t *)addr,
- *(uint64_t *)data);
+ *(uint64_t *)addr = *(uint64_t *)data;
break;
}
} else {
Index: head/sys/mips/mips/support.S
===================================================================
--- head/sys/mips/mips/support.S
+++ head/sys/mips/mips/support.S
@@ -839,74 +839,7 @@
nop
END(atomic_subtract_8)
-/*
- * atomic 64-bit register read/write assembly language support routines.
- */
-
.set noreorder # Noreorder is default style!
-
-#if !defined(__mips_n64) && !defined(__mips_n32)
- /*
- * I don't know if these routines have the right number of
- * NOPs in it for all processors. XXX
- *
- * Maybe it would be better to just leave this undefined in that case.
- *
- * XXX These routines are not safe in the case of a TLB miss on a1 or
- * a0 unless the trapframe is 64-bit, which it just isn't with O32.
- * If we take any exception, not just an interrupt, the upper
- * 32-bits will be clobbered. Use only N32 and N64 kernels if you
- * want to use 64-bit registers while interrupts are enabled or
- * with memory operations. Since this isn't even using load-linked
- * and store-conditional, perhaps it should just use two registers
- * instead, as is right and good with the O32 ABI.
- */
-LEAF(atomic_store_64)
- mfc0 t1, MIPS_COP_0_STATUS
- and t2, t1, ~MIPS_SR_INT_IE
- mtc0 t2, MIPS_COP_0_STATUS
- nop
- nop
- nop
- nop
- ld t0, (a1)
- nop
- nop
- sd t0, (a0)
- nop
- nop
- mtc0 t1,MIPS_COP_0_STATUS
- nop
- nop
- nop
- nop
- j ra
- nop
-END(atomic_store_64)
-
-LEAF(atomic_load_64)
- mfc0 t1, MIPS_COP_0_STATUS
- and t2, t1, ~MIPS_SR_INT_IE
- mtc0 t2, MIPS_COP_0_STATUS
- nop
- nop
- nop
- nop
- ld t0, (a0)
- nop
- nop
- sd t0, (a1)
- nop
- nop
- mtc0 t1,MIPS_COP_0_STATUS
- nop
- nop
- nop
- nop
- j ra
- nop
-END(atomic_load_64)
-#endif
#if defined(DDB) || defined(DEBUG)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 10, 9:48 PM (13 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31172919
Default Alt Text
D13586.id36925.diff (3 KB)
Attached To
Mode
D13586: Adapt assembler implementations of atomic_load_64() and atomic_store_64() on o32 mips to new calling conventions.
Attached
Detach File
Event Timeline
Log In to Comment