1 /* 2 * Copyright (C) 2020 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #pragma once 18 19 #include <interface/system_state/system_state.h> 20 #include <lk/compiler.h> 21 #include <sys/types.h> 22 23 __BEGIN_CDECLS 24 25 struct tipc_hset; 26 27 /** 28 * system_state_server_get_flag() - Get the current value of a system flag 29 * @flag: Identifier for flag to get. One of @enum system_state_flag. 30 * @valuep: Pointer to return value in. 31 * 32 * Must be implemented by client of lib_system_state_server. 33 * 34 * Return: 0 on success, or an error code < 0 on failure. 35 */ 36 int system_state_server_get_flag(uint32_t flag, uint64_t* valuep); 37 38 /** 39 * add_system_state_service() - Add system_state service 40 * @hset: Handle set created by tipc_hset_create() 41 * 42 * Client should call tipc_run_event_loop at some point after this call returns. 43 * 44 * Return: 0 on success, or an error code < 0 on failure. 45 */ 46 int add_system_state_service(struct tipc_hset* hset); 47 48 __END_CDECLS 49