OpenBIC
OpenSource Bridge-IC
util_worker.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
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#ifndef SMC_WORKER_H
18#define SMC_WORKER_H
19
20#include <stdint.h>
21
22#define MAX_WORK_NAME_LEN 32
23
24/* A structure used to submit work. */
25typedef struct {
26 /* The function to be added to worker.
27 * Which must with two parameters,
28 * first one is void*, second one is uint32_t.
29 */
30 void (*fn)(void *, uint32_t);
31
32 /* First parameter of the function. */
33 void *ptr_arg;
34
35 /* Second parameter of the function. */
36 uint32_t ui32_arg;
37
38 /* Time to waits before executing function,
39 * set to 0 if no delay is required.
40 */
41 uint32_t delay_ms;
42
43 /* Work name. */
46
47extern struct k_work_q plat_work_q;
48
49void init_plat_worker(int);
50uint8_t get_work_count();
51int add_work(worker_job *);
52void init_worker();
53
54#endif
Definition: util_worker.h:25
uint32_t ui32_arg
Definition: util_worker.h:36
void * ptr_arg
Definition: util_worker.h:33
uint32_t delay_ms
Definition: util_worker.h:41
uint8_t get_work_count()
Definition: util_worker.c:92
void init_worker()
Definition: util_worker.c:167
void init_plat_worker(int)
Definition: util_worker.c:180
#define MAX_WORK_NAME_LEN
Definition: util_worker.h:22
struct k_work_q plat_work_q
Definition: util_worker.c:41
int add_work(worker_job *)
Definition: util_worker.c:106
name
Definition: plat_i2c.h:24