Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 1 | cc_library( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 2 | name = "aos_sync", |
| 3 | srcs = [ |
| 4 | "aos_sync.cc", |
| 5 | ], |
| 6 | hdrs = [ |
| 7 | "aos_sync.h", |
| 8 | ], |
| 9 | linkopts = [ |
| 10 | "-lpthread", |
| 11 | ], |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 12 | visibility = ["//visibility:public"], |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 13 | deps = [ |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 14 | "//aos:macros", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 15 | "//aos/util:compiler_memory_barrier", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 16 | "@com_github_google_glog//:glog", |
| 17 | "@com_google_absl//absl/base", |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 18 | ], |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 19 | ) |
| 20 | |
| 21 | cc_library( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 22 | name = "core_lib", |
| 23 | srcs = [ |
| 24 | "core_lib.c", |
| 25 | ], |
| 26 | hdrs = [ |
| 27 | "core_lib.h", |
| 28 | ], |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 29 | visibility = ["//visibility:public"], |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 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 = [ |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 39 | "shared_mem.cc", |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 40 | ], |
| 41 | hdrs = [ |
| 42 | "shared_mem.h", |
| 43 | ], |
| 44 | linkopts = [ |
| 45 | "-lrt", |
| 46 | ], |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 47 | visibility = ["//visibility:public"], |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 48 | deps = [ |
| 49 | ":aos_sync", |
| 50 | ":core_lib", |
| 51 | ":shared_mem_types", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 52 | "@com_github_google_glog//:glog", |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 53 | ], |
Austin Schuh | 044e18b | 2015-10-21 20:17:09 -0700 | [diff] [blame] | 54 | ) |
| 55 | |
| 56 | cc_library( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 57 | # TODO(Brian): This should be shared_mem{,.h}, and the other one should be |
| 58 | # shared_mem_init{,.cc,.h}. |
| 59 | name = "shared_mem_types", |
| 60 | hdrs = [ |
| 61 | "shared_mem_types.h", |
| 62 | ], |
| 63 | deps = [ |
| 64 | ":aos_sync", |
| 65 | ], |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 66 | ) |
| 67 | |
| 68 | cc_library( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 69 | name = "queue", |
| 70 | srcs = [ |
| 71 | "queue.cc", |
| 72 | ], |
| 73 | hdrs = [ |
| 74 | "queue.h", |
| 75 | ], |
| 76 | linkopts = [ |
| 77 | "-lrt", |
| 78 | ], |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 79 | visibility = ["//visibility:public"], |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 80 | deps = [ |
| 81 | ":core_lib", |
| 82 | ":shared_mem", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 83 | "//aos:condition", |
Brian Silverman | 16a923c | 2018-10-31 19:40:51 -0700 | [diff] [blame] | 84 | "//aos/mutex", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 85 | "//aos/util:options", |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 86 | ], |
Brian Silverman | 100534c | 2015-09-07 15:51:23 -0400 | [diff] [blame] | 87 | ) |
| 88 | |
| 89 | cc_test( |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 90 | name = "raw_queue_test", |
| 91 | srcs = [ |
| 92 | "raw_queue_test.cc", |
| 93 | ], |
| 94 | deps = [ |
| 95 | ":core_lib", |
| 96 | ":queue", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 97 | "//aos:die", |
John Park | 33858a3 | 2018-09-28 23:05:48 -0700 | [diff] [blame] | 98 | "//aos/logging", |
Philipp Schrader | 9b1790e | 2018-03-10 20:21:30 -0800 | [diff] [blame] | 99 | "//aos/testing:googletest", |
| 100 | "//aos/testing:prevent_exit", |
| 101 | "//aos/testing:test_shm", |
Brian Silverman | 16a923c | 2018-10-31 19:40:51 -0700 | [diff] [blame] | 102 | "//aos/time", |
| 103 | "//aos/util:death_test_log_implementation", |
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 | ], |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 160 | visibility = ["//visibility:public"], |
Austin Schuh | 6c590f8 | 2019-09-11 19:23:12 -0700 | [diff] [blame] | 161 | deps = [ |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 162 | "@com_github_google_glog//:glog", |
Austin Schuh | 6c590f8 | 2019-09-11 19:23:12 -0700 | [diff] [blame] | 163 | ], |
| 164 | ) |
Austin Schuh | 25356e2 | 2019-09-11 19:27:07 -0700 | [diff] [blame] | 165 | |
Brian Silverman | 407cc53 | 2019-11-03 11:40:56 -0800 | [diff] [blame] | 166 | cc_test( |
| 167 | name = "signalfd_test", |
| 168 | srcs = [ |
| 169 | "signalfd_test.cc", |
| 170 | ], |
| 171 | deps = [ |
| 172 | ":signalfd", |
| 173 | "//aos/testing:googletest", |
| 174 | "//aos/testing:test_logging", |
| 175 | "@com_github_google_glog//:glog", |
| 176 | ], |
| 177 | ) |
| 178 | |
Austin Schuh | 25356e2 | 2019-09-11 19:27:07 -0700 | [diff] [blame] | 179 | cc_library( |
| 180 | name = "index", |
Austin Schuh | 20b2b08 | 2019-09-11 20:42:56 -0700 | [diff] [blame] | 181 | srcs = ["index.cc"], |
Austin Schuh | 25356e2 | 2019-09-11 19:27:07 -0700 | [diff] [blame] | 182 | hdrs = ["index.h"], |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 183 | visibility = ["//visibility:public"], |
Austin Schuh | 25356e2 | 2019-09-11 19:27:07 -0700 | [diff] [blame] | 184 | ) |
| 185 | |
| 186 | cc_test( |
| 187 | name = "index_test", |
| 188 | srcs = ["index_test.cc"], |
| 189 | deps = [ |
| 190 | ":index", |
| 191 | "//aos/testing:googletest", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 192 | "@com_github_google_glog//:glog", |
Austin Schuh | 25356e2 | 2019-09-11 19:27:07 -0700 | [diff] [blame] | 193 | ], |
| 194 | ) |
Austin Schuh | 20b2b08 | 2019-09-11 20:42:56 -0700 | [diff] [blame] | 195 | |
| 196 | cc_library( |
| 197 | name = "lockless_queue", |
| 198 | srcs = [ |
| 199 | "lockless_queue.cc", |
| 200 | "lockless_queue_memory.h", |
| 201 | ], |
| 202 | hdrs = ["lockless_queue.h"], |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 203 | visibility = ["//visibility:public"], |
Austin Schuh | 20b2b08 | 2019-09-11 20:42:56 -0700 | [diff] [blame] | 204 | deps = [ |
| 205 | ":aos_sync", |
Brian Silverman | a1652f3 | 2020-01-29 20:41:44 -0800 | [diff] [blame] | 206 | ":data_alignment", |
Austin Schuh | 20b2b08 | 2019-09-11 20:42:56 -0700 | [diff] [blame] | 207 | ":index", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 208 | "//aos:realtime", |
Austin Schuh | 20b2b08 | 2019-09-11 20:42:56 -0700 | [diff] [blame] | 209 | "//aos/time", |
| 210 | "//aos/util:compiler_memory_barrier", |
Austin Schuh | f257f3c | 2019-10-27 21:00:43 -0700 | [diff] [blame] | 211 | "@com_github_google_glog//:glog", |
Austin Schuh | 20b2b08 | 2019-09-11 20:42:56 -0700 | [diff] [blame] | 212 | ], |
| 213 | ) |
| 214 | |
| 215 | cc_library( |
| 216 | name = "queue_racer", |
| 217 | testonly = True, |
| 218 | srcs = [ |
| 219 | "queue_racer.cc", |
| 220 | ], |
| 221 | hdrs = [ |
| 222 | "queue_racer.h", |
| 223 | ], |
| 224 | deps = [ |
| 225 | ":lockless_queue", |
| 226 | "//aos:event", |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 227 | "//aos/testing:googletest", |
Austin Schuh | 20b2b08 | 2019-09-11 20:42:56 -0700 | [diff] [blame] | 228 | ], |
| 229 | ) |
| 230 | |
| 231 | cc_test( |
| 232 | name = "lockless_queue_test", |
| 233 | timeout = "eternal", |
| 234 | srcs = ["lockless_queue_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", |
Austin Schuh | 20b2b08 | 2019-09-11 20:42:56 -0700 | [diff] [blame] | 244 | ], |
| 245 | ) |
| 246 | |
| 247 | cc_test( |
| 248 | name = "lockless_queue_death_test", |
| 249 | srcs = ["lockless_queue_death_test.cc"], |
| 250 | deps = [ |
| 251 | ":lockless_queue", |
| 252 | ":queue_racer", |
| 253 | ":signalfd", |
| 254 | "//aos:event", |
| 255 | "//aos/events:epoll", |
| 256 | "//aos/libc:aos_strsignal", |
| 257 | "//aos/testing:googletest", |
| 258 | "//aos/testing:prevent_exit", |
| 259 | "//aos/testing:test_logging", |
| 260 | ], |
| 261 | ) |
Brian Silverman | a1652f3 | 2020-01-29 20:41:44 -0800 | [diff] [blame] | 262 | |
| 263 | cc_library( |
| 264 | name = "data_alignment", |
| 265 | hdrs = [ |
| 266 | "data_alignment.h", |
| 267 | ], |
| 268 | visibility = ["//visibility:public"], |
| 269 | deps = [ |
| 270 | "@com_github_google_glog//:glog", |
| 271 | ], |
| 272 | ) |