write.c 762 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (C) Paul Mackerras 1997.
  3. * Copyright (C) Leigh Brown 2002.
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License
  7. * as published by the Free Software Foundation; either version
  8. * 2 of the License, or (at your option) any later version.
  9. */
  10. #include "of1275.h"
  11. int
  12. write(ihandle instance, void *buf, int buflen)
  13. {
  14. struct prom_args {
  15. char *service;
  16. int nargs;
  17. int nret;
  18. ihandle instance;
  19. void *buf;
  20. int buflen;
  21. int actual;
  22. } args;
  23. args.service = "write";
  24. args.nargs = 3;
  25. args.nret = 1;
  26. args.instance = instance;
  27. args.buf = buf;
  28. args.buflen = buflen;
  29. args.actual = -1;
  30. (*of_prom_entry)(&args);
  31. return args.actual;
  32. }