17211016cd72b5fa9f61fb8cf77b62faa207362e4Martijn Coenen/*
27211016cd72b5fa9f61fb8cf77b62faa207362e4Martijn Coenen * Copyright (C) 2016 The Android Open Source Project
37211016cd72b5fa9f61fb8cf77b62faa207362e4Martijn Coenen *
47211016cd72b5fa9f61fb8cf77b62faa207362e4Martijn Coenen * Licensed under the Apache License, Version 2.0 (the "License");
57211016cd72b5fa9f61fb8cf77b62faa207362e4Martijn Coenen * you may not use this file except in compliance with the License.
67211016cd72b5fa9f61fb8cf77b62faa207362e4Martijn Coenen * You may obtain a copy of the License at
77211016cd72b5fa9f61fb8cf77b62faa207362e4Martijn Coenen *
87211016cd72b5fa9f61fb8cf77b62faa207362e4Martijn Coenen *      http://www.apache.org/licenses/LICENSE-2.0
97211016cd72b5fa9f61fb8cf77b62faa207362e4Martijn Coenen *
107211016cd72b5fa9f61fb8cf77b62faa207362e4Martijn Coenen * Unless required by applicable law or agreed to in writing, software
117211016cd72b5fa9f61fb8cf77b62faa207362e4Martijn Coenen * distributed under the License is distributed on an "AS IS" BASIS,
127211016cd72b5fa9f61fb8cf77b62faa207362e4Martijn Coenen * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
137211016cd72b5fa9f61fb8cf77b62faa207362e4Martijn Coenen * See the License for the specific language governing permissions and
147211016cd72b5fa9f61fb8cf77b62faa207362e4Martijn Coenen * limitations under the License.
157211016cd72b5fa9f61fb8cf77b62faa207362e4Martijn Coenen */
167211016cd72b5fa9f61fb8cf77b62faa207362e4Martijn Coenen
177211016cd72b5fa9f61fb8cf77b62faa207362e4Martijn Coenen// All static variables go here, to control initialization and
187211016cd72b5fa9f61fb8cf77b62faa207362e4Martijn Coenen// destruction order in the library.
197211016cd72b5fa9f61fb8cf77b62faa207362e4Martijn Coenen
20953e6b0f57b5003390b3e70904bfa47f535492e4Yifan Hong#include <functional>
21953e6b0f57b5003390b3e70904bfa47f535492e4Yifan Hong
22b2c9c75b74c87e651dd08a100015eab17319556eYifan Hong#include <android/hidl/base/1.0/IBase.h>
2384888d3553c7595ee57dc73023ae94a27895de0dYifan Hong#include <hidl/ConcurrentMap.h>
24b2c9c75b74c87e651dd08a100015eab17319556eYifan Hong#include <hwbinder/IBinder.h>
25637195c1b50ec8a2f625b116da803c2e6e101adaSteven Moreland#include <utils/StrongPointer.h>
267211016cd72b5fa9f61fb8cf77b62faa207362e4Martijn Coenen
277211016cd72b5fa9f61fb8cf77b62faa207362e4Martijn Coenennamespace android {
287211016cd72b5fa9f61fb8cf77b62faa207362e4Martijn Coenennamespace hardware {
29953e6b0f57b5003390b3e70904bfa47f535492e4Yifan Hongnamespace details {
307211016cd72b5fa9f61fb8cf77b62faa207362e4Martijn Coenen
3181ef4da81353cf86d185e90239e4f06d2930c2baMartijn Coenenstruct SchedPrio {
3281ef4da81353cf86d185e90239e4f06d2930c2baMartijn Coenen    int sched_policy;
3381ef4da81353cf86d185e90239e4f06d2930c2baMartijn Coenen    int prio;
3481ef4da81353cf86d185e90239e4f06d2930c2baMartijn Coenen};
3581ef4da81353cf86d185e90239e4f06d2930c2baMartijn Coenen
36953e6b0f57b5003390b3e70904bfa47f535492e4Yifan Hong// For HidlBinderSupport and autogenerated code
37b2c9c75b74c87e651dd08a100015eab17319556eYifan Hong// value function receives reinterpret_cast<void *>(static_cast<IFoo *>(foo)),
38b2c9c75b74c87e651dd08a100015eab17319556eYifan Hong// returns sp<IBinder>
3984888d3553c7595ee57dc73023ae94a27895de0dYifan Hongextern ConcurrentMap<std::string,
4084888d3553c7595ee57dc73023ae94a27895de0dYifan Hong        std::function<sp<IBinder>(void *)>> gBnConstructorMap;
416bf733ec867a5d46ea05ae5c280a27b051f5018cYifan Hong
4281ef4da81353cf86d185e90239e4f06d2930c2baMartijn Coenenextern ConcurrentMap<wp<::android::hidl::base::V1_0::IBase>, SchedPrio> gServicePrioMap;
4381ef4da81353cf86d185e90239e4f06d2930c2baMartijn Coenen
44953e6b0f57b5003390b3e70904bfa47f535492e4Yifan Hong// For HidlPassthroughSupport and autogenerated code
456bf733ec867a5d46ea05ae5c280a27b051f5018cYifan Hong// value function receives reinterpret_cast<void *>(static_cast<IFoo *>(foo)),
466bf733ec867a5d46ea05ae5c280a27b051f5018cYifan Hong// returns sp<IBase>
4784888d3553c7595ee57dc73023ae94a27895de0dYifan Hongextern ConcurrentMap<std::string,
4884888d3553c7595ee57dc73023ae94a27895de0dYifan Hong        std::function<sp<::android::hidl::base::V1_0::IBase>(void *)>> gBsConstructorMap;
49b2c9c75b74c87e651dd08a100015eab17319556eYifan Hong
50953e6b0f57b5003390b3e70904bfa47f535492e4Yifan Hong}  // namespace details
51953e6b0f57b5003390b3e70904bfa47f535492e4Yifan Hong}  // namespace hardware
52953e6b0f57b5003390b3e70904bfa47f535492e4Yifan Hong}  // namespace android
53