Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 1 | package(default_visibility = ["//visibility:public"]) |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 2 | |
| 3 | cc_library( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 4 | name = "aos_sync", |
| 5 | srcs = [ |
| 6 | "aos_sync.cc", |
| 7 | ], |
| 8 | hdrs = [ |
| 9 | "aos_sync.h", |
| 10 | ], |
| 11 | linkopts = [ |
| 12 | "-lpthread", |
| 13 | ], |
| 14 | deps = [ |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 15 | "//aos:macros", |
Brian Silverman | 16a923c | 2018-10-31 19:40:51 -0700 | [diff] [blame] | 16 | "//aos:once", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 17 | "//aos/logging", |
| 18 | "//aos/util:compiler_memory_barrier", |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 19 | ], |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 20 | ) |
| 21 | |
| 22 | cc_library( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 23 | name = "core_lib", |
| 24 | srcs = [ |
| 25 | "core_lib.c", |
| 26 | ], |
| 27 | hdrs = [ |
| 28 | "core_lib.h", |
| 29 | ], |
| 30 | deps = [ |
| 31 | ":aos_sync", |
| 32 | ":shared_mem_types", |
| 33 | ], |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 34 | ) |
| 35 | |
| 36 | cc_library( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 37 | name = "shared_mem", |
| 38 | srcs = [ |
| 39 | "shared_mem.c", |
| 40 | ], |
| 41 | hdrs = [ |
| 42 | "shared_mem.h", |
| 43 | ], |
| 44 | linkopts = [ |
| 45 | "-lrt", |
| 46 | ], |
| 47 | deps = [ |
| 48 | ":aos_sync", |
| 49 | ":core_lib", |
| 50 | ":shared_mem_types", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 51 | "//aos/logging", |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 52 | ], |
Austin Schuh | 044e18b | 2015-10-21 20:17:09 -0700 | [diff] [blame] | 53 | ) |
| 54 | |
| 55 | cc_library( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 56 | # TODO(Brian): This should be shared_mem{,.h}, and the other one should be |
| 57 | # shared_mem_init{,.cc,.h}. |
| 58 | name = "shared_mem_types", |
| 59 | hdrs = [ |
| 60 | "shared_mem_types.h", |
| 61 | ], |
| 62 | deps = [ |
| 63 | ":aos_sync", |
| 64 | ], |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 65 | ) |
| 66 | |
| 67 | cc_library( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 68 | name = "queue", |
| 69 | srcs = [ |
| 70 | "queue.cc", |
| 71 | ], |
| 72 | hdrs = [ |
| 73 | "queue.h", |
| 74 | ], |
| 75 | linkopts = [ |
| 76 | "-lrt", |
| 77 | ], |
| 78 | deps = [ |
| 79 | ":core_lib", |
| 80 | ":shared_mem", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 81 | "//aos:condition", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 82 | "//aos/logging", |
Brian Silverman | 16a923c | 2018-10-31 19:40:51 -0700 | [diff] [blame] | 83 | "//aos/mutex", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 84 | "//aos/util:options", |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 85 | ], |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 86 | ) |
| 87 | |
| 88 | cc_test( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 89 | name = "raw_queue_test", |
| 90 | srcs = [ |
| 91 | "raw_queue_test.cc", |
| 92 | ], |
| 93 | deps = [ |
| 94 | ":core_lib", |
| 95 | ":queue", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 96 | "//aos:die", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 97 | "//aos/logging", |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 98 | "//aos/testing:googletest", |
| 99 | "//aos/testing:prevent_exit", |
| 100 | "//aos/testing:test_shm", |
Brian Silverman | 16a923c | 2018-10-31 19:40:51 -0700 | [diff] [blame] | 101 | "//aos/time", |
| 102 | "//aos/util:death_test_log_implementation", |
| 103 | "//aos/util:thread", |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 104 | ], |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 105 | ) |
| 106 | |
| 107 | cc_test( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 108 | name = "ipc_stress_test", |
| 109 | srcs = [ |
| 110 | "ipc_stress_test.cc", |
| 111 | ], |
| 112 | tags = [ |
| 113 | "manual", |
| 114 | ], |
| 115 | deps = [ |
| 116 | ":core_lib", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 117 | "//aos:die", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 118 | "//aos/libc:aos_strsignal", |
| 119 | "//aos/libc:dirname", |
| 120 | "//aos/logging", |
Brian Silverman | 16a923c | 2018-10-31 19:40:51 -0700 | [diff] [blame] | 121 | "//aos/mutex", |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 122 | "//aos/testing:googletest", |
| 123 | "//aos/testing:test_shm", |
Brian Silverman | 16a923c | 2018-10-31 19:40:51 -0700 | [diff] [blame] | 124 | "//aos/time", |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 125 | ], |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 126 | ) |
| 127 | |
| 128 | cc_library( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 129 | name = "scoped_message_ptr", |
| 130 | deps = [ |
| 131 | ":queue", |
| 132 | ], |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 133 | ) |
Brian Silverman | e4d8b28 | 2015-12-24 13:44:48 -0800 | [diff] [blame] | 134 | |
| 135 | cc_binary( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 136 | name = "ipc_comparison", |
| 137 | srcs = [ |
| 138 | "ipc_comparison.cc", |
| 139 | ], |
| 140 | deps = [ |
| 141 | ":queue", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 142 | "//aos:condition", |
| 143 | "//aos:event", |
Brian Silverman | 16a923c | 2018-10-31 19:40:51 -0700 | [diff] [blame] | 144 | "//aos:init", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 145 | "//aos/logging", |
| 146 | "//aos/logging:implementations", |
Brian Silverman | 16a923c | 2018-10-31 19:40:51 -0700 | [diff] [blame] | 147 | "//aos/mutex", |
| 148 | "@com_github_gflags_gflags//:gflags", |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 149 | ], |
Brian Silverman | e4d8b28 | 2015-12-24 13:44:48 -0800 | [diff] [blame] | 150 | ) |
Austin Schuh | 6c590f8 | 2019-09-11 19:23:12 -0700 | [diff] [blame] | 151 | |
| 152 | cc_library( |
| 153 | name = "signalfd", |
| 154 | srcs = [ |
| 155 | "signalfd.cc", |
| 156 | ], |
| 157 | hdrs = [ |
| 158 | "signalfd.h", |
| 159 | ], |
| 160 | deps = [ |
| 161 | "//aos/logging", |
| 162 | ], |
| 163 | ) |
Austin Schuh | 25356e2 | 2019-09-11 19:27:07 -0700 | [diff] [blame] | 164 | |
| 165 | cc_library( |
| 166 | name = "index", |
Austin Schuh | 20b2b08 | 2019-09-11 20:42:56 -0700 | [diff] [blame] | 167 | srcs = ["index.cc"], |
Austin Schuh | 25356e2 | 2019-09-11 19:27:07 -0700 | [diff] [blame] | 168 | hdrs = ["index.h"], |
| 169 | ) |
| 170 | |
| 171 | cc_test( |
| 172 | name = "index_test", |
| 173 | srcs = ["index_test.cc"], |
| 174 | deps = [ |
| 175 | ":index", |
| 176 | "//aos/testing:googletest", |
| 177 | "//aos/testing:test_logging", |
| 178 | ], |
| 179 | ) |
Austin Schuh | 20b2b08 | 2019-09-11 20:42:56 -0700 | [diff] [blame] | 180 | |
| 181 | cc_library( |
| 182 | name = "lockless_queue", |
| 183 | srcs = [ |
| 184 | "lockless_queue.cc", |
| 185 | "lockless_queue_memory.h", |
| 186 | ], |
| 187 | hdrs = ["lockless_queue.h"], |
| 188 | deps = [ |
| 189 | ":aos_sync", |
| 190 | ":index", |
| 191 | "//aos:init", |
| 192 | "//aos/logging", |
| 193 | "//aos/time", |
| 194 | "//aos/util:compiler_memory_barrier", |
Austin Schuh | f257f3c | 2019-10-27 21:00:43 -0700 | [diff] [blame^] | 195 | "@com_github_google_glog//:glog", |
Austin Schuh | 20b2b08 | 2019-09-11 20:42:56 -0700 | [diff] [blame] | 196 | ], |
| 197 | ) |
| 198 | |
| 199 | cc_library( |
| 200 | name = "queue_racer", |
| 201 | testonly = True, |
| 202 | srcs = [ |
| 203 | "queue_racer.cc", |
| 204 | ], |
| 205 | hdrs = [ |
| 206 | "queue_racer.h", |
| 207 | ], |
| 208 | deps = [ |
| 209 | ":lockless_queue", |
| 210 | "//aos:event", |
| 211 | "//third_party/googletest:gtest", |
| 212 | ], |
| 213 | ) |
| 214 | |
| 215 | cc_test( |
| 216 | name = "lockless_queue_test", |
| 217 | timeout = "eternal", |
| 218 | srcs = ["lockless_queue_test.cc"], |
| 219 | deps = [ |
| 220 | ":lockless_queue", |
| 221 | ":queue_racer", |
| 222 | ":signalfd", |
| 223 | "//aos:event", |
| 224 | "//aos/events:epoll", |
| 225 | "//aos/libc:aos_strsignal", |
| 226 | "//aos/testing:googletest", |
| 227 | "//aos/testing:prevent_exit", |
| 228 | "//aos/testing:test_logging", |
| 229 | ], |
| 230 | ) |
| 231 | |
| 232 | cc_test( |
| 233 | name = "lockless_queue_death_test", |
| 234 | srcs = ["lockless_queue_death_test.cc"], |
| 235 | deps = [ |
| 236 | ":lockless_queue", |
| 237 | ":queue_racer", |
| 238 | ":signalfd", |
| 239 | "//aos:event", |
| 240 | "//aos/events:epoll", |
| 241 | "//aos/libc:aos_strsignal", |
| 242 | "//aos/testing:googletest", |
| 243 | "//aos/testing:prevent_exit", |
| 244 | "//aos/testing:test_logging", |
| 245 | ], |
| 246 | ) |