@@ -92,6 +92,7 @@ use libc;
92
92
use option;
93
93
use option:: { None , Option , Some , unwrap} ;
94
94
use pipes;
95
+ use private:: intrinsics;
95
96
use ptr;
96
97
use private;
97
98
use task;
@@ -256,37 +257,26 @@ pub fn entangle_buffer<T: Owned, Tstart: Owned>(
256
257
( SendPacketBuffered ( p) , RecvPacketBuffered ( p) )
257
258
}
258
259
259
- #[ abi = "rust-intrinsic" ]
260
- #[ doc( hidden) ]
261
- extern mod rusti {
262
- fn atomic_xchg ( dst : & mut int , src : int ) -> int ;
263
- fn atomic_xchg_acq ( dst : & mut int , src : int ) -> int ;
264
- fn atomic_xchg_rel ( dst : & mut int , src : int ) -> int ;
265
-
266
- fn atomic_xadd_acq ( dst : & mut int , src : int ) -> int ;
267
- fn atomic_xsub_rel ( dst : & mut int , src : int ) -> int ;
268
- }
269
-
270
260
// If I call the rusti versions directly from a polymorphic function,
271
261
// I get link errors. This is a bug that needs investigated more.
272
262
#[ doc( hidden) ]
273
263
pub fn atomic_xchng_rel ( dst : & mut int , src : int ) -> int {
274
264
unsafe {
275
- rusti :: atomic_xchg_rel ( dst, src)
265
+ intrinsics :: atomic_xchg_rel ( dst, src)
276
266
}
277
267
}
278
268
279
269
#[ doc( hidden) ]
280
270
pub fn atomic_add_acq ( dst : & mut int , src : int ) -> int {
281
271
unsafe {
282
- rusti :: atomic_xadd_acq ( dst, src)
272
+ intrinsics :: atomic_xadd_acq ( dst, src)
283
273
}
284
274
}
285
275
286
276
#[ doc( hidden) ]
287
277
pub fn atomic_sub_rel ( dst : & mut int , src : int ) -> int {
288
278
unsafe {
289
- rusti :: atomic_xsub_rel ( dst, src)
279
+ intrinsics :: atomic_xsub_rel ( dst, src)
290
280
}
291
281
}
292
282
@@ -295,7 +285,7 @@ pub fn swap_task(dst: &mut *rust_task, src: *rust_task) -> *rust_task {
295
285
// It might be worth making both acquire and release versions of
296
286
// this.
297
287
unsafe {
298
- transmute ( rusti :: atomic_xchg ( transmute ( dst) , src as int ) )
288
+ transmute ( intrinsics :: atomic_xchg ( transmute ( dst) , src as int ) )
299
289
}
300
290
}
301
291
@@ -335,14 +325,14 @@ fn wait_event(this: *rust_task) -> *libc::c_void {
335
325
#[doc(hidden)]
336
326
fn swap_state_acq(dst: &mut State, src: State) -> State {
337
327
unsafe {
338
- transmute(rusti ::atomic_xchg_acq(transmute(dst), src as int))
328
+ transmute(intrinsics ::atomic_xchg_acq(transmute(dst), src as int))
339
329
}
340
330
}
341
331
342
332
#[doc(hidden)]
343
333
fn swap_state_rel(dst: &mut State, src: State) -> State {
344
334
unsafe {
345
- transmute(rusti ::atomic_xchg_rel(transmute(dst), src as int))
335
+ transmute(intrinsics ::atomic_xchg_rel(transmute(dst), src as int))
346
336
}
347
337
}
348
338
0 commit comments