ObjFW  Diff

Differences From Artifact [965a4d4675]:

To Artifact [3babc72639]:


10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

OF_ASSUME_NONNULL_BEGIN

static OF_INLINE int
of_atomic_int_add(volatile int *_Nonnull p, int i)
{
	__asm__ __volatile__ (
	    "0:\n\t"
	    "lwarx	%0, 0, %2\n\t"
	    "add	%0, %0, %1\n\t"







<
<







10
11
12
13
14
15
16


17
18
19
20
21
22
23
 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */



static OF_INLINE int
of_atomic_int_add(volatile int *_Nonnull p, int i)
{
	__asm__ __volatile__ (
	    "0:\n\t"
	    "lwarx	%0, 0, %2\n\t"
	    "add	%0, %0, %1\n\t"
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
	    : "cc"
	);

	return r;
}

static OF_INLINE void
of_memory_barrier_sync(void)
{
	__asm__ __volatile__ (
	    "sync" ::: "memory"
	);
}

static OF_INLINE void
of_memory_barrier_enter(void)
{
	__asm__ __volatile__ (
	    "sync" ::: "memory"
	);
}

static OF_INLINE void
of_memory_barrier_exit(void)
{
	__asm__ __volatile__ (
	    "sync" ::: "memory"
	);
}

static OF_INLINE void
of_memory_barrier_producer(void)
{
	__asm__ __volatile__ (
	    "sync" ::: "memory"
	);
}

static OF_INLINE void
of_memory_barrier_consumer(void)
{
	__asm__ __volatile__ (
	    "sync" ::: "memory"
	);
}

OF_ASSUME_NONNULL_END







|


|




|


|




|


|


<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382


















	    : "cc"
	);

	return r;
}

static OF_INLINE void
of_memory_barrier(void)
{
	__asm__ __volatile__ (
	    "lwsync" ::: "memory"
	);
}

static OF_INLINE void
of_memory_barrier_acquire(void)
{
	__asm__ __volatile__ (
	    "lwsync" ::: "memory"
	);
}

static OF_INLINE void
of_memory_barrier_release(void)
{
	__asm__ __volatile__ (
	    "lwsync" ::: "memory"
	);
}