eal/windows: implement basic memory management
[dpdk.git] / lib / librte_eal / windows / eal_mp.c
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (c) 2020 Dmitry Kozlyuk
3  */
4
5 /**
6  * @file Multiprocess support stubs
7  *
8  * Stubs must log an error until implemented. If success is required
9  * for non-multiprocess operation, stub must log a warning and a comment
10  * must document what requires success emulation.
11  */
12
13 #include <rte_eal.h>
14 #include <rte_errno.h>
15
16 #include "eal_private.h"
17 #include "eal_windows.h"
18 #include "malloc_mp.h"
19
20 void
21 rte_mp_channel_cleanup(void)
22 {
23         EAL_LOG_NOT_IMPLEMENTED();
24 }
25
26 int
27 rte_mp_action_register(const char *name, rte_mp_t action)
28 {
29         RTE_SET_USED(name);
30         RTE_SET_USED(action);
31         EAL_LOG_NOT_IMPLEMENTED();
32         return -1;
33 }
34
35 void
36 rte_mp_action_unregister(const char *name)
37 {
38         RTE_SET_USED(name);
39         EAL_LOG_NOT_IMPLEMENTED();
40 }
41
42 int
43 rte_mp_sendmsg(struct rte_mp_msg *msg)
44 {
45         RTE_SET_USED(msg);
46         EAL_LOG_NOT_IMPLEMENTED();
47         return -1;
48 }
49
50 int
51 rte_mp_request_sync(struct rte_mp_msg *req, struct rte_mp_reply *reply,
52         const struct timespec *ts)
53 {
54         RTE_SET_USED(req);
55         RTE_SET_USED(reply);
56         RTE_SET_USED(ts);
57         EAL_LOG_NOT_IMPLEMENTED();
58         return -1;
59 }
60
61 int
62 rte_mp_request_async(struct rte_mp_msg *req, const struct timespec *ts,
63                 rte_mp_async_reply_t clb)
64 {
65         RTE_SET_USED(req);
66         RTE_SET_USED(ts);
67         RTE_SET_USED(clb);
68         EAL_LOG_NOT_IMPLEMENTED();
69         return -1;
70 }
71
72 int
73 rte_mp_reply(struct rte_mp_msg *msg, const char *peer)
74 {
75         RTE_SET_USED(msg);
76         RTE_SET_USED(peer);
77         EAL_LOG_NOT_IMPLEMENTED();
78         return -1;
79 }
80
81 int
82 register_mp_requests(void)
83 {
84         /* Non-stub function succeeds if multi-process is not supported. */
85         EAL_LOG_STUB();
86         return 0;
87 }
88
89 int
90 request_to_primary(struct malloc_mp_req *req)
91 {
92         RTE_SET_USED(req);
93         EAL_LOG_NOT_IMPLEMENTED();
94         return -1;
95 }
96
97 int
98 request_sync(void)
99 {
100         /* Common memory allocator depends on this function success. */
101         EAL_LOG_STUB();
102         return 0;
103 }