You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

job.c 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright (C) 2007 Michael Brown <mbrown@fensystems.co.uk>.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License as
  6. * published by the Free Software Foundation; either version 2 of the
  7. * License, or any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful, but
  10. * WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  17. * 02110-1301, USA.
  18. */
  19. FILE_LICENCE ( GPL2_OR_LATER );
  20. #include <string.h>
  21. #include <errno.h>
  22. #include <ipxe/job.h>
  23. /** @file
  24. *
  25. * Job control interfaces
  26. *
  27. */
  28. /**
  29. * Get job progress
  30. *
  31. * @v intf Object interface
  32. * @v progress Progress data to fill in
  33. */
  34. void job_progress ( struct interface *intf, struct job_progress *progress ) {
  35. struct interface *dest;
  36. job_progress_TYPE ( void * ) *op =
  37. intf_get_dest_op ( intf, job_progress, &dest );
  38. void *object = intf_object ( dest );
  39. DBGC ( INTF_COL ( intf ), "INTF " INTF_INTF_FMT " job_progress\n",
  40. INTF_INTF_DBG ( intf, dest ) );
  41. if ( op ) {
  42. op ( object, progress );
  43. } else {
  44. /* Default is to mark progress as zero */
  45. memset ( progress, 0, sizeof ( *progress ) );
  46. }
  47. intf_put ( dest );
  48. }