Andrew Scull | 451b8b1 | 2022-05-30 10:00:12 +0000 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
| 2 | /* |
| 3 | * Copyright (c) 2022 Google, Inc. |
| 4 | * Written by Andrew Scull <ascull@google.com> |
| 5 | */ |
| 6 | |
| 7 | #include <common.h> |
| 8 | #include <dm.h> |
| 9 | #include <fuzzing_engine.h> |
| 10 | #include <asm/fuzzing_engine.h> |
| 11 | |
| 12 | static int get_input(struct udevice *dev, |
| 13 | const uint8_t **data, |
| 14 | size_t *size) |
| 15 | { |
| 16 | return sandbox_fuzzing_engine_get_input(data, size); |
| 17 | } |
| 18 | |
| 19 | static const struct dm_fuzzing_engine_ops sandbox_fuzzing_engine_ops = { |
| 20 | .get_input = get_input, |
| 21 | }; |
| 22 | |
| 23 | static const struct udevice_id sandbox_fuzzing_engine_match[] = { |
| 24 | { |
| 25 | .compatible = "sandbox,fuzzing-engine", |
| 26 | }, |
| 27 | {}, |
| 28 | }; |
| 29 | |
| 30 | U_BOOT_DRIVER(sandbox_fuzzing_engine) = { |
| 31 | .name = "sandbox-fuzzing-engine", |
| 32 | .id = UCLASS_FUZZING_ENGINE, |
| 33 | .of_match = sandbox_fuzzing_engine_match, |
| 34 | .ops = &sandbox_fuzzing_engine_ops, |
| 35 | }; |