RTEMS: bsps/powerpc/qoriq/include/bsp/intercom.h Source File

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
intercom.h
Go to the documentation of this file.
1
9/*
10 * Copyright (c) 2011 embedded brains GmbH. All rights reserved.
11 *
12 * embedded brains GmbH
13 * Obere Lagerstr. 30
14 * 82178 Puchheim
15 * Germany
16 * <rtems@embedded-brains.de>
17 *
18 * The license and distribution terms for this file may be
19 * found in the file LICENSE in this distribution or at
20 * http://www.rtems.org/license/LICENSE.
21 */
22
23#ifndef LIBBSP_POWERPC_QORIQ_INTERCOM_H
24#define LIBBSP_POWERPC_QORIQ_INTERCOM_H
25
26#include <rtems.h>
27#include <rtems/chain.h>
28
29#ifdef __cplusplus
30extern "C" {
31#endif /* __cplusplus */
32
43uint32_t qoriq_spin_lock(uint32_t *lock);
44
45void qoriq_spin_unlock(uint32_t *lock, uint32_t msr);
46
47#define INTERCOM_CORE_COUNT 2
48
49#define INTERCOM_SERVICE_COUNT 8
50
51typedef enum {
52 INTERCOM_TYPE_MPCI,
53 INTERCOM_TYPE_UART_0,
54 INTERCOM_TYPE_UART_1,
55 INTERCOM_TYPE_NETWORK,
56 INTERCOM_TYPE_CUSTOM_0,
57 INTERCOM_TYPE_CUSTOM_1,
58 INTERCOM_TYPE_CUSTOM_2,
59 INTERCOM_TYPE_CUSTOM_3,
60 INTERCOM_TYPE_CUSTOM_4
61} intercom_type;
62
63typedef enum {
64 INTERCOM_SIZE_64 = 0,
65 INTERCOM_SIZE_512,
66 INTERCOM_SIZE_2K,
67 INTERCOM_SIZE_4K
68} intercom_size;
69
70 typedef struct intercom_packet {
71 union {
72 struct intercom_packet *next;
73 rtems_chain_node node;
74 } glue;
75 intercom_type type_index;
76 intercom_size size_index;
77 uint32_t flags;
78 size_t size;
79 uint32_t cache_line_alignment [2];
80 char data [];
81} intercom_packet;
82
83typedef void (*intercom_service)(intercom_packet *packet, void *arg);
84
85void qoriq_intercom_init(void);
86
87void qoriq_intercom_start(void);
88
89void qoriq_intercom_service_install(intercom_type type, intercom_service service, void *arg);
90
91void qoriq_intercom_service_remove(intercom_type type);
92
93 intercom_packet *qoriq_intercom_allocate_packet(intercom_type type, intercom_size size);
94
95void qoriq_intercom_send_packets(int destination_core, intercom_packet *first, intercom_packet *last);
96
97static inline void qoriq_intercom_send_packet(int destination_core, intercom_packet *packet)
98{
99 qoriq_intercom_send_packets(destination_core, packet, packet);
100}
101
102void qoriq_intercom_broadcast_packets(intercom_packet *first, intercom_packet *last);
103
104static inline void qoriq_intercom_broadcast_packet(intercom_packet *packet)
105{
106 qoriq_intercom_broadcast_packets(packet, packet);
107}
108
109void qoriq_intercom_send(int destination_core, intercom_type type, intercom_size size, const void *buf, size_t n);
110
111void qoriq_intercom_free_packet(intercom_packet *packet);
112
113 intercom_packet *qoriq_intercom_clone_packet(const intercom_packet *packet);
114
115#ifdef RTEMS_MULTIPROCESSING
116 extern rtems_mpci_table qoriq_intercom_mpci;
117#endif
118
121#ifdef __cplusplus
122}
123#endif /* __cplusplus */
124
125#endif /* LIBBSP_POWERPC_QORIQ_INTERCOM_H */
chain.h
Chain API.
rtems.h
Chain_Node_struct
Definition: chain.h:68
intercom_packet
Definition: intercom.h:70
packet
Definition: demand.c:51