ufdt_overlay.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Copyright (C) 2016 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. #ifndef UFDT_OVERLAY_H
  17. #define UFDT_OVERLAY_H
  18. #include <libfdt.h>
  19. /* Given a buffer in RAM containing the contents of a .dtb file,
  20. * it initializes an FDT in-place and returns a pointer to the
  21. * given buffer, or NULL in case of error.
  22. * In case of error, it may printf() diagnostic messages.
  23. */
  24. struct fdt_header *ufdt_install_blob(void *blob, size_t blob_size);
  25. /* Given a main_fdt_header buffer and an overlay_fdtp buffer containing the
  26. * contents of a .dtbo file, it creates a new FDT containing the applied
  27. * overlay_fdtp in a dto_malloc'd buffer and returns it, or NULL in case of
  28. * error.
  29. * It is allowed to modify the buffers (both main_fdt_header and overlay_fdtp
  30. * buffer) passed in.
  31. * It does not dto_free main_fdt_header and overlay_fdtp buffer passed in.
  32. */
  33. struct fdt_header *ufdt_apply_overlay(struct fdt_header *main_fdt_header,
  34. size_t main_fdt_size,
  35. void *overlay_fdtp,
  36. size_t overlay_size);
  37. #endif /* UFDT_OVERLAY_H */