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 | |
Andrew Scull | 451b8b1 | 2022-05-30 10:00:12 +0000 | [diff] [blame] | 7 | #include <dm.h> |
| 8 | #include <fuzzing_engine.h> |
| 9 | #include <asm/fuzzing_engine.h> |
| 10 | |
| 11 | static int get_input(struct udevice *dev, |
| 12 | const uint8_t **data, |
| 13 | size_t *size) |
| 14 | { |
| 15 | return sandbox_fuzzing_engine_get_input(data, size); |
| 16 | } |
| 17 | |
| 18 | static const struct dm_fuzzing_engine_ops sandbox_fuzzing_engine_ops = { |
| 19 | .get_input = get_input, |
| 20 | }; |
| 21 | |
| 22 | static const struct udevice_id sandbox_fuzzing_engine_match[] = { |
| 23 | { |
| 24 | .compatible = "sandbox,fuzzing-engine", |
| 25 | }, |
| 26 | {}, |
| 27 | }; |
| 28 | |
| 29 | U_BOOT_DRIVER(sandbox_fuzzing_engine) = { |
| 30 | .name = "sandbox-fuzzing-engine", |
| 31 | .id = UCLASS_FUZZING_ENGINE, |
| 32 | .of_match = sandbox_fuzzing_engine_match, |
| 33 | .ops = &sandbox_fuzzing_engine_ops, |
| 34 | }; |