Fork of the vendor (Boundary Devices) u-boot for Reform 2, with minor tweaks. The goal is to migrate to mainstream u-boot or barebox ASAP. The main impediment so far is the 4GB RAM config.
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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 
 
 

39 lines
647 B

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <unistd.h>
  5. #ifndef BUFSIZ
  6. # define BUFSIZ 4096
  7. #endif
  8. #undef BUFSIZ
  9. # define BUFSIZ 64
  10. int main (void)
  11. {
  12. short ibuff[BUFSIZ], obuff[BUFSIZ];
  13. int rc, i, len;
  14. while ((rc = read (0, ibuff, sizeof (ibuff))) > 0) {
  15. memset (obuff, 0, sizeof (obuff));
  16. for (i = 0; i < (rc + 1) / 2; i++) {
  17. obuff[i] = ibuff[i ^ 1];
  18. }
  19. len = (rc + 1) & ~1;
  20. if (write (1, obuff, len) != len) {
  21. perror ("read error");
  22. return (EXIT_FAILURE);
  23. }
  24. memset (ibuff, 0, sizeof (ibuff));
  25. }
  26. if (rc < 0) {
  27. perror ("read error");
  28. return (EXIT_FAILURE);
  29. }
  30. return (EXIT_SUCCESS);
  31. }