libmetal
lib
processor
microblaze
cpu.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2017, Xilinx Inc. and Contributors. All rights reserved.
3
*
4
* SPDX-License-Identifier: BSD-3-Clause
5
*/
6
7
/*
8
* @file cpu.h
9
* @brief CPU specific primatives on microblaze platform.
10
*/
11
12
#ifndef __METAL_MICROBLAZE__H__
13
#define __METAL_MICROBLAZE__H__
14
15
#include <stdint.h>
16
#include <metal/atomic.h>
17
18
#define metal_cpu_yield()
19
20
static
inline
void
metal_processor_io_write64
(
void
*ptr, uint64_t value,
21
memory_order
order)
22
{
23
void
*tmp = &value;
24
25
atomic_store_explicit
((
atomic_ulong
*)ptr, *((
atomic_ulong
*)tmp), order);
26
tmp +=
sizeof
(
atomic_ulong
);
27
ptr +=
sizeof
(
atomic_ulong
);
28
atomic_store_explicit
((
atomic_ulong
*)ptr, *((
atomic_ulong
*)tmp), order);
29
}
30
31
static
inline
uint64_t
metal_processor_io_read64
(
void
*ptr,
memory_order
order)
32
{
33
uint64_t long_ret;
34
void
*tmp = &long_ret;
35
36
*((
atomic_ulong
*)tmp) =
atomic_load_explicit
((
atomic_ulong
*)ptr, order);
37
tmp +=
sizeof
(
atomic_ulong
);
38
ptr +=
sizeof
(
atomic_ulong
);
39
*((
atomic_ulong
*)tmp) =
atomic_load_explicit
((
atomic_ulong
*)ptr, order);
40
41
return
long_ret;
42
}
43
44
#endif
/* __METAL_MICROBLAZE__H__ */
atomic_store_explicit
#define atomic_store_explicit(OBJ, VAL, MO)
Definition:
atomic.h:57
atomic_load_explicit
#define atomic_load_explicit(OBJ, MO)
Definition:
atomic.h:61
metal_processor_io_read64
static uint64_t metal_processor_io_read64(void *ptr, memory_order order)
Definition:
cpu.h:31
atomic_ulong
unsigned long atomic_ulong
Definition:
atomic.h:27
memory_order
memory_order
Definition:
atomic.h:34
metal_processor_io_write64
static void metal_processor_io_write64(void *ptr, uint64_t value, memory_order order)
Definition:
cpu.h:20
Generated on Mon Jul 9 2018 00:00:00 for libmetal by
1.8.16