aboutsummaryrefslogtreecommitdiff
path: root/platform/shared/include/chre/target_platform/platform_cache_management.h
blob: 123de1745c5575ff3d3fdeec8f6fd5a03e201609 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
 * Copyright (C) 2020 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef CHRE_PLATFORM_SHARED_CACHE_MANAGEMENT_H_
#define CHRE_PLATFORM_SHARED_CACHE_MANAGEMENT_H_

namespace chre {

/**
 * Invalidates and/or cleans the system instruction and data caches.
 *
 * When nanoapps in CHRE are loaded dynamically, the data and
 * executable segments are parsed and relocated into memory. This operation
 * can cause cached instructions and data to be invalid when we start executing
 * the newly loaded nanoapp's instructions, and could possibly lead to an
 * exception. To support custom dynamic loading implementations (for example,
 * when it's not part of the underlying OS/system), the platform needs to
 * implement (or provide an empty stub for) the following method to invalidate
 * and/or clean the system data and instruction caches.
 */
void wipeSystemCaches();

}  // namespace chre

#endif  // CHRE_PLATFORM_SHARED_CACHE_MANAGEMENT_H_