Advertisement
Guest User

zigzag768.txt

a guest
Oct 31st, 2014
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 66.26 KB | None | 0 0
  1. # 1 "zigzag/zigzag.c"
  2. # 1 "/home/linaro/esim-test-bins//"
  3. # 1 "<command-line>"
  4. # 1 "zigzag/zigzag.c"
  5. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/stdio.h" 1 3
  6. # 29 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/stdio.h" 3
  7. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/_ansi.h" 1 3
  8. # 15 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/_ansi.h" 3
  9. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/newlib.h" 1 3
  10. # 16 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/_ansi.h" 2 3
  11. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/config.h" 1 3
  12.  
  13.  
  14.  
  15. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/machine/ieeefp.h" 1 3
  16. # 5 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/config.h" 2 3
  17. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/features.h" 1 3
  18. # 6 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/config.h" 2 3
  19. # 17 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/_ansi.h" 2 3
  20. # 30 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/stdio.h" 2 3
  21.  
  22.  
  23.  
  24.  
  25. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/lib/gcc/epiphany-elf/4.8.2/include/stddef.h" 1 3 4
  26. # 212 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/lib/gcc/epiphany-elf/4.8.2/include/stddef.h" 3 4
  27. typedef long unsigned int size_t;
  28. # 35 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/stdio.h" 2 3
  29.  
  30.  
  31. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/lib/gcc/epiphany-elf/4.8.2/include/stdarg.h" 1 3 4
  32. # 40 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/lib/gcc/epiphany-elf/4.8.2/include/stdarg.h" 3 4
  33. typedef __builtin_va_list __gnuc_va_list;
  34. # 38 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/stdio.h" 2 3
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/reent.h" 1 3
  43. # 13 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/reent.h" 3
  44. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/_ansi.h" 1 3
  45. # 14 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/reent.h" 2 3
  46. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/_types.h" 1 3
  47. # 12 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/_types.h" 3
  48. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/machine/_types.h" 1 3
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/machine/_default_types.h" 1 3
  56. # 26 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/machine/_default_types.h" 3
  57. typedef signed char __int8_t ;
  58. typedef unsigned char __uint8_t ;
  59. # 36 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/machine/_default_types.h" 3
  60. typedef signed short __int16_t;
  61. typedef unsigned short __uint16_t;
  62. # 46 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/machine/_default_types.h" 3
  63. typedef __int16_t __int_least16_t;
  64. typedef __uint16_t __uint_least16_t;
  65. # 58 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/machine/_default_types.h" 3
  66. typedef signed int __int32_t;
  67. typedef unsigned int __uint32_t;
  68. # 76 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/machine/_default_types.h" 3
  69. typedef __int32_t __int_least32_t;
  70. typedef __uint32_t __uint_least32_t;
  71. # 99 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/machine/_default_types.h" 3
  72. typedef signed long long __int64_t;
  73. typedef unsigned long long __uint64_t;
  74. # 8 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/machine/_types.h" 2 3
  75. # 13 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/_types.h" 2 3
  76. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/lock.h" 1 3
  77.  
  78.  
  79.  
  80.  
  81.  
  82. typedef int _LOCK_T;
  83. typedef int _LOCK_RECURSIVE_T;
  84. # 14 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/_types.h" 2 3
  85.  
  86.  
  87. typedef long _off_t;
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95. typedef short __dev_t;
  96.  
  97.  
  98.  
  99.  
  100. typedef unsigned short __uid_t;
  101.  
  102.  
  103. typedef unsigned short __gid_t;
  104.  
  105.  
  106.  
  107. __extension__ typedef long long _off64_t;
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115. typedef long _fpos_t;
  116. # 56 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/_types.h" 3
  117. typedef int _ssize_t;
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/lib/gcc/epiphany-elf/4.8.2/include/stddef.h" 1 3 4
  125. # 353 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/lib/gcc/epiphany-elf/4.8.2/include/stddef.h" 3 4
  126. typedef unsigned int wint_t;
  127. # 64 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/_types.h" 2 3
  128.  
  129.  
  130.  
  131. typedef struct
  132. {
  133. int __count;
  134. union
  135. {
  136. wint_t __wch;
  137. unsigned char __wchb[4];
  138. } __value;
  139. } _mbstate_t;
  140.  
  141.  
  142.  
  143. typedef _LOCK_RECURSIVE_T _flock_t;
  144.  
  145.  
  146.  
  147.  
  148. typedef void *_iconv_t;
  149. # 15 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/reent.h" 2 3
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156. typedef unsigned long __ULong;
  157. # 37 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/reent.h" 3
  158. struct _reent;
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165. struct _Bigint
  166. {
  167. struct _Bigint *_next;
  168. int _k, _maxwds, _sign, _wds;
  169. __ULong _x[1];
  170. };
  171.  
  172.  
  173. struct __tm
  174. {
  175. int __tm_sec;
  176. int __tm_min;
  177. int __tm_hour;
  178. int __tm_mday;
  179. int __tm_mon;
  180. int __tm_year;
  181. int __tm_wday;
  182. int __tm_yday;
  183. int __tm_isdst;
  184. };
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192. struct _on_exit_args {
  193. void * _fnargs[32];
  194. void * _dso_handle[32];
  195.  
  196. __ULong _fntypes;
  197.  
  198.  
  199. __ULong _is_cxa;
  200. };
  201. # 89 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/reent.h" 3
  202. struct _atexit {
  203. struct _atexit *_next;
  204. int _ind;
  205.  
  206. void (*_fns[32])(void);
  207. struct _on_exit_args _on_exit_args;
  208. };
  209. # 105 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/reent.h" 3
  210. struct __sbuf {
  211. unsigned char *_base;
  212. int _size;
  213. };
  214. # 169 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/reent.h" 3
  215. struct __sFILE {
  216. unsigned char *_p;
  217. int _r;
  218. int _w;
  219. short _flags;
  220. short _file;
  221. struct __sbuf _bf;
  222. int _lbfsize;
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229. void * _cookie;
  230.  
  231. int (* _read) (struct _reent *, void *, char *, int)
  232. ;
  233. int (* _write) (struct _reent *, void *, const char *, int)
  234. ;
  235. _fpos_t (* _seek) (struct _reent *, void *, _fpos_t, int);
  236. int (* _close) (struct _reent *, void *);
  237.  
  238.  
  239. struct __sbuf _ub;
  240. unsigned char *_up;
  241. int _ur;
  242.  
  243.  
  244. unsigned char _ubuf[3];
  245. unsigned char _nbuf[1];
  246.  
  247.  
  248. struct __sbuf _lb;
  249.  
  250.  
  251. int _blksize;
  252. int _offset;
  253.  
  254.  
  255. struct _reent *_data;
  256.  
  257.  
  258.  
  259. _flock_t _lock;
  260.  
  261. _mbstate_t _mbstate;
  262. int _flags2;
  263. };
  264. # 273 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/reent.h" 3
  265. typedef struct __sFILE __FILE;
  266.  
  267.  
  268.  
  269. struct _glue
  270. {
  271. struct _glue *_next;
  272. int _niobs;
  273. __FILE *_iobs;
  274. };
  275. # 305 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/reent.h" 3
  276. struct _rand48 {
  277. unsigned short _seed[3];
  278. unsigned short _mult[3];
  279. unsigned short _add;
  280.  
  281.  
  282.  
  283.  
  284. };
  285. # 580 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/reent.h" 3
  286. struct _reent
  287. {
  288. int _errno;
  289.  
  290.  
  291.  
  292.  
  293. __FILE *_stdin, *_stdout, *_stderr;
  294.  
  295. int _inc;
  296. char _emergency[25];
  297.  
  298. int _current_category;
  299. const char *_current_locale;
  300.  
  301. int __sdidinit;
  302.  
  303. void (* __cleanup) (struct _reent *);
  304.  
  305.  
  306. struct _Bigint *_result;
  307. int _result_k;
  308. struct _Bigint *_p5s;
  309. struct _Bigint **_freelist;
  310.  
  311.  
  312. int _cvtlen;
  313. char *_cvtbuf;
  314.  
  315. union
  316. {
  317. struct
  318. {
  319. unsigned int _unused_rand;
  320. char * _strtok_last;
  321. char _asctime_buf[26];
  322. struct __tm _localtime_buf;
  323. int _gamma_signgam;
  324. __extension__ unsigned long long _rand_next;
  325. struct _rand48 _r48;
  326. _mbstate_t _mblen_state;
  327. _mbstate_t _mbtowc_state;
  328. _mbstate_t _wctomb_state;
  329. char _l64a_buf[8];
  330. char _signal_buf[24];
  331. int _getdate_err;
  332. _mbstate_t _mbrlen_state;
  333. _mbstate_t _mbrtowc_state;
  334. _mbstate_t _mbsrtowcs_state;
  335. _mbstate_t _wcrtomb_state;
  336. _mbstate_t _wcsrtombs_state;
  337. int _h_errno;
  338. } _reent;
  339.  
  340.  
  341.  
  342. struct
  343. {
  344.  
  345. unsigned char * _nextf[30];
  346. unsigned int _nmalloc[30];
  347. } _unused;
  348. } _new;
  349.  
  350.  
  351. struct _atexit *_atexit;
  352. struct _atexit _atexit0;
  353.  
  354.  
  355. void (**(_sig_func))(int);
  356.  
  357.  
  358.  
  359.  
  360. struct _glue __sglue;
  361. __FILE __sf[3];
  362. };
  363. # 818 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/reent.h" 3
  364. extern struct _reent *_impure_ptr ;
  365. extern struct _reent *const _global_impure_ptr ;
  366.  
  367. void _reclaim_reent (struct _reent *);
  368. # 46 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/stdio.h" 2 3
  369. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/types.h" 1 3
  370. # 69 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/types.h" 3
  371. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/lib/gcc/epiphany-elf/4.8.2/include/stddef.h" 1 3 4
  372. # 147 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/lib/gcc/epiphany-elf/4.8.2/include/stddef.h" 3 4
  373. typedef long int ptrdiff_t;
  374. # 324 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/lib/gcc/epiphany-elf/4.8.2/include/stddef.h" 3 4
  375. typedef unsigned int wchar_t;
  376. # 70 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/types.h" 2 3
  377. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/machine/types.h" 1 3
  378. # 19 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/machine/types.h" 3
  379. typedef long int __off_t;
  380. typedef int __pid_t;
  381.  
  382. __extension__ typedef long long int __loff_t;
  383. # 71 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/types.h" 2 3
  384. # 92 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/types.h" 3
  385. typedef unsigned char u_char;
  386. typedef unsigned short u_short;
  387. typedef unsigned int u_int;
  388. typedef unsigned long u_long;
  389.  
  390.  
  391.  
  392. typedef unsigned short ushort;
  393. typedef unsigned int uint;
  394. typedef unsigned long ulong;
  395.  
  396.  
  397.  
  398. typedef unsigned long clock_t;
  399.  
  400.  
  401.  
  402.  
  403. typedef long time_t;
  404.  
  405.  
  406.  
  407.  
  408. struct timespec {
  409. time_t tv_sec;
  410. long tv_nsec;
  411. };
  412.  
  413. struct itimerspec {
  414. struct timespec it_interval;
  415. struct timespec it_value;
  416. };
  417.  
  418.  
  419. typedef long daddr_t;
  420. typedef char * caddr_t;
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427. typedef unsigned short ino_t;
  428. # 163 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/types.h" 3
  429. typedef _off_t off_t;
  430. typedef __dev_t dev_t;
  431. typedef __uid_t uid_t;
  432. typedef __gid_t gid_t;
  433.  
  434.  
  435.  
  436.  
  437.  
  438. typedef int pid_t;
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446. typedef long key_t;
  447.  
  448. typedef _ssize_t ssize_t;
  449. # 196 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/types.h" 3
  450. typedef unsigned int mode_t __attribute__ ((__mode__ (__SI__)));
  451.  
  452.  
  453.  
  454.  
  455. typedef unsigned short nlink_t;
  456. # 223 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/types.h" 3
  457. typedef long fd_mask;
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465. typedef struct _types_fd_set {
  466. fd_mask fds_bits[(((64)+(((sizeof (fd_mask) * 8))-1))/((sizeof (fd_mask) * 8)))];
  467. } _types_fd_set;
  468. # 254 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/types.h" 3
  469. typedef unsigned long clockid_t;
  470.  
  471.  
  472.  
  473.  
  474. typedef unsigned long timer_t;
  475.  
  476.  
  477.  
  478. typedef unsigned long useconds_t;
  479. typedef long suseconds_t;
  480. # 47 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/stdio.h" 2 3
  481.  
  482.  
  483.  
  484. typedef __FILE FILE;
  485.  
  486.  
  487.  
  488.  
  489. typedef _fpos_t fpos_t;
  490.  
  491.  
  492.  
  493.  
  494.  
  495. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/stdio.h" 1 3
  496. # 62 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/stdio.h" 2 3
  497. # 171 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/stdio.h" 3
  498. FILE * tmpfile (void);
  499. char * tmpnam (char *);
  500. int fclose (FILE *);
  501. int fflush (FILE *);
  502. FILE * freopen (const char *, const char *, FILE *);
  503. void setbuf (FILE *, char *);
  504. int setvbuf (FILE *, char *, int, size_t);
  505. int fprintf (FILE *, const char *, ...) __attribute__ ((__format__ (__printf__, 2, 3)))
  506. ;
  507. int fscanf (FILE *, const char *, ...) __attribute__ ((__format__ (__scanf__, 2, 3)))
  508. ;
  509. int printf (const char *, ...) __attribute__ ((__format__ (__printf__, 1, 2)))
  510. ;
  511. int scanf (const char *, ...) __attribute__ ((__format__ (__scanf__, 1, 2)))
  512. ;
  513. int sscanf (const char *, const char *, ...) __attribute__ ((__format__ (__scanf__, 2, 3)))
  514. ;
  515. int vfprintf (FILE *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 2, 0)))
  516. ;
  517. int vprintf (const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 1, 0)))
  518. ;
  519. int vsprintf (char *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 2, 0)))
  520. ;
  521. int fgetc (FILE *);
  522. char * fgets (char *, int, FILE *);
  523. int fputc (int, FILE *);
  524. int fputs (const char *, FILE *);
  525. int getc (FILE *);
  526. int getchar (void);
  527. char * gets (char *);
  528. int putc (int, FILE *);
  529. int putchar (int);
  530. int puts (const char *);
  531. int ungetc (int, FILE *);
  532. size_t fread (void *, size_t _size, size_t _n, FILE *);
  533. size_t fwrite (const void * , size_t _size, size_t _n, FILE *);
  534.  
  535.  
  536.  
  537. int fgetpos (FILE *, fpos_t *);
  538.  
  539. int fseek (FILE *, long, int);
  540.  
  541.  
  542.  
  543. int fsetpos (FILE *, const fpos_t *);
  544.  
  545. long ftell ( FILE *);
  546. void rewind (FILE *);
  547. void clearerr (FILE *);
  548. int feof (FILE *);
  549. int ferror (FILE *);
  550. void perror (const char *);
  551.  
  552. FILE * fopen (const char *_name, const char *_type);
  553. int sprintf (char *, const char *, ...) __attribute__ ((__format__ (__printf__, 2, 3)))
  554. ;
  555. int remove (const char *);
  556. int rename (const char *, const char *);
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563. int fseeko (FILE *, off_t, int);
  564. off_t ftello ( FILE *);
  565.  
  566.  
  567.  
  568.  
  569. int asiprintf (char **, const char *, ...) __attribute__ ((__format__ (__printf__, 2, 3)))
  570. ;
  571. char * asniprintf (char *, size_t *, const char *, ...) __attribute__ ((__format__ (__printf__, 3, 4)))
  572. ;
  573. char * asnprintf (char *, size_t *, const char *, ...) __attribute__ ((__format__ (__printf__, 3, 4)))
  574. ;
  575. int asprintf (char **, const char *, ...) __attribute__ ((__format__ (__printf__, 2, 3)))
  576. ;
  577.  
  578. int diprintf (int, const char *, ...) __attribute__ ((__format__ (__printf__, 2, 3)))
  579. ;
  580.  
  581. int fcloseall (void);
  582. int fiprintf (FILE *, const char *, ...) __attribute__ ((__format__ (__printf__, 2, 3)))
  583. ;
  584. int fiscanf (FILE *, const char *, ...) __attribute__ ((__format__ (__scanf__, 2, 3)))
  585. ;
  586. int iprintf (const char *, ...) __attribute__ ((__format__ (__printf__, 1, 2)))
  587. ;
  588. int iscanf (const char *, ...) __attribute__ ((__format__ (__scanf__, 1, 2)))
  589. ;
  590. int siprintf (char *, const char *, ...) __attribute__ ((__format__ (__printf__, 2, 3)))
  591. ;
  592. int siscanf (const char *, const char *, ...) __attribute__ ((__format__ (__scanf__, 2, 3)))
  593. ;
  594. int snprintf (char *, size_t, const char *, ...) __attribute__ ((__format__ (__printf__, 3, 4)))
  595. ;
  596. int sniprintf (char *, size_t, const char *, ...) __attribute__ ((__format__ (__printf__, 3, 4)))
  597. ;
  598. char * tempnam (const char *, const char *);
  599. int vasiprintf (char **, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 2, 0)))
  600. ;
  601. char * vasniprintf (char *, size_t *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 3, 0)))
  602. ;
  603. char * vasnprintf (char *, size_t *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 3, 0)))
  604. ;
  605. int vasprintf (char **, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 2, 0)))
  606. ;
  607. int vdiprintf (int, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 2, 0)))
  608. ;
  609. int vfiprintf (FILE *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 2, 0)))
  610. ;
  611. int vfiscanf (FILE *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__scanf__, 2, 0)))
  612. ;
  613. int vfscanf (FILE *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__scanf__, 2, 0)))
  614. ;
  615. int viprintf (const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 1, 0)))
  616. ;
  617. int viscanf (const char *, __gnuc_va_list) __attribute__ ((__format__ (__scanf__, 1, 0)))
  618. ;
  619. int vscanf (const char *, __gnuc_va_list) __attribute__ ((__format__ (__scanf__, 1, 0)))
  620. ;
  621. int vsiprintf (char *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 2, 0)))
  622. ;
  623. int vsiscanf (const char *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__scanf__, 2, 0)))
  624. ;
  625. int vsniprintf (char *, size_t, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 3, 0)))
  626. ;
  627. int vsnprintf (char *, size_t, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 3, 0)))
  628. ;
  629. int vsscanf (const char *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__scanf__, 2, 0)))
  630. ;
  631. # 313 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/stdio.h" 3
  632. FILE * fdopen (int, const char *);
  633.  
  634. int fileno (FILE *);
  635. int getw (FILE *);
  636. int pclose (FILE *);
  637. FILE * popen (const char *, const char *);
  638. int putw (int, FILE *);
  639. void setbuffer (FILE *, char *, int);
  640. int setlinebuf (FILE *);
  641. int getc_unlocked (FILE *);
  642. int getchar_unlocked (void);
  643. void flockfile (FILE *);
  644. int ftrylockfile (FILE *);
  645. void funlockfile (FILE *);
  646. int putc_unlocked (int, FILE *);
  647. int putchar_unlocked (int);
  648. # 338 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/stdio.h" 3
  649. int dprintf (int, const char *, ...) __attribute__ ((__format__ (__printf__, 2, 3)))
  650. ;
  651.  
  652. FILE * fmemopen (void *, size_t, const char *);
  653.  
  654.  
  655. FILE * open_memstream (char **, size_t *);
  656.  
  657.  
  658.  
  659. int vdprintf (int, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 2, 0)))
  660. ;
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668. int _asiprintf_r (struct _reent *, char **, const char *, ...) __attribute__ ((__format__ (__printf__, 3, 4)))
  669. ;
  670. char * _asniprintf_r (struct _reent *, char *, size_t *, const char *, ...) __attribute__ ((__format__ (__printf__, 4, 5)))
  671. ;
  672. char * _asnprintf_r (struct _reent *, char *, size_t *, const char *, ...) __attribute__ ((__format__ (__printf__, 4, 5)))
  673. ;
  674. int _asprintf_r (struct _reent *, char **, const char *, ...) __attribute__ ((__format__ (__printf__, 3, 4)))
  675. ;
  676. int _diprintf_r (struct _reent *, int, const char *, ...) __attribute__ ((__format__ (__printf__, 3, 4)))
  677. ;
  678. int _dprintf_r (struct _reent *, int, const char *, ...) __attribute__ ((__format__ (__printf__, 3, 4)))
  679. ;
  680. int _fclose_r (struct _reent *, FILE *);
  681. int _fcloseall_r (struct _reent *);
  682. FILE * _fdopen_r (struct _reent *, int, const char *);
  683. int _fflush_r (struct _reent *, FILE *);
  684. int _fgetc_r (struct _reent *, FILE *);
  685. char * _fgets_r (struct _reent *, char *, int, FILE *);
  686.  
  687.  
  688.  
  689.  
  690. int _fgetpos_r (struct _reent *, FILE *, fpos_t *);
  691. int _fsetpos_r (struct _reent *, FILE *, const fpos_t *);
  692.  
  693. int _fiprintf_r (struct _reent *, FILE *, const char *, ...) __attribute__ ((__format__ (__printf__, 3, 4)))
  694. ;
  695. int _fiscanf_r (struct _reent *, FILE *, const char *, ...) __attribute__ ((__format__ (__scanf__, 3, 4)))
  696. ;
  697. FILE * _fmemopen_r (struct _reent *, void *, size_t, const char *);
  698. FILE * _fopen_r (struct _reent *, const char *, const char *);
  699. FILE * _freopen_r (struct _reent *, const char *, const char *, FILE *);
  700. int _fprintf_r (struct _reent *, FILE *, const char *, ...) __attribute__ ((__format__ (__printf__, 3, 4)))
  701. ;
  702. int _fpurge_r (struct _reent *, FILE *);
  703. int _fputc_r (struct _reent *, int, FILE *);
  704. int _fputs_r (struct _reent *, const char *, FILE *);
  705. size_t _fread_r (struct _reent *, void *, size_t _size, size_t _n, FILE *);
  706. int _fscanf_r (struct _reent *, FILE *, const char *, ...) __attribute__ ((__format__ (__scanf__, 3, 4)))
  707. ;
  708. int _fseek_r (struct _reent *, FILE *, long, int);
  709. int _fseeko_r (struct _reent *, FILE *, _off_t, int);
  710. long _ftell_r (struct _reent *, FILE *);
  711. _off_t _ftello_r (struct _reent *, FILE *);
  712. void _rewind_r (struct _reent *, FILE *);
  713. size_t _fwrite_r (struct _reent *, const void * , size_t _size, size_t _n, FILE *);
  714. int _getc_r (struct _reent *, FILE *);
  715. int _getc_unlocked_r (struct _reent *, FILE *);
  716. int _getchar_r (struct _reent *);
  717. int _getchar_unlocked_r (struct _reent *);
  718. char * _gets_r (struct _reent *, char *);
  719. int _iprintf_r (struct _reent *, const char *, ...) __attribute__ ((__format__ (__printf__, 2, 3)))
  720. ;
  721. int _iscanf_r (struct _reent *, const char *, ...) __attribute__ ((__format__ (__scanf__, 2, 3)))
  722. ;
  723. FILE * _open_memstream_r (struct _reent *, char **, size_t *);
  724. void _perror_r (struct _reent *, const char *);
  725. int _printf_r (struct _reent *, const char *, ...) __attribute__ ((__format__ (__printf__, 2, 3)))
  726. ;
  727. int _putc_r (struct _reent *, int, FILE *);
  728. int _putc_unlocked_r (struct _reent *, int, FILE *);
  729. int _putchar_unlocked_r (struct _reent *, int);
  730. int _putchar_r (struct _reent *, int);
  731. int _puts_r (struct _reent *, const char *);
  732. int _remove_r (struct _reent *, const char *);
  733. int _rename_r (struct _reent *, const char *_old, const char *_new)
  734. ;
  735. int _scanf_r (struct _reent *, const char *, ...) __attribute__ ((__format__ (__scanf__, 2, 3)))
  736. ;
  737. int _siprintf_r (struct _reent *, char *, const char *, ...) __attribute__ ((__format__ (__printf__, 3, 4)))
  738. ;
  739. int _siscanf_r (struct _reent *, const char *, const char *, ...) __attribute__ ((__format__ (__scanf__, 3, 4)))
  740. ;
  741. int _sniprintf_r (struct _reent *, char *, size_t, const char *, ...) __attribute__ ((__format__ (__printf__, 4, 5)))
  742. ;
  743. int _snprintf_r (struct _reent *, char *, size_t, const char *, ...) __attribute__ ((__format__ (__printf__, 4, 5)))
  744. ;
  745. int _sprintf_r (struct _reent *, char *, const char *, ...) __attribute__ ((__format__ (__printf__, 3, 4)))
  746. ;
  747. int _sscanf_r (struct _reent *, const char *, const char *, ...) __attribute__ ((__format__ (__scanf__, 3, 4)))
  748. ;
  749. char * _tempnam_r (struct _reent *, const char *, const char *);
  750. FILE * _tmpfile_r (struct _reent *);
  751. char * _tmpnam_r (struct _reent *, char *);
  752. int _ungetc_r (struct _reent *, int, FILE *);
  753. int _vasiprintf_r (struct _reent *, char **, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 3, 0)))
  754. ;
  755. char * _vasniprintf_r (struct _reent*, char *, size_t *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 4, 0)))
  756. ;
  757. char * _vasnprintf_r (struct _reent*, char *, size_t *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 4, 0)))
  758. ;
  759. int _vasprintf_r (struct _reent *, char **, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 3, 0)))
  760. ;
  761. int _vdiprintf_r (struct _reent *, int, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 3, 0)))
  762. ;
  763. int _vdprintf_r (struct _reent *, int, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 3, 0)))
  764. ;
  765. int _vfiprintf_r (struct _reent *, FILE *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 3, 0)))
  766. ;
  767. int _vfiscanf_r (struct _reent *, FILE *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__scanf__, 3, 0)))
  768. ;
  769. int _vfprintf_r (struct _reent *, FILE *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 3, 0)))
  770. ;
  771. int _vfscanf_r (struct _reent *, FILE *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__scanf__, 3, 0)))
  772. ;
  773. int _viprintf_r (struct _reent *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 2, 0)))
  774. ;
  775. int _viscanf_r (struct _reent *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__scanf__, 2, 0)))
  776. ;
  777. int _vprintf_r (struct _reent *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 2, 0)))
  778. ;
  779. int _vscanf_r (struct _reent *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__scanf__, 2, 0)))
  780. ;
  781. int _vsiprintf_r (struct _reent *, char *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 3, 0)))
  782. ;
  783. int _vsiscanf_r (struct _reent *, const char *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__scanf__, 3, 0)))
  784. ;
  785. int _vsniprintf_r (struct _reent *, char *, size_t, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 4, 0)))
  786. ;
  787. int _vsnprintf_r (struct _reent *, char *, size_t, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 4, 0)))
  788. ;
  789. int _vsprintf_r (struct _reent *, char *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__printf__, 3, 0)))
  790. ;
  791. int _vsscanf_r (struct _reent *, const char *, const char *, __gnuc_va_list) __attribute__ ((__format__ (__scanf__, 3, 0)))
  792. ;
  793.  
  794.  
  795.  
  796. int fpurge (FILE *);
  797. ssize_t __getdelim (char **, size_t *, int, FILE *);
  798. ssize_t __getline (char **, size_t *, FILE *);
  799. # 515 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/stdio.h" 3
  800. int __srget_r (struct _reent *, FILE *);
  801. int __swbuf_r (struct _reent *, int, FILE *);
  802. # 535 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/stdio.h" 3
  803. FILE *funopen (const void * __cookie, int (*__readfn)(void * __cookie, char *__buf, int __n), int (*__writefn)(void * __cookie, const char *__buf, int __n), fpos_t (*__seekfn)(void * __cookie, fpos_t __off, int __whence), int (*__closefn)(void * __cookie))
  804.  
  805.  
  806.  
  807. ;
  808. FILE *_funopen_r (struct _reent *, const void * __cookie, int (*__readfn)(void * __cookie, char *__buf, int __n), int (*__writefn)(void * __cookie, const char *__buf, int __n), fpos_t (*__seekfn)(void * __cookie, fpos_t __off, int __whence), int (*__closefn)(void * __cookie))
  809.  
  810.  
  811.  
  812. ;
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.  
  820. typedef ssize_t cookie_read_function_t(void *__cookie, char *__buf, size_t __n);
  821. typedef ssize_t cookie_write_function_t(void *__cookie, const char *__buf,
  822. size_t __n);
  823.  
  824.  
  825.  
  826.  
  827. typedef int cookie_seek_function_t(void *__cookie, off_t *__off, int __whence);
  828.  
  829. typedef int cookie_close_function_t(void *__cookie);
  830. typedef struct
  831. {
  832.  
  833.  
  834. cookie_read_function_t *read;
  835. cookie_write_function_t *write;
  836. cookie_seek_function_t *seek;
  837. cookie_close_function_t *close;
  838. } cookie_io_functions_t;
  839. FILE *fopencookie (void *__cookie, const char *__mode, cookie_io_functions_t __functions)
  840. ;
  841. FILE *_fopencookie_r (struct _reent *, void *__cookie, const char *__mode, cookie_io_functions_t __functions)
  842. ;
  843. # 683 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/stdio.h" 3
  844.  
  845. # 2 "zigzag/zigzag.c" 2
  846. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/lib/gcc/epiphany-elf/4.8.2/include/stdint.h" 1 3 4
  847. # 9 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/lib/gcc/epiphany-elf/4.8.2/include/stdint.h" 3 4
  848. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/stdint.h" 1 3 4
  849. # 41 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/stdint.h" 3 4
  850. typedef signed char int8_t ;
  851. typedef unsigned char uint8_t ;
  852.  
  853.  
  854.  
  855.  
  856. typedef signed char int_least8_t;
  857. typedef unsigned char uint_least8_t;
  858.  
  859.  
  860.  
  861.  
  862. typedef signed short int16_t;
  863. typedef unsigned short uint16_t;
  864. # 67 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/stdint.h" 3 4
  865. typedef int16_t int_least16_t;
  866. typedef uint16_t uint_least16_t;
  867. # 79 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/stdint.h" 3 4
  868. typedef signed long int32_t;
  869. typedef unsigned long uint32_t;
  870. # 97 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/stdint.h" 3 4
  871. typedef int32_t int_least32_t;
  872. typedef uint32_t uint_least32_t;
  873. # 119 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/stdint.h" 3 4
  874. typedef signed long long int64_t;
  875. typedef unsigned long long uint64_t;
  876. # 129 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/stdint.h" 3 4
  877. typedef int64_t int_least64_t;
  878. typedef uint64_t uint_least64_t;
  879. # 159 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/stdint.h" 3 4
  880. typedef signed int int_fast8_t;
  881. typedef unsigned int uint_fast8_t;
  882.  
  883.  
  884.  
  885.  
  886. typedef signed int int_fast16_t;
  887. typedef unsigned int uint_fast16_t;
  888.  
  889.  
  890.  
  891.  
  892. typedef signed int int_fast32_t;
  893. typedef unsigned int uint_fast32_t;
  894. # 213 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/stdint.h" 3 4
  895. typedef int_least64_t int_fast64_t;
  896. typedef uint_least64_t uint_fast64_t;
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904. typedef long long int intmax_t;
  905. # 231 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/stdint.h" 3 4
  906. typedef long long unsigned int uintmax_t;
  907. # 243 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/stdint.h" 3 4
  908. typedef signed long int intptr_t;
  909. typedef unsigned long int uintptr_t;
  910. # 10 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/lib/gcc/epiphany-elf/4.8.2/include/stdint.h" 2 3 4
  911. # 3 "zigzag/zigzag.c" 2
  912. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/string.h" 1 3
  913. # 12 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/string.h" 3
  914. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/cdefs.h" 1 3
  915. # 13 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/string.h" 2 3
  916.  
  917.  
  918. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/lib/gcc/epiphany-elf/4.8.2/include/stddef.h" 1 3 4
  919. # 16 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/string.h" 2 3
  920.  
  921.  
  922.  
  923.  
  924.  
  925.  
  926.  
  927. void * memchr (const void *, int, size_t);
  928. int memcmp (const void *, const void *, size_t);
  929. void * memcpy (void *, const void *, size_t);
  930. void * memmove (void *, const void *, size_t);
  931. void * memset (void *, int, size_t);
  932. char *strcat (char *, const char *);
  933. char *strchr (const char *, int);
  934. int strcmp (const char *, const char *);
  935. int strcoll (const char *, const char *);
  936. char *strcpy (char *, const char *);
  937. size_t strcspn (const char *, const char *);
  938. char *strerror (int);
  939. size_t strlen (const char *);
  940. char *strncat (char *, const char *, size_t);
  941. int strncmp (const char *, const char *, size_t);
  942. char *strncpy (char *, const char *, size_t);
  943. char *strpbrk (const char *, const char *);
  944. char *strrchr (const char *, int);
  945. size_t strspn (const char *, const char *);
  946. char *strstr (const char *, const char *);
  947.  
  948.  
  949. char *strtok (char *, const char *);
  950.  
  951.  
  952. size_t strxfrm (char *, const char *, size_t);
  953.  
  954.  
  955. char *strtok_r (char *, const char *, char **);
  956.  
  957. int bcmp (const void *, const void *, size_t);
  958. void bcopy (const void *, void *, size_t);
  959. void bzero (void *, size_t);
  960. int ffs (int);
  961. char *index (const char *, int);
  962. void * memccpy (void *, const void *, int, size_t);
  963. void * mempcpy (void *, const void *, size_t);
  964. void * memmem (const void *, size_t, const void *, size_t);
  965. char *rindex (const char *, int);
  966. char *stpcpy (char *, const char *);
  967. char *stpncpy (char *, const char *, size_t);
  968. int strcasecmp (const char *, const char *);
  969. char *strcasestr (const char *, const char *);
  970. char *strchrnul (const char *, int);
  971. char *strdup (const char *);
  972. char *_strdup_r (struct _reent *, const char *);
  973. char *strndup (const char *, size_t);
  974. char *_strndup_r (struct _reent *, const char *, size_t);
  975. # 79 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/string.h" 3
  976. int strerror_r (int, char *, size_t) __asm__ ("_" "__xpg_strerror_r");
  977.  
  978.  
  979.  
  980.  
  981.  
  982. size_t strlcat (char *, const char *, size_t);
  983. size_t strlcpy (char *, const char *, size_t);
  984. int strncasecmp (const char *, const char *, size_t);
  985. size_t strnlen (const char *, size_t);
  986. char *strsep (char **, const char *);
  987. char *strlwr (char *);
  988. char *strupr (char *);
  989.  
  990. char *strsignal (int __signo);
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997. char * _strerror_r (struct _reent *, int, int, int *);
  998. # 132 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/string.h" 3
  999. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/string.h" 1 3
  1000. # 133 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/string.h" 2 3
  1001.  
  1002.  
  1003. # 4 "zigzag/zigzag.c" 2
  1004. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/stdlib.h" 1 3
  1005. # 10 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/stdlib.h" 3
  1006. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/machine/ieeefp.h" 1 3
  1007. # 11 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/stdlib.h" 2 3
  1008.  
  1009.  
  1010.  
  1011.  
  1012. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/lib/gcc/epiphany-elf/4.8.2/include/stddef.h" 1 3 4
  1013. # 16 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/stdlib.h" 2 3
  1014.  
  1015.  
  1016. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/machine/stdlib.h" 1 3
  1017. static __inline__ long int
  1018. random (void)
  1019. {
  1020. extern int rand(void);
  1021.  
  1022. return rand ();
  1023. }
  1024.  
  1025. static __inline__ void
  1026. srandom (unsigned int seed)
  1027. {
  1028. void srand(unsigned int seed);
  1029.  
  1030. srand (seed);
  1031. }
  1032. # 19 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/stdlib.h" 2 3
  1033.  
  1034. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/alloca.h" 1 3
  1035. # 21 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/stdlib.h" 2 3
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044. typedef struct
  1045. {
  1046. int quot;
  1047. int rem;
  1048. } div_t;
  1049.  
  1050. typedef struct
  1051. {
  1052. long quot;
  1053. long rem;
  1054. } ldiv_t;
  1055.  
  1056.  
  1057. typedef struct
  1058. {
  1059. long long int quot;
  1060. long long int rem;
  1061. } lldiv_t;
  1062. # 58 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/stdlib.h" 3
  1063. int __locale_mb_cur_max (void);
  1064.  
  1065.  
  1066.  
  1067. void abort (void) __attribute__ ((noreturn));
  1068. int abs (int);
  1069. int atexit (void (*__func)(void));
  1070. double atof (const char *__nptr);
  1071.  
  1072. float atoff (const char *__nptr);
  1073.  
  1074. int atoi (const char *__nptr);
  1075. int _atoi_r (struct _reent *, const char *__nptr);
  1076. long atol (const char *__nptr);
  1077. long _atol_r (struct _reent *, const char *__nptr);
  1078. void * bsearch (const void * __key, const void * __base, size_t __nmemb, size_t __size, int (* _compar) (const void *, const void *))
  1079.  
  1080.  
  1081.  
  1082. ;
  1083. void * calloc (size_t __nmemb, size_t __size) ;
  1084. div_t div (int __numer, int __denom);
  1085. void exit (int __status) __attribute__ ((noreturn));
  1086. void free (void *) ;
  1087. char * getenv (const char *__string);
  1088. char * _getenv_r (struct _reent *, const char *__string);
  1089. char * _findenv (const char *, int *);
  1090. char * _findenv_r (struct _reent *, const char *, int *);
  1091.  
  1092. extern char *suboptarg;
  1093. int getsubopt (char **, char * const *, char **);
  1094.  
  1095. long labs (long);
  1096. ldiv_t ldiv (long __numer, long __denom);
  1097. void * malloc (size_t __size) ;
  1098. int mblen (const char *, size_t);
  1099. int _mblen_r (struct _reent *, const char *, size_t, _mbstate_t *);
  1100. int mbtowc (wchar_t *, const char *, size_t);
  1101. int _mbtowc_r (struct _reent *, wchar_t *, const char *, size_t, _mbstate_t *);
  1102. int wctomb (char *, wchar_t);
  1103. int _wctomb_r (struct _reent *, char *, wchar_t, _mbstate_t *);
  1104. size_t mbstowcs (wchar_t *, const char *, size_t);
  1105. size_t _mbstowcs_r (struct _reent *, wchar_t *, const char *, size_t, _mbstate_t *);
  1106. size_t wcstombs (char *, const wchar_t *, size_t);
  1107. size_t _wcstombs_r (struct _reent *, char *, const wchar_t *, size_t, _mbstate_t *);
  1108.  
  1109.  
  1110. char * mkdtemp (char *);
  1111. int mkostemp (char *, int);
  1112. int mkostemps (char *, int, int);
  1113. int mkstemp (char *);
  1114. int mkstemps (char *, int);
  1115. char * mktemp (char *) __attribute__ ((__warning__ ("the use of `mktemp' is dangerous; use `mkstemp' instead")));
  1116.  
  1117. char * _mkdtemp_r (struct _reent *, char *);
  1118. int _mkostemp_r (struct _reent *, char *, int);
  1119. int _mkostemps_r (struct _reent *, char *, int, int);
  1120. int _mkstemp_r (struct _reent *, char *);
  1121. int _mkstemps_r (struct _reent *, char *, int);
  1122. char * _mktemp_r (struct _reent *, char *) __attribute__ ((__warning__ ("the use of `mktemp' is dangerous; use `mkstemp' instead")));
  1123.  
  1124. void qsort (void * __base, size_t __nmemb, size_t __size, int(*_compar)(const void *, const void *));
  1125. int rand (void);
  1126. void * realloc (void * __r, size_t __size) ;
  1127.  
  1128. void * reallocf (void * __r, size_t __size);
  1129.  
  1130. void srand (unsigned __seed);
  1131. double strtod (const char *__n, char **__end_PTR);
  1132. double _strtod_r (struct _reent *,const char *__n, char **__end_PTR);
  1133. float strtof (const char *__n, char **__end_PTR);
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139.  
  1140. long strtol (const char *__n, char **__end_PTR, int __base);
  1141. long _strtol_r (struct _reent *,const char *__n, char **__end_PTR, int __base);
  1142. unsigned long strtoul (const char *__n, char **__end_PTR, int __base);
  1143. unsigned long _strtoul_r (struct _reent *,const char *__n, char **__end_PTR, int __base);
  1144.  
  1145. int system (const char *__string);
  1146.  
  1147.  
  1148. long a64l (const char *__input);
  1149. char * l64a (long __input);
  1150. char * _l64a_r (struct _reent *,long __input);
  1151. int on_exit (void (*__func)(int, void *),void * __arg);
  1152. void _Exit (int __status) __attribute__ ((noreturn));
  1153. int putenv (char *__string);
  1154. int _putenv_r (struct _reent *, char *__string);
  1155. void * _reallocf_r (struct _reent *, void *, size_t);
  1156. int setenv (const char *__string, const char *__value, int __overwrite);
  1157. int _setenv_r (struct _reent *, const char *__string, const char *__value, int __overwrite);
  1158.  
  1159. char * gcvt (double,int,char *);
  1160. char * gcvtf (float,int,char *);
  1161. char * fcvt (double,int,int *,int *);
  1162. char * fcvtf (float,int,int *,int *);
  1163. char * ecvt (double,int,int *,int *);
  1164. char * ecvtbuf (double, int, int*, int*, char *);
  1165. char * fcvtbuf (double, int, int*, int*, char *);
  1166. char * ecvtf (float,int,int *,int *);
  1167. char * dtoa (double, int, int, int *, int*, char**);
  1168. int rand_r (unsigned *__seed);
  1169.  
  1170. double drand48 (void);
  1171. double _drand48_r (struct _reent *);
  1172. double erand48 (unsigned short [3]);
  1173. double _erand48_r (struct _reent *, unsigned short [3]);
  1174. long jrand48 (unsigned short [3]);
  1175. long _jrand48_r (struct _reent *, unsigned short [3]);
  1176. void lcong48 (unsigned short [7]);
  1177. void _lcong48_r (struct _reent *, unsigned short [7]);
  1178. long lrand48 (void);
  1179. long _lrand48_r (struct _reent *);
  1180. long mrand48 (void);
  1181. long _mrand48_r (struct _reent *);
  1182. long nrand48 (unsigned short [3]);
  1183. long _nrand48_r (struct _reent *, unsigned short [3]);
  1184. unsigned short *
  1185. seed48 (unsigned short [3]);
  1186. unsigned short *
  1187. _seed48_r (struct _reent *, unsigned short [3]);
  1188. void srand48 (long);
  1189. void _srand48_r (struct _reent *, long);
  1190. long long atoll (const char *__nptr);
  1191. long long _atoll_r (struct _reent *, const char *__nptr);
  1192. long long llabs (long long);
  1193. lldiv_t lldiv (long long __numer, long long __denom);
  1194. long long strtoll (const char *__n, char **__end_PTR, int __base);
  1195. long long _strtoll_r (struct _reent *, const char *__n, char **__end_PTR, int __base);
  1196. unsigned long long strtoull (const char *__n, char **__end_PTR, int __base);
  1197. unsigned long long _strtoull_r (struct _reent *, const char *__n, char **__end_PTR, int __base);
  1198.  
  1199.  
  1200. void cfree (void *);
  1201. int unsetenv (const char *__string);
  1202. int _unsetenv_r (struct _reent *, const char *__string);
  1203. # 206 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/stdlib.h" 3
  1204. char * _dtoa_r (struct _reent *, double, int, int, int *, int*, char**);
  1205.  
  1206. void * _malloc_r (struct _reent *, size_t) ;
  1207. void * _calloc_r (struct _reent *, size_t, size_t) ;
  1208. void _free_r (struct _reent *, void *) ;
  1209. void * _realloc_r (struct _reent *, void *, size_t) ;
  1210. void _mstats_r (struct _reent *, char *);
  1211.  
  1212. int _system_r (struct _reent *, const char *);
  1213.  
  1214. void __eprintf (const char *, const char *, unsigned int, const char *);
  1215.  
  1216.  
  1217.  
  1218. extern long double strtold (const char *, char **);
  1219. extern long double wcstold (const wchar_t *, wchar_t **);
  1220.  
  1221.  
  1222.  
  1223. # 5 "zigzag/zigzag.c" 2
  1224. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/unistd.h" 1 3
  1225.  
  1226.  
  1227.  
  1228. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/unistd.h" 1 3
  1229. # 13 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/unistd.h" 3
  1230. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/lib/gcc/epiphany-elf/4.8.2/include/stddef.h" 1 3 4
  1231. # 14 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/unistd.h" 2 3
  1232.  
  1233. extern char **environ;
  1234.  
  1235. void _exit (int __status ) __attribute__ ((noreturn));
  1236.  
  1237. int access (const char *__path, int __amode );
  1238. unsigned alarm (unsigned __secs );
  1239. int chdir (const char *__path );
  1240. int chmod (const char *__path, mode_t __mode );
  1241.  
  1242. int chown (const char *__path, uid_t __owner, gid_t __group );
  1243.  
  1244.  
  1245.  
  1246.  
  1247. int close (int __fildes );
  1248.  
  1249.  
  1250.  
  1251. char * ctermid (char *__s );
  1252. char * cuserid (char *__s );
  1253.  
  1254.  
  1255.  
  1256. int dup (int __fildes );
  1257. int dup2 (int __fildes, int __fildes2 );
  1258.  
  1259.  
  1260.  
  1261.  
  1262.  
  1263.  
  1264. int execl (const char *__path, const char *, ... );
  1265. int execle (const char *__path, const char *, ... );
  1266. int execlp (const char *__file, const char *, ... );
  1267.  
  1268.  
  1269.  
  1270. int execv (const char *__path, char * const __argv[] );
  1271. int execve (const char *__path, char * const __argv[], char * const __envp[] );
  1272. int execvp (const char *__file, char * const __argv[] );
  1273.  
  1274.  
  1275.  
  1276.  
  1277.  
  1278.  
  1279.  
  1280. int fchmod (int __fildes, mode_t __mode );
  1281.  
  1282. int fchown (int __fildes, uid_t __owner, gid_t __group );
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288. pid_t fork (void );
  1289. long fpathconf (int __fd, int __name );
  1290. int fsync (int __fd);
  1291. int fdatasync (int __fd);
  1292.  
  1293.  
  1294.  
  1295. char * getcwd (char *__buf, size_t __size );
  1296.  
  1297.  
  1298.  
  1299.  
  1300. gid_t getegid (void );
  1301. uid_t geteuid (void );
  1302. gid_t getgid (void );
  1303.  
  1304. int getgroups (int __gidsetsize, gid_t __grouplist[] );
  1305.  
  1306.  
  1307.  
  1308. char * getlogin (void );
  1309.  
  1310.  
  1311.  
  1312. char * getpass (const char *__prompt);
  1313. int getpagesize (void);
  1314.  
  1315.  
  1316.  
  1317. pid_t getpgid (pid_t);
  1318. pid_t getpgrp (void );
  1319. pid_t getpid (void );
  1320. pid_t getppid (void );
  1321.  
  1322.  
  1323.  
  1324.  
  1325. uid_t getuid (void );
  1326.  
  1327.  
  1328.  
  1329.  
  1330.  
  1331.  
  1332. int isatty (int __fildes );
  1333.  
  1334. int lchown (const char *__path, uid_t __owner, gid_t __group );
  1335.  
  1336. int link (const char *__path1, const char *__path2 );
  1337.  
  1338.  
  1339.  
  1340. int nice (int __nice_value );
  1341.  
  1342. off_t lseek (int __fildes, off_t __offset, int __whence );
  1343. # 133 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/unistd.h" 3
  1344. long pathconf (const char *__path, int __name );
  1345. int pause (void );
  1346.  
  1347.  
  1348.  
  1349. int pipe (int __fildes[2] );
  1350.  
  1351.  
  1352.  
  1353. ssize_t pread (int __fd, void *__buf, size_t __nbytes, off_t __offset);
  1354. ssize_t pwrite (int __fd, const void *__buf, size_t __nbytes, off_t __offset);
  1355. int read (int __fd, void *__buf, size_t __nbyte );
  1356.  
  1357.  
  1358.  
  1359.  
  1360. int rmdir (const char *__path );
  1361.  
  1362.  
  1363.  
  1364. void * sbrk (ptrdiff_t __incr);
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370. int setgid (gid_t __gid );
  1371.  
  1372.  
  1373.  
  1374.  
  1375. int setpgid (pid_t __pid, pid_t __pgid );
  1376. int setpgrp (void );
  1377.  
  1378.  
  1379.  
  1380.  
  1381. pid_t setsid (void );
  1382.  
  1383. int setuid (uid_t __uid );
  1384.  
  1385.  
  1386.  
  1387.  
  1388. unsigned sleep (unsigned int __seconds );
  1389. void swab (const void *, void *, ssize_t);
  1390. long sysconf (int __name );
  1391. pid_t tcgetpgrp (int __fildes );
  1392. int tcsetpgrp (int __fildes, pid_t __pgrp_id );
  1393. char * ttyname (int __fildes );
  1394.  
  1395.  
  1396.  
  1397. int unlink (const char *__path );
  1398. int usleep (useconds_t __useconds);
  1399. int vhangup (void );
  1400. int write (int __fd, const void *__buf, size_t __nbyte );
  1401.  
  1402.  
  1403.  
  1404.  
  1405.  
  1406.  
  1407. extern char *optarg;
  1408. extern int optind, opterr, optopt;
  1409. int getopt(int, char * const [], const char *);
  1410. extern int optreset;
  1411.  
  1412.  
  1413.  
  1414. pid_t vfork (void );
  1415. # 247 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/sys/unistd.h" 3
  1416. ssize_t readlink (const char *__path, char *__buf, size_t __buflen);
  1417.  
  1418.  
  1419.  
  1420. int symlink (const char *__name1, const char *__name2);
  1421. # 5 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/unistd.h" 2 3
  1422. # 6 "zigzag/zigzag.c" 2
  1423.  
  1424. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_lib.h" 1 3
  1425. # 29 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_lib.h" 3
  1426. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_common.h" 1 3
  1427. # 30 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_lib.h" 2 3
  1428. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_types.h" 1 3
  1429. # 36 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_types.h" 3
  1430. typedef enum {
  1431. E_FALSE = 0,
  1432. E_TRUE = 1,
  1433. } e_bool_t;
  1434.  
  1435.  
  1436.  
  1437. typedef enum {
  1438. E_OK = 0,
  1439. E_ERR = -1,
  1440. E_WARN = -2,
  1441. } e_return_stat_t;
  1442. # 31 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_lib.h" 2 3
  1443. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_regs.h" 1 3
  1444. # 29 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_regs.h" 3
  1445. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_types.h" 1 3
  1446. # 30 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_regs.h" 2 3
  1447.  
  1448.  
  1449.  
  1450. typedef enum {
  1451. E_CORE_GP_REG_BASE = 0xf0000,
  1452. E_REG_R0 = E_CORE_GP_REG_BASE + 0x0000,
  1453. E_REG_R1 = E_CORE_GP_REG_BASE + 0x0004,
  1454. E_REG_R2 = E_CORE_GP_REG_BASE + 0x0008,
  1455. E_REG_R3 = E_CORE_GP_REG_BASE + 0x000c,
  1456. E_REG_R4 = E_CORE_GP_REG_BASE + 0x0010,
  1457. E_REG_R5 = E_CORE_GP_REG_BASE + 0x0014,
  1458. E_REG_R6 = E_CORE_GP_REG_BASE + 0x0018,
  1459. E_REG_R7 = E_CORE_GP_REG_BASE + 0x001c,
  1460. E_REG_R8 = E_CORE_GP_REG_BASE + 0x0020,
  1461. E_REG_R9 = E_CORE_GP_REG_BASE + 0x0024,
  1462. E_REG_R10 = E_CORE_GP_REG_BASE + 0x0028,
  1463. E_REG_R11 = E_CORE_GP_REG_BASE + 0x002c,
  1464. E_REG_R12 = E_CORE_GP_REG_BASE + 0x0030,
  1465. E_REG_R13 = E_CORE_GP_REG_BASE + 0x0034,
  1466. E_REG_R14 = E_CORE_GP_REG_BASE + 0x0038,
  1467. E_REG_R15 = E_CORE_GP_REG_BASE + 0x003c,
  1468. E_REG_R16 = E_CORE_GP_REG_BASE + 0x0040,
  1469. E_REG_R17 = E_CORE_GP_REG_BASE + 0x0044,
  1470. E_REG_R18 = E_CORE_GP_REG_BASE + 0x0048,
  1471. E_REG_R19 = E_CORE_GP_REG_BASE + 0x004c,
  1472. E_REG_R20 = E_CORE_GP_REG_BASE + 0x0050,
  1473. E_REG_R21 = E_CORE_GP_REG_BASE + 0x0054,
  1474. E_REG_R22 = E_CORE_GP_REG_BASE + 0x0058,
  1475. E_REG_R23 = E_CORE_GP_REG_BASE + 0x005c,
  1476. E_REG_R24 = E_CORE_GP_REG_BASE + 0x0060,
  1477. E_REG_R25 = E_CORE_GP_REG_BASE + 0x0064,
  1478. E_REG_R26 = E_CORE_GP_REG_BASE + 0x0068,
  1479. E_REG_R27 = E_CORE_GP_REG_BASE + 0x006c,
  1480. E_REG_R28 = E_CORE_GP_REG_BASE + 0x0070,
  1481. E_REG_R29 = E_CORE_GP_REG_BASE + 0x0074,
  1482. E_REG_R30 = E_CORE_GP_REG_BASE + 0x0078,
  1483. E_REG_R31 = E_CORE_GP_REG_BASE + 0x007c,
  1484. E_REG_R32 = E_CORE_GP_REG_BASE + 0x0080,
  1485. E_REG_R33 = E_CORE_GP_REG_BASE + 0x0084,
  1486. E_REG_R34 = E_CORE_GP_REG_BASE + 0x0088,
  1487. E_REG_R35 = E_CORE_GP_REG_BASE + 0x008c,
  1488. E_REG_R36 = E_CORE_GP_REG_BASE + 0x0090,
  1489. E_REG_R37 = E_CORE_GP_REG_BASE + 0x0094,
  1490. E_REG_R38 = E_CORE_GP_REG_BASE + 0x0098,
  1491. E_REG_R39 = E_CORE_GP_REG_BASE + 0x009c,
  1492. E_REG_R40 = E_CORE_GP_REG_BASE + 0x00a0,
  1493. E_REG_R41 = E_CORE_GP_REG_BASE + 0x00a4,
  1494. E_REG_R42 = E_CORE_GP_REG_BASE + 0x00a8,
  1495. E_REG_R43 = E_CORE_GP_REG_BASE + 0x00ac,
  1496. E_REG_R44 = E_CORE_GP_REG_BASE + 0x00b0,
  1497. E_REG_R45 = E_CORE_GP_REG_BASE + 0x00b4,
  1498. E_REG_R46 = E_CORE_GP_REG_BASE + 0x00b8,
  1499. E_REG_R47 = E_CORE_GP_REG_BASE + 0x00bc,
  1500. E_REG_R48 = E_CORE_GP_REG_BASE + 0x00c0,
  1501. E_REG_R49 = E_CORE_GP_REG_BASE + 0x00c4,
  1502. E_REG_R50 = E_CORE_GP_REG_BASE + 0x00c8,
  1503. E_REG_R51 = E_CORE_GP_REG_BASE + 0x00cc,
  1504. E_REG_R52 = E_CORE_GP_REG_BASE + 0x00d0,
  1505. E_REG_R53 = E_CORE_GP_REG_BASE + 0x00d4,
  1506. E_REG_R54 = E_CORE_GP_REG_BASE + 0x00d8,
  1507. E_REG_R55 = E_CORE_GP_REG_BASE + 0x00dc,
  1508. E_REG_R56 = E_CORE_GP_REG_BASE + 0x00e0,
  1509. E_REG_R57 = E_CORE_GP_REG_BASE + 0x00e4,
  1510. E_REG_R58 = E_CORE_GP_REG_BASE + 0x00e8,
  1511. E_REG_R59 = E_CORE_GP_REG_BASE + 0x00ec,
  1512. E_REG_R60 = E_CORE_GP_REG_BASE + 0x00f0,
  1513. E_REG_R61 = E_CORE_GP_REG_BASE + 0x00f4,
  1514. E_REG_R62 = E_CORE_GP_REG_BASE + 0x00f8,
  1515. E_REG_R63 = E_CORE_GP_REG_BASE + 0x00fc,
  1516. } e_gp_reg_id_t;
  1517.  
  1518.  
  1519. typedef enum {
  1520. E_CORE_SP_REG_BASE = 0xf0000,
  1521.  
  1522. E_REG_CONFIG = E_CORE_SP_REG_BASE + 0x0400,
  1523. E_REG_STATUS = E_CORE_SP_REG_BASE + 0x0404,
  1524. E_REG_PC = E_CORE_SP_REG_BASE + 0x0408,
  1525. E_REG_DEBUGSTATUS = E_CORE_SP_REG_BASE + 0x040c,
  1526. E_REG_LC = E_CORE_SP_REG_BASE + 0x0414,
  1527. E_REG_LS = E_CORE_SP_REG_BASE + 0x0418,
  1528. E_REG_LE = E_CORE_SP_REG_BASE + 0x041c,
  1529. E_REG_IRET = E_CORE_SP_REG_BASE + 0x0420,
  1530. E_REG_IMASK = E_CORE_SP_REG_BASE + 0x0424,
  1531. E_REG_ILAT = E_CORE_SP_REG_BASE + 0x0428,
  1532. E_REG_ILATST = E_CORE_SP_REG_BASE + 0x042C,
  1533. E_REG_ILATCL = E_CORE_SP_REG_BASE + 0x0430,
  1534. E_REG_IPEND = E_CORE_SP_REG_BASE + 0x0434,
  1535. E_REG_CTIMER0 = E_CORE_SP_REG_BASE + 0x0438,
  1536. E_REG_CTIMER1 = E_CORE_SP_REG_BASE + 0x043C,
  1537. E_REG_FSTATUS = E_CORE_SP_REG_BASE + 0x0440,
  1538. E_REG_DEBUGCMD = E_CORE_SP_REG_BASE + 0x0448,
  1539.  
  1540.  
  1541. E_REG_DMA0CONFIG = E_CORE_SP_REG_BASE + 0x0500,
  1542. E_REG_DMA0STRIDE = E_CORE_SP_REG_BASE + 0x0504,
  1543. E_REG_DMA0COUNT = E_CORE_SP_REG_BASE + 0x0508,
  1544. E_REG_DMA0SRCADDR = E_CORE_SP_REG_BASE + 0x050C,
  1545. E_REG_DMA0DSTADDR = E_CORE_SP_REG_BASE + 0x0510,
  1546. E_REG_DMA0AUTODMA0 = E_CORE_SP_REG_BASE + 0x0514,
  1547. E_REG_DMA0AUTODMA1 = E_CORE_SP_REG_BASE + 0x0518,
  1548. E_REG_DMA0STATUS = E_CORE_SP_REG_BASE + 0x051C,
  1549. E_REG_DMA1CONFIG = E_CORE_SP_REG_BASE + 0x0520,
  1550. E_REG_DMA1STRIDE = E_CORE_SP_REG_BASE + 0x0524,
  1551. E_REG_DMA1COUNT = E_CORE_SP_REG_BASE + 0x0528,
  1552. E_REG_DMA1SRCADDR = E_CORE_SP_REG_BASE + 0x052C,
  1553. E_REG_DMA1DSTADDR = E_CORE_SP_REG_BASE + 0x0530,
  1554. E_REG_DMA1AUTODMA0 = E_CORE_SP_REG_BASE + 0x0534,
  1555. E_REG_DMA1AUTODMA1 = E_CORE_SP_REG_BASE + 0x0538,
  1556. E_REG_DMA1STATUS = E_CORE_SP_REG_BASE + 0x053C,
  1557.  
  1558.  
  1559. E_REG_MEMSTATUS = E_CORE_SP_REG_BASE + 0x0604,
  1560. E_REG_MEMPROTECT = E_CORE_SP_REG_BASE + 0x0608,
  1561.  
  1562.  
  1563. E_REG_MESHCFG = E_CORE_SP_REG_BASE + 0x0700,
  1564. E_REG_COREID = E_CORE_SP_REG_BASE + 0x0704,
  1565. E_REG_CORE_RESET = E_CORE_SP_REG_BASE + 0x070c,
  1566. } e_core_reg_id_t;
  1567.  
  1568.  
  1569. typedef enum {
  1570. E_CHIP_REG_BASE = 0xf0000,
  1571. E_REG_IO_LINK_MODE_CFG = E_CHIP_REG_BASE + 0x0300,
  1572. E_REG_IO_LINK_TX_CFG = E_CHIP_REG_BASE + 0x0304,
  1573. E_REG_IO_LINK_RX_CFG = E_CHIP_REG_BASE + 0x0308,
  1574. E_REG_IO_GPIO_CFG = E_CHIP_REG_BASE + 0x030c,
  1575. E_REG_IO_FLAG_CFG = E_CHIP_REG_BASE + 0x0318,
  1576. E_REG_IO_SYNC_CFG = E_CHIP_REG_BASE + 0x031c,
  1577. E_REG_IO_HALT_CFG = E_CHIP_REG_BASE + 0x0320,
  1578. E_REG_IO_RESET = E_CHIP_REG_BASE + 0x0324,
  1579. E_REG_IO_LINK_DEBUG = E_CHIP_REG_BASE + 0x0328,
  1580. } e_chip_reg_id_t;
  1581.  
  1582.  
  1583. unsigned e_reg_read(e_core_reg_id_t reg_id);
  1584. void e_reg_write(e_core_reg_id_t reg_id, unsigned val);
  1585. # 32 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_lib.h" 2 3
  1586. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_dma.h" 1 3
  1587. # 29 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_dma.h" 3
  1588. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/lib/gcc/epiphany-elf/4.8.2/include/stddef.h" 1 3 4
  1589. # 30 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_dma.h" 2 3
  1590.  
  1591.  
  1592.  
  1593.  
  1594.  
  1595.  
  1596. typedef enum
  1597. {
  1598. E_DMA_ENABLE = (1<<0),
  1599. E_DMA_MASTER = (1<<1),
  1600. E_DMA_CHAIN = (1<<2),
  1601. E_DMA_STARTUP = (1<<3),
  1602. E_DMA_IRQEN = (1<<4),
  1603. E_DMA_BYTE = (0<<5),
  1604. E_DMA_HWORD = (1<<5),
  1605. E_DMA_WORD = (2<<5),
  1606. E_DMA_DWORD = (3<<5),
  1607. E_DMA_MSGMODE = (1<<10),
  1608. E_DMA_SHIFT_SRC_IN = (1<<12),
  1609. E_DMA_SHIFT_DST_IN = (1<<13),
  1610. E_DMA_SHIFT_SRC_OUT = (1<<14),
  1611. E_DMA_SHIFT_DST_OUT = (1<<15),
  1612. } e_dma_config_t;
  1613.  
  1614. typedef enum
  1615. {
  1616. E_DMA_0 = 0,
  1617. E_DMA_1 = 1,
  1618. } e_dma_id_t;
  1619.  
  1620. typedef struct
  1621. {
  1622. unsigned config;
  1623. unsigned inner_stride;
  1624. unsigned count;
  1625. unsigned outer_stride;
  1626. void *src_addr;
  1627. void *dst_addr;
  1628. } __attribute__ ((aligned (8))) e_dma_desc_t;
  1629.  
  1630.  
  1631. int e_dma_start(e_dma_desc_t *descriptor, e_dma_id_t chan);
  1632. int e_dma_busy(e_dma_id_t chan);
  1633. void e_dma_wait(e_dma_id_t chan);
  1634. int e_dma_copy(void *dst, void *src, size_t n);
  1635. void e_dma_set_desc(e_dma_id_t chan,
  1636. unsigned config, e_dma_desc_t *next_desc,
  1637. unsigned strd_i_src, unsigned strd_i_dst,
  1638. unsigned count_i, unsigned count_o,
  1639. unsigned strd_o_src, unsigned strd_o_dst,
  1640. void *addr_src, void *addr_dst,
  1641. e_dma_desc_t *desc);
  1642. # 33 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_lib.h" 2 3
  1643. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_ctimers.h" 1 3
  1644. # 42 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_ctimers.h" 3
  1645. typedef enum
  1646. {
  1647. E_CTIMER_0 = 0,
  1648. E_CTIMER_1 = 1
  1649. } e_ctimer_id_t;
  1650.  
  1651.  
  1652.  
  1653.  
  1654. typedef enum
  1655. {
  1656. E_CTIMER_OFF = 0x0,
  1657. E_CTIMER_CLK = 0x1,
  1658. E_CTIMER_IDLE = 0x2,
  1659. E_CTIMER_IALU_INST = 0x4,
  1660. E_CTIMER_FPU_INST = 0x5,
  1661. E_CTIMER_DUAL_INST = 0x6,
  1662. E_CTIMER_E1_STALLS = 0x7,
  1663. E_CTIMER_RA_STALLS = 0x8,
  1664. E_CTIMER_EXT_FETCH_STALLS = 0xc,
  1665. E_CTIMER_EXT_LOAD_STALLS = 0xd,
  1666.  
  1667. } e_ctimer_config_t;
  1668.  
  1669.  
  1670.  
  1671.  
  1672.  
  1673.  
  1674. unsigned e_ctimer_get(e_ctimer_id_t timer);
  1675. unsigned e_ctimer_set(e_ctimer_id_t timer, unsigned int val);
  1676. unsigned e_ctimer_start(e_ctimer_id_t timer, e_ctimer_config_t config);
  1677. unsigned e_ctimer_stop(e_ctimer_id_t timer);
  1678. void e_wait(e_ctimer_id_t timer, unsigned int clicks);
  1679. # 34 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_lib.h" 2 3
  1680. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_ic.h" 1 3
  1681. # 31 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_ic.h" 3
  1682. typedef void (*sighandler_t)(int);
  1683.  
  1684. typedef enum {
  1685. E_SYNC = 0,
  1686. E_SW_EXCEPTION = 1,
  1687. E_MEM_FAULT = 2,
  1688. E_TIMER0_INT = 3,
  1689. E_TIMER1_INT = 4,
  1690. E_MESSAGE_INT = 5,
  1691. E_DMA0_INT = 6,
  1692. E_DMA1_INT = 7,
  1693. E_USER_INT = 9,
  1694. } e_irq_type_t;
  1695.  
  1696.  
  1697. void e_irq_attach(e_irq_type_t irq, sighandler_t handler);
  1698. void e_irq_set(unsigned row, unsigned col, e_irq_type_t irq);
  1699. void e_irq_clear(unsigned row, unsigned col, e_irq_type_t irq);
  1700. void e_irq_global_mask(e_bool_t state);
  1701. void e_irq_mask(e_irq_type_t irq, e_bool_t state);
  1702. # 35 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_lib.h" 2 3
  1703. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_mem.h" 1 3
  1704. # 30 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_mem.h" 3
  1705. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_common.h" 1 3
  1706. # 31 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_mem.h" 2 3
  1707. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_coreid.h" 1 3
  1708. # 32 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_coreid.h" 3
  1709. typedef unsigned int e_coreid_t;
  1710.  
  1711.  
  1712.  
  1713. typedef enum
  1714. {
  1715.  
  1716. E_GROUP_WRAP = 0,
  1717. E_ROW_WRAP = 1,
  1718. E_COL_WRAP = 2,
  1719.  
  1720. E_PREV_CORE = 0,
  1721. E_NEXT_CORE = 1,
  1722. } e_coreid_wrap_t;
  1723.  
  1724. typedef enum {
  1725. E_NULL = 0,
  1726. E_EPI_PLATFORM = 1,
  1727. E_EPI_CHIP = 2,
  1728. E_EPI_GROUP = 3,
  1729. E_EPI_CORE = 4,
  1730. E_EXT_MEM = 5,
  1731. E_MAPPING = 6,
  1732. E_SHARED_MEM = 7
  1733. } e_objtype_t;
  1734.  
  1735. typedef enum {
  1736. E_E16G301 = 0,
  1737. E_E64G401 = 1,
  1738. } e_chiptype_t;
  1739.  
  1740. typedef struct {
  1741. e_objtype_t objtype;
  1742. e_chiptype_t chiptype;
  1743. e_coreid_t group_id;
  1744. unsigned group_row;
  1745. unsigned group_col;
  1746. unsigned group_rows;
  1747. unsigned group_cols;
  1748. unsigned core_row;
  1749. unsigned core_col;
  1750. unsigned alignment_padding;
  1751. } e_group_config_t;
  1752.  
  1753. typedef struct {
  1754. e_objtype_t objtype;
  1755. unsigned base;
  1756. } e_emem_config_t;
  1757.  
  1758. extern const e_group_config_t e_group_config;
  1759. extern const e_emem_config_t e_emem_config;
  1760.  
  1761.  
  1762. e_coreid_t e_get_coreid(void);
  1763.  
  1764. void *e_get_global_address(unsigned row, unsigned col, const void *ptr);
  1765.  
  1766. e_coreid_t e_coreid_from_coords(unsigned row, unsigned col);
  1767.  
  1768. void e_coords_from_coreid(e_coreid_t coreid, unsigned *row, unsigned *col);
  1769.  
  1770. e_bool_t e_is_on_core(const void *ptr);
  1771.  
  1772. void e_neighbor_id(e_coreid_wrap_t dir, e_coreid_wrap_t wrap, unsigned *row, unsigned *col);
  1773. # 32 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_mem.h" 2 3
  1774.  
  1775. typedef enum {
  1776. E_RD = 1,
  1777. E_WR = 2,
  1778. E_RDWR = 3,
  1779. } e_memtype_t;
  1780.  
  1781. typedef struct {
  1782. e_objtype_t objtype;
  1783. off_t phy_base;
  1784. off_t ephy_base;
  1785. size_t size;
  1786. e_memtype_t type;
  1787. } e_memseg_t;
  1788.  
  1789. void *e_read(const void *remote, void *dst, unsigned row, unsigned col, const void *src, size_t n);
  1790. void *e_write(const void *remote, const void *src, unsigned row, unsigned col, void *dst, size_t n);
  1791. # 36 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_lib.h" 2 3
  1792. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_mutex.h" 1 3
  1793. # 31 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_mutex.h" 3
  1794. typedef char e_barrier_t;
  1795. typedef int e_mutex_t;
  1796. typedef int e_mutexattr_t;
  1797.  
  1798.  
  1799.  
  1800.  
  1801.  
  1802.  
  1803.  
  1804. void e_mutex_init(unsigned row, unsigned col, e_mutex_t *mutex, e_mutexattr_t *attr);
  1805. void e_mutex_lock(unsigned row, unsigned col, e_mutex_t *mutex);
  1806. unsigned e_mutex_trylock(unsigned row, unsigned col, e_mutex_t *mutex);
  1807. void e_mutex_unlock(unsigned row, unsigned col, e_mutex_t *mutex);
  1808. void e_barrier_init(volatile e_barrier_t bar_array[], e_barrier_t *tgt_bar_array[]);
  1809. void e_barrier(volatile e_barrier_t *bar_array, e_barrier_t *tgt_bar_array[]);
  1810. # 37 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_lib.h" 2 3
  1811. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_coreid.h" 1 3
  1812. # 38 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_lib.h" 2 3
  1813. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_shm.h" 1 3
  1814. # 33 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_shm.h" 3
  1815. # 1 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_mem.h" 1 3
  1816. # 34 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_shm.h" 2 3
  1817.  
  1818.  
  1819.  
  1820.  
  1821.  
  1822.  
  1823. #pragma pack(push, 1)
  1824. # 51 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_shm.h" 3
  1825. typedef struct __attribute__ ((aligned (8))) e_shmseg {
  1826. void *addr;
  1827. char name[256];
  1828. size_t size;
  1829. void *paddr;
  1830. off_t offset;
  1831. } e_shmseg_t;
  1832.  
  1833. typedef struct __attribute__ ((aligned (8))) e_shmseg_pvt {
  1834. e_shmseg_t shm_seg;
  1835. unsigned refcnt;
  1836. unsigned valid;
  1837. } e_shmseg_pvt_t;
  1838.  
  1839. typedef struct __attribute__ ((aligned (8))) e_shmtable {
  1840. unsigned int magic;
  1841. unsigned int initialized;
  1842. e_shmseg_pvt_t regions[64];
  1843. unsigned int free_space;
  1844. off_t next_free_offset;
  1845. unsigned long paddr_epi;
  1846. unsigned long paddr_cpu;
  1847. char *heap;
  1848. void *lock;
  1849. } e_shmtable_t;
  1850.  
  1851. #pragma pack(pop)
  1852.  
  1853.  
  1854. int e_shm_attach(e_memseg_t *mem, const char* name);
  1855.  
  1856.  
  1857. int e_shm_release(const char* name);
  1858. # 39 "/opt/adapteva/esdk.2014.11-rc1/tools/e-gnu.armv7l/epiphany-elf/include/e_lib.h" 2 3
  1859. # 8 "zigzag/zigzag.c" 2
  1860. # 36 "zigzag/zigzag.c"
  1861. uint16_t _msg_box[32*24 +1];
  1862.  
  1863.  
  1864.  
  1865. void interrupt_handler() __attribute__ ((interrupt ("message")));
  1866. void pass_message();
  1867. void print_route();
  1868.  
  1869. void __attribute__ ((aligned(8))) __attribute__ ((noinline)) e_idle()
  1870. {
  1871.  
  1872.  
  1873. asm("gie");
  1874. asm("idle");
  1875. }
  1876.  
  1877. int main()
  1878. {
  1879. int i;
  1880.  
  1881. e_irq_global_mask(E_TRUE);
  1882. e_irq_mask(E_MESSAGE_INT, E_FALSE);
  1883. e_irq_attach(E_MESSAGE_INT, interrupt_handler);
  1884.  
  1885. if (e_get_coreid() == 0x808)
  1886. {
  1887.  
  1888. for (i=0; i < 1000000; ++i) ;
  1889. pass_message();
  1890. }
  1891.  
  1892. e_irq_global_mask(E_FALSE);
  1893. asm("idle");
  1894.  
  1895. return 0;
  1896.  
  1897. }
  1898.  
  1899. void interrupt_handler()
  1900. {
  1901. if (e_get_coreid() == 0x808)
  1902. {
  1903.  
  1904. print_route();
  1905. exit(3);
  1906. }
  1907. else
  1908. {
  1909.  
  1910. pass_message();
  1911. _exit(2);
  1912. }
  1913. }
  1914.  
  1915. e_coreid_t next_hop()
  1916. {
  1917. enum direction_t { LEFT, RIGHT } direction;
  1918.  
  1919. e_coreid_t coreid;
  1920. unsigned row, col, rel_row, rel_col;
  1921.  
  1922. coreid = e_get_coreid();
  1923. row = ((coreid) >> 6);
  1924. col = ((coreid) & ((1<<6)-1));
  1925. rel_row = row - ((0x808) >> 6);
  1926. rel_col = col - ((0x808) & ((1<<6)-1));
  1927.  
  1928.  
  1929. direction = (rel_row & 1) ? LEFT : RIGHT;
  1930.  
  1931. if (coreid == 0x808)
  1932. {
  1933. if (rel_col < 24 -1)
  1934. return (((row) << 6) | (col+1));
  1935. else
  1936. return (((row+1) << 6) | (col));
  1937. }
  1938.  
  1939. if (!rel_col)
  1940. {
  1941. if (rel_row == 1)
  1942. return 0x808;
  1943. else
  1944. return (((row-1) << 6) | (col));
  1945. }
  1946.  
  1947.  
  1948.  
  1949.  
  1950. switch (direction)
  1951. {
  1952. case LEFT:
  1953. if (rel_col == 1 && rel_row != 32 -1)
  1954. return (((row+1) << 6) | (col));
  1955. else
  1956. return (((row) << 6) | (col-1));
  1957.  
  1958. case RIGHT:
  1959. if (rel_row == 32 -1 && rel_col == 24 -1)
  1960. return (((row) << 6) | (((0x808) & ((1<<6)-1))));
  1961. else if (rel_col == 24 -1)
  1962. return (((row+1) << 6) | (col));
  1963. else
  1964. return (((row) << 6) | (col+1));
  1965. }
  1966.  
  1967. return 0x808;
  1968.  
  1969. }
  1970.  
  1971. void pass_message()
  1972. {
  1973. e_coreid_t next;
  1974. uint16_t n;
  1975. uint16_t *next_msgbox;
  1976. uint16_t *msgbox = (uint16_t *) _msg_box;
  1977.  
  1978. if (e_get_coreid() == 0x808)
  1979. {
  1980. *msgbox = 0;
  1981. }
  1982.  
  1983. msgbox[0]++;
  1984. n = msgbox[0];
  1985. msgbox[n] = (uint16_t) (((unsigned) e_get_coreid()) & 0xffff);
  1986.  
  1987. next = next_hop();
  1988. next_msgbox = (uint16_t *)
  1989. e_get_global_address(((next) >> 6), ((next) & ((1<<6)-1)), (void *) _msg_box);
  1990. memcpy((void *) next_msgbox, (void *) msgbox, (n+1)*sizeof(msgbox[0]));
  1991.  
  1992. printf("Passing message to 0x%x (%p)\n", next, next_msgbox);
  1993. e_irq_set(((next) >> 6), ((next) & ((1<<6)-1)), E_MESSAGE_INT);
  1994. }
  1995.  
  1996. inline void print_path(uint16_t path[32][24], uint16_t row, uint16_t col)
  1997. {
  1998. signed north, east, south, west;
  1999. uint16_t next, prev;
  2000.  
  2001. north = row == 0 ? -2 : path[row-1][col ];
  2002. west = col == 0 ? -2 : path[row ][col-1];
  2003. south = row == 32 -1 ? -2 : path[row+1][col ];
  2004. east = col == 24 -1 ? -2 : path[row ][col+1];
  2005.  
  2006. next = path[row][col] + 1;
  2007. prev = path[row][col] - 1;
  2008.  
  2009. if (!prev)
  2010. fputs("○", (_impure_ptr->_stdout));
  2011. else if (north == next)
  2012. if (south == prev) fputs("|", (_impure_ptr->_stdout)); else fputs("▲", (_impure_ptr->_stdout));
  2013. else if (south == next)
  2014. if (north == prev) fputs("|", (_impure_ptr->_stdout)); else fputs("▼", (_impure_ptr->_stdout));
  2015. else if (west == next)
  2016. if (east == prev) fputs("—", (_impure_ptr->_stdout)); else fputs("◀", (_impure_ptr->_stdout));
  2017. else if (east == next)
  2018. if (west == prev) fputs("—", (_impure_ptr->_stdout)); else fputs("▶", (_impure_ptr->_stdout));
  2019. else
  2020. fputs("⚫", (_impure_ptr->_stdout));
  2021. }
  2022.  
  2023. void print_route()
  2024. {
  2025. int i,j;
  2026. e_coreid_t core;
  2027. unsigned row, col;
  2028. uint16_t path[32][24];
  2029. uint16_t *msgbox = (uint16_t *) _msg_box;
  2030.  
  2031. printf("Got %d messages\n", msgbox[0]);
  2032. printf("Message path:\n");
  2033. for (i=0; i < msgbox[0]; i++)
  2034. {
  2035. core = msgbox[i+1];
  2036. if (core)
  2037. {
  2038. row = ((core) >> 6) - ((0x808) >> 6);
  2039. col = ((core) & ((1<<6)-1)) - ((0x808) & ((1<<6)-1));
  2040. path[row][col] = i+1;
  2041. }
  2042. }
  2043. for (i=0; i < 32; i++)
  2044. {
  2045. for (j=0; j < 24; j++)
  2046. {
  2047. if (path[i][j])
  2048. print_path(path, i, j);
  2049. else
  2050. fputs("⨯", (_impure_ptr->_stdout));
  2051. }
  2052.  
  2053. fputs("\n", (_impure_ptr->_stdout));
  2054. }
  2055. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement