source:
rtems-tools/tools/4.12/gdb/gdb-7.11-erc32-printf_filtered.diff
@
0bbd2de
Last change on this file since 0bbd2de was 0bbd2de, checked in by Chris Johns <chrisj@…>, on 03/16/16 at 04:18:34 | |
---|---|
|
|
File size: 36.6 KB |
-
sim/erc32/erc32.c
diff -ruw gdb-7.11.orig1/sim/erc32/erc32.c gdb-7.11/sim/erc32/erc32.c
old new 19 19 /* The control space devices */ 20 20 21 21 #include "config.h" 22 #include <errno.h> 22 23 #include <sys/types.h> 23 24 #include <stdio.h> 24 25 #include <string.h> … … 36 37 extern char uart_dev1[], uart_dev2[]; 37 38 38 39 int dumbio = 0; /* normal, smart, terminal oriented IO by default */ 40 int tty_setup = 1; /* default setup if not a tty */ 39 41 40 42 /* MEC registers */ 41 43 #define MEC_START 0x01f80000 … … 293 295 294 296 extern int ext_irl; 295 297 298 static host_callback *callback; 299 296 300 297 301 /* One-time init */ 298 302 299 303 void 300 304 init_sim() 301 305 { 306 callback = sim_callback; 302 307 port_init(); 303 308 } 304 309 … … 321 326 sys_reset(); 322 327 mec_ersr = 0x8000; 323 328 if (sis_verbose) 324 printf("Error manager reset - IU in error mode\n");329 (*sim_callback->printf_filtered) (sim_callback, "Error manager reset - IU in error mode\n"); 325 330 } else { 326 331 sys_halt(); 327 332 mec_ersr |= 0x2000; 328 333 if (sis_verbose) 329 printf("Error manager halt - IU in error mode\n");334 (*sim_callback->printf_filtered) (sim_callback, "Error manager halt - IU in error mode\n"); 330 335 } 331 336 } else 332 337 mec_irq(1); … … 337 342 sys_reset(); 338 343 mec_ersr = 0x8000; 339 344 if (sis_verbose) 340 printf("Error manager reset - IU comparison error\n");345 (*sim_callback->printf_filtered) (sim_callback, "Error manager reset - IU comparison error\n"); 341 346 } else { 342 347 sys_halt(); 343 348 mec_ersr |= 0x2000; 344 349 if (sis_verbose) 345 printf("Error manager halt - IU comparison error\n");350 (*sim_callback->printf_filtered) (sim_callback, "Error manager halt - IU comparison error\n"); 346 351 } 347 352 } else 348 353 mec_irq(1); … … 353 358 sys_reset(); 354 359 mec_ersr = 0x8000; 355 360 if (sis_verbose) 356 printf("Error manager reset - MEC hardware error\n");361 (*sim_callback->printf_filtered) (sim_callback, "Error manager reset - MEC hardware error\n"); 357 362 } else { 358 363 sys_halt(); 359 364 mec_ersr |= 0x2000; 360 365 if (sis_verbose) 361 printf("Error manager halt - MEC hardware error\n");366 (*sim_callback->printf_filtered) (sim_callback, "Error manager halt - MEC hardware error\n"); 362 367 } 363 368 } else 364 369 mec_irq(1); … … 416 421 mem_rammask = RAM_MASK; 417 422 } 418 423 if (sis_verbose) 419 printf("RAM start: 0x%x, RAM size: %d K, ROM size: %d K\n",424 (*sim_callback->printf_filtered) (sim_callback, "RAM start: 0x%x, RAM size: %d K, ROM size: %d K\n", 420 425 mem_ramstart, mem_ramsz >> 10, mem_romsz >> 10); 421 426 } 422 427 … … 432 437 } 433 438 mem_romw_ws = (mec_wcr >> 8) & 0x0f; 434 439 if (sis_verbose) 435 printf("Waitstates = RAM read: %d, RAM write: %d, ROM read: %d, ROM write: %d\n",440 (*sim_callback->printf_filtered) (sim_callback, "Waitstates = RAM read: %d, RAM write: %d, ROM read: %d, ROM write: %d\n", 436 441 mem_ramr_ws, mem_ramw_ws, mem_romr_ws, mem_romw_ws); 437 442 } 438 443 … … 442 447 mem_accprot = (mec_wpr[0] | mec_wpr[1]); 443 448 mem_blockprot = (mec_mcr >> 3) & 1; 444 449 if (sis_verbose && mem_accprot) 445 printf("Memory block write protection enabled\n");450 (*sim_callback->printf_filtered) (sim_callback, "Memory block write protection enabled\n"); 446 451 if (mec_mcr & 0x08000) { 447 452 mec_ersr |= 0x20; 448 453 decode_ersr(); 449 454 } 450 455 if (sis_verbose && (mec_mcr & 2)) 451 printf("Software reset enabled\n");456 (*sim_callback->printf_filtered) (sim_callback, "Software reset enabled\n"); 452 457 if (sis_verbose && (mec_mcr & 1)) 453 printf("Power-down mode enabled\n");458 (*sim_callback->printf_filtered) (sim_callback, "Power-down mode enabled\n"); 454 459 } 455 460 456 461 /* Flush ports when simulator stops */ … … 553 558 int irq_test; 554 559 555 560 if (sis_verbose) 556 printf("interrupt %d acknowledged\n", level);561 (*sim_callback->printf_filtered) (sim_callback, "interrupt %d acknowledged\n", level); 557 562 irq_test = mec_tcr & 0x80000; 558 563 if ((irq_test) && (mec_ifr & (1 << level))) 559 564 mec_ifr &= ~(1 << level); … … 578 583 for (i = 15; i > 0; i--) { 579 584 if (((itmp >> i) & 1) != 0) { 580 585 if ((sis_verbose) && (i > old_irl)) 581 printf("IU irl: %d\n", i);586 (*sim_callback->printf_filtered) (sim_callback, "IU irl: %d\n", i); 582 587 ext_irl = i; 583 588 set_int(i, mec_intack, i); 584 589 break; … … 753 758 uint32 data; 754 759 { 755 760 if (sis_verbose > 1) 756 printf("MEC write a: %08x, d: %08x\n",addr,data);761 (*sim_callback->printf_filtered) (sim_callback, "MEC write a: %08x, d: %08x\n",addr,data); 757 762 switch (addr & 0x0ff) { 758 763 759 764 case MEC_MCR: … … 767 772 sys_reset(); 768 773 mec_ersr = 0x4000; 769 774 if (sis_verbose) 770 printf(" Software reset issued\n");775 (*sim_callback->printf_filtered) (sim_callback, " Software reset issued\n"); 771 776 } 772 777 break; 773 778 … … 782 787 mec_wpr[0] = (data >> 23) & 0x03; 783 788 mem_accprot = mec_wpr[0] || mec_wpr[1]; 784 789 if (sis_verbose && mec_wpr[0]) 785 printf("Segment 1 memory protection enabled (0x02%06x - 0x02%06x)\n",790 (*sim_callback->printf_filtered) (sim_callback, "Segment 1 memory protection enabled (0x02%06x - 0x02%06x)\n", 786 791 mec_ssa[0] << 2, mec_sea[0] << 2); 787 792 break; 788 793 case MEC_SEA1: /* 0x24 */ … … 795 800 mec_wpr[1] = (data >> 23) & 0x03; 796 801 mem_accprot = mec_wpr[0] || mec_wpr[1]; 797 802 if (sis_verbose && mec_wpr[1]) 798 printf("Segment 2 memory protection enabled (0x02%06x - 0x02%06x)\n",803 (*sim_callback->printf_filtered) (sim_callback, "Segment 2 memory protection enabled (0x02%06x - 0x02%06x)\n", 799 804 mec_ssa[1] << 2, mec_sea[1] << 2); 800 805 break; 801 806 case MEC_SEA2: /* 0x2c */ … … 909 914 if (wdog_status == init) { 910 915 wdog_status = disabled; 911 916 if (sis_verbose) 912 printf("Watchdog disabled\n");917 (*sim_callback->printf_filtered) (sim_callback, "Watchdog disabled\n"); 913 918 } 914 919 break; 915 920 … … 936 941 { 937 942 if (dumbio) 938 943 return; /* do nothing */ 939 if ( !ifd1)944 if (ifd1 == 0 && f1open) { 940 945 tcsetattr(0, TCSANOW, &ioc1); 941 if (!ifd2) 946 tcflush(ifd1, TCIFLUSH); 947 } 948 if (ifd2 == 0 && f1open) { 942 949 tcsetattr(0, TCSANOW, &ioc2); 950 tcflush(ifd2, TCIFLUSH); 951 } 943 952 } 944 953 945 954 void … … 947 956 { 948 957 if (dumbio) 949 958 return; /* do nothing */ 950 if ( !ifd1)959 if (ifd1 == 0 && f1open && tty_setup) 951 960 tcsetattr(0, TCSANOW, &iocold1); 952 if ( !ifd2)961 if (ifd2 == 0 && f2open && tty_setup) 953 962 tcsetattr(0, TCSANOW, &iocold2); 954 963 } 955 964 956 965 #define DO_STDIO_READ( _fd_, _buf_, _len_ ) \ 957 ( dumbio 966 ( dumbio || nouartrx \ 958 967 ? (0) /* no bytes read, no delay */ \ 959 : read( _fd_, _buf_, _len_ ) ) 968 : (_fd_) == 1 && callback ? \ 969 callback->read_stdin (callback, _buf_, _len_) : \ 970 read( _fd_, _buf_, _len_ ) ) 960 971 961 972 962 973 static void … … 976 987 } 977 988 if (uart_dev1[0] != 0) 978 989 if ((fd1 = open(uart_dev1, O_RDWR | O_NONBLOCK)) < 0) { 979 printf("Warning, couldn't open output device %s\n", uart_dev1);990 (*sim_callback->printf_filtered) (sim_callback, "Warning, couldn't open output device %s\n", uart_dev1); 980 991 } else { 981 992 if (sis_verbose) 982 printf("serial port A on %s\n", uart_dev1);993 (*sim_callback->printf_filtered) (sim_callback, "serial port A on %s\n", uart_dev1); 983 994 f1in = f1out = fdopen(fd1, "r+"); 984 995 setbuf(f1out, NULL); 985 996 f1open = 1; 986 997 } 987 998 if (f1in) ifd1 = fileno(f1in); 988 999 if (ifd1 == 0) { 1000 if (callback && !callback->isatty(callback, ifd1)) { 1001 tty_setup = 0; 1002 } 989 1003 if (sis_verbose) 990 printf("serial port A on stdin/stdout\n");1004 (*sim_callback->printf_filtered) (sim_callback, "serial port A on stdin/stdout\n"); 991 1005 if (!dumbio) { 992 1006 tcgetattr(ifd1, &ioc1); 1007 if (tty_setup) { 993 1008 iocold1 = ioc1; 994 1009 ioc1.c_lflag &= ~(ICANON | ECHO); 995 1010 ioc1.c_cc[VMIN] = 0; 996 1011 ioc1.c_cc[VTIME] = 0; 997 1012 } 1013 } 998 1014 f1open = 1; 999 1015 } 1000 1016 1001 1017 if (f1out) { 1002 1018 ofd1 = fileno(f1out); 1003 if (!dumbio&& ofd1 == 1) setbuf(f1out, NULL);1019 if (!dumbio && tty_setup && ofd1 == 1) setbuf(f1out, NULL); 1004 1020 } 1005 1021 1006 1022 if (uart_dev2[0] != 0) 1007 1023 if ((fd2 = open(uart_dev2, O_RDWR | O_NONBLOCK)) < 0) { 1008 printf("Warning, couldn't open output device %s\n", uart_dev2);1024 (*sim_callback->printf_filtered) (sim_callback, "Warning, couldn't open output device %s\n", uart_dev2); 1009 1025 } else { 1010 1026 if (sis_verbose) 1011 printf("serial port B on %s\n", uart_dev2);1027 (*sim_callback->printf_filtered) (sim_callback, "serial port B on %s\n", uart_dev2); 1012 1028 f2in = f2out = fdopen(fd2, "r+"); 1013 1029 setbuf(f2out, NULL); 1014 1030 f2open = 1; … … 1016 1032 if (f2in) ifd2 = fileno(f2in); 1017 1033 if (ifd2 == 0) { 1018 1034 if (sis_verbose) 1019 printf("serial port B on stdin/stdout\n");1035 (*sim_callback->printf_filtered) (sim_callback, "serial port B on stdin/stdout\n"); 1020 1036 if (!dumbio) { 1021 1037 tcgetattr(ifd2, &ioc2); 1038 if (tty_setup) { 1022 1039 iocold2 = ioc2; 1023 1040 ioc2.c_lflag &= ~(ICANON | ECHO); 1024 1041 ioc2.c_cc[VMIN] = 0; 1025 1042 ioc2.c_cc[VTIME] = 0; 1026 1043 } 1044 } 1027 1045 f2open = 1; 1028 1046 } 1029 1047 1030 1048 if (f2out) { 1031 1049 ofd2 = fileno(f2out); 1032 if (!dumbio && ofd2 == 1) setbuf(f2out, NULL);1050 if (!dumbio && tty_setup && ofd2 == 1) setbuf(f2out, NULL); 1033 1051 } 1034 1052 1035 1053 wnuma = wnumb = 0; … … 1058 1076 if (f1open) { 1059 1077 anum = DO_STDIO_READ(ifd1, aq, UARTBUF); 1060 1078 } 1079 else { 1080 anum = 0; 1081 } 1061 1082 if (anum > 0) { 1062 1083 aind = 0; 1063 1084 if ((aind + 1) < anum) … … 1090 1111 if (f2open) { 1091 1112 bnum = DO_STDIO_READ(ifd2, bq, UARTBUF); 1092 1113 } 1114 else { 1115 bnum = 0; 1116 } 1093 1117 if (bnum > 0) { 1094 1118 bind = 0; 1095 1119 if ((bind + 1) < bnum) … … 1122 1146 if (f1open) { 1123 1147 anum = DO_STDIO_READ(ifd1, aq, UARTBUF); 1124 1148 } 1149 else { 1150 anum = 0; 1151 } 1125 1152 if (anum > 0) { 1126 1153 Ucontrol |= 0x00000001; 1127 1154 aind = 0; … … 1134 1161 if (f2open) { 1135 1162 bnum = DO_STDIO_READ(ifd2, bq, UARTBUF); 1136 1163 } 1164 else { 1165 bnum = 0; 1166 } 1137 1167 if (bnum > 0) { 1138 1168 Ucontrol |= 0x00010000; 1139 1169 bind = 0; … … 1152 1182 break; 1153 1183 default: 1154 1184 if (sis_verbose) 1155 printf("Read from unimplemented MEC register (%x)\n", addr);1185 (*sim_callback->printf_filtered) (sim_callback, "Read from unimplemented MEC register (%x)\n", addr); 1156 1186 1157 1187 } 1158 1188 return 0; … … 1174 1204 if (wnuma < UARTBUF) 1175 1205 wbufa[wnuma++] = c; 1176 1206 else { 1177 while (wnuma) 1207 while (wnuma) { 1208 if (ofd1 == 1 && callback) 1209 wnuma -= callback->write_stdout(callback, wbufa, wnuma); 1210 else 1178 1211 wnuma -= fwrite(wbufa, 1, wnuma, f1out); 1212 } 1179 1213 wbufa[wnuma++] = c; 1180 1214 } 1181 1215 } … … 1198 1232 if (wnumb < UARTBUF) 1199 1233 wbufb[wnumb++] = c; 1200 1234 else { 1201 while (wnumb) 1235 while (wnumb) { 1236 if (ofd1 == 1 && callback) 1237 wnumb -= callback->write_stdout(callback, wbufb, wnumb); 1238 else 1202 1239 wnumb -= fwrite(wbufb, 1, wnumb, f2out); 1240 } 1203 1241 wbufb[wnumb++] = c; 1204 1242 } 1205 1243 } … … 1229 1267 break; 1230 1268 default: 1231 1269 if (sis_verbose) 1232 printf("Write to unimplemented MEC register (%x)\n", addr); 1270 (*sim_callback->printf_filtered) (sim_callback, 1271 "Write to unimplemented MEC register (%x)\n", addr); 1233 1272 1234 1273 } 1235 1274 } … … 1237 1276 static void 1238 1277 flush_uart() 1239 1278 { 1240 while (wnuma && f1open) 1279 while (wnuma && f1open) { 1280 if (ofd1 == 1 && callback) { 1281 wnuma -= callback->write_stdout(callback, wbufa, wnuma); 1282 callback->flush_stdout(callback); 1283 } 1284 else 1241 1285 wnuma -= fwrite(wbufa, 1, wnuma, f1out); 1242 while (wnumb && f2open) 1286 } 1287 while (wnumb && f2open) { 1288 if (ofd2 == 1 && callback) { 1289 wnuma -= callback->write_stdout(callback, wbufb, wnuma); 1290 callback->flush_stdout(callback); 1291 } 1292 else 1243 1293 wnumb -= fwrite(wbufb, 1, wnumb, f2out); 1244 1294 } 1295 } 1245 1296 1246 1297 1247 1298 1248 1299 static void 1249 1300 uarta_tx() 1250 1301 { 1251 1252 while (f1open && fwrite(&uarta_sreg, 1, 1, f1out) != 1); 1302 while (f1open) { 1303 if (ofd1 == 1 && callback) { 1304 while (callback->write_stdout(callback, &uarta_sreg, 1) != 1); 1305 } 1306 else { 1307 while (fwrite(&uarta_sreg, 1, 1, f1out) != 1); 1308 } 1309 } 1253 1310 if (uart_stat_reg & UARTA_HRE) { 1254 1311 uart_stat_reg |= UARTA_SRE; 1255 1312 } else { … … 1263 1320 static void 1264 1321 uartb_tx() 1265 1322 { 1266 while (f2open && fwrite(&uartb_sreg, 1, 1, f2out) != 1); 1323 while (f2open) { 1324 if (ofd2 == 1 && callback) { 1325 while (callback->write_stdout(callback, &uarta_sreg, 1) != 1); 1326 } 1327 else { 1328 while (fwrite(&uartb_sreg, 1, 1, f2out) != 1); 1329 } 1330 } 1267 1331 if (uart_stat_reg & UARTB_HRE) { 1268 1332 uart_stat_reg |= UARTB_SRE; 1269 1333 } else { … … 1285 1349 rsize = 0; 1286 1350 if (f1open) 1287 1351 rsize = DO_STDIO_READ(ifd1, &rxd, 1); 1352 else 1353 rsize = 0; 1288 1354 if (rsize > 0) { 1289 1355 uarta_data = UART_DR | rxd; 1290 1356 if (uart_stat_reg & UARTA_HRE) … … 1301 1367 rsize = 0; 1302 1368 if (f2open) 1303 1369 rsize = DO_STDIO_READ(ifd2, &rxd, 1); 1370 else 1371 rsize = 0; 1304 1372 if (rsize) { 1305 1373 uartb_data = UART_DR | rxd; 1306 1374 if (uart_stat_reg & UARTB_HRE) … … 1354 1422 event(wdog_intr, 0, wdog_scaler + 1); 1355 1423 } else { 1356 1424 if (wdog_rston) { 1357 printf("Watchdog reset!\n");1425 (*sim_callback->printf_filtered) (sim_callback, "Watchdog reset!\n"); 1358 1426 sys_reset(); 1359 1427 mec_ersr = 0xC000; 1360 1428 } else { … … 1372 1440 { 1373 1441 event(wdog_intr, 0, wdog_scaler + 1); 1374 1442 if (sis_verbose) 1375 printf("Watchdog started, scaler = %d, counter = %d\n", 1443 (*sim_callback->printf_filtered) (sim_callback, 1444 "Watchdog started, scaler = %d, counter = %d\n", 1376 1445 wdog_scaler, wdog_counter); 1377 1446 } 1378 1447 … … 1399 1468 rtc_enabled = 1; 1400 1469 } else { 1401 1470 if (sis_verbose) 1402 printf("RTC stopped\n\r"); 1471 (*sim_callback->printf_filtered) (sim_callback, 1472 "RTC stopped\n\r"); 1403 1473 rtc_enabled = 0; 1404 1474 } 1405 1475 } … … 1408 1478 rtc_start() 1409 1479 { 1410 1480 if (sis_verbose) 1411 printf("RTC started (period %d)\n\r", rtc_scaler + 1); 1481 (*sim_callback->printf_filtered) (sim_callback, 1482 "RTC started (period %d)\n\r", rtc_scaler + 1); 1412 1483 event(rtc_intr, 0, rtc_scaler + 1); 1413 1484 rtc_scaler_start = now(); 1414 1485 rtc_enabled = 1; … … 1452 1523 gpt_enabled = 1; 1453 1524 } else { 1454 1525 if (sis_verbose) 1455 printf("GPT stopped\n\r");1526 (*sim_callback->printf_filtered) (sim_callback, "GPT stopped\n\r"); 1456 1527 gpt_enabled = 0; 1457 1528 } 1458 1529 } … … 1461 1532 gpt_start() 1462 1533 { 1463 1534 if (sis_verbose) 1464 printf("GPT started (period %d)\n\r", gpt_scaler + 1); 1535 (*sim_callback->printf_filtered) (sim_callback, 1536 "GPT started (period %d)\n\r", gpt_scaler + 1); 1465 1537 event(gpt_intr, 0, gpt_scaler + 1); 1466 1538 gpt_scaler_start = now(); 1467 1539 gpt_enabled = 1; … … 1566 1638 } 1567 1639 1568 1640 if (sis_verbose) 1569 printf ("Memory exception at %x (illegal address)\n", addr); 1641 (*sim_callback->printf_filtered) (sim_callback, 1642 "Memory exception at %x (illegal address)\n", addr); 1570 1643 if (sregs.psr & 0x080) 1571 1644 asi = 9; 1572 1645 else … … 1589 1662 #ifdef ERRINJ 1590 1663 if (errmec) { 1591 1664 if (sis_verbose) 1592 printf("Inserted MEC error %d\n",errmec);1665 (*sim_callback->printf_filtered) (sim_callback, "Inserted MEC error %d\n",errmec); 1593 1666 set_sfsr(errmec, addr, asi, 1); 1594 1667 if (errmec == 5) mecparerror(); 1595 1668 if (errmec == 6) iucomperr(); … … 1641 1714 } 1642 1715 1643 1716 if (sis_verbose) 1644 printf ("Memory exception at %x (illegal address)\n", addr); 1717 (*sim_callback->printf_filtered) (sim_callback, 1718 "Memory exception at %x (illegal address)\n", addr); 1645 1719 set_sfsr(UIMP_ACC, addr, asi, 1); 1646 1720 *ws = MEM_EX_WS; 1647 1721 return 1; … … 1666 1740 #ifdef ERRINJ 1667 1741 if (errmec) { 1668 1742 if (sis_verbose) 1669 printf("Inserted MEC error %d\n",errmec); 1743 (*sim_callback->printf_filtered) (sim_callback, 1744 "Inserted MEC error %d\n",errmec); 1670 1745 set_sfsr(errmec, addr, asi, 0); 1671 1746 if (errmec == 5) mecparerror(); 1672 1747 if (errmec == 6) iucomperr(); … … 1690 1765 !((mec_wpr[0] && wphit[0]) || (mec_wpr[1] && wphit[1])) 1691 1766 )) { 1692 1767 if (sis_verbose) 1693 printf("Memory access protection error at 0x%08x\n", addr); 1768 (*sim_callback->printf_filtered) (sim_callback, 1769 "Memory access protection error at 0x%08x\n", addr); 1694 1770 set_sfsr(PROT_EXC, addr, asi, 0); 1695 1771 *ws = MEM_EX_WS; 1696 1772 return 1; -
sim/erc32/exec.c
diff -ruw gdb-7.11.orig1/sim/erc32/exec.c gdb-7.11/sim/erc32/exec.c
old new 1903 1903 if (errftt) { 1904 1904 sregs->fsr = (sregs->fsr & ~FSR_TT) | (errftt << 14); 1905 1905 sregs->fpstate = FP_EXC_PE; 1906 if (sis_verbose) printf("Inserted fpu error %X\n",errftt); 1906 if (sis_verbose) (*sim_callback->printf_filtered) (sim_callback, 1907 "Inserted fpu error %X\n",errftt); 1907 1908 errftt = 0; 1908 1909 } 1909 1910 #endif … … 2023 2024 #ifdef ERRINJ 2024 2025 if (errtt) { 2025 2026 sregs->trap = errtt; 2026 if (sis_verbose) printf("Inserted error trap 0x%02X\n",errtt); 2027 if (sis_verbose) (*sim_callback->printf_filtered) (sim_callback, 2028 "Inserted error trap 0x%02X\n",errtt); 2027 2029 errtt = 0; 2028 2030 } 2029 2031 #endif -
sim/erc32/func.c
diff -ruw gdb-7.11.orig1/sim/erc32/func.c gdb-7.11/sim/erc32/func.c
old new 47 47 char uart_dev2[128] = ""; 48 48 extern int ext_irl; 49 49 uint32 last_load_addr = 0; 50 int nouartrx = 0; 51 host_callback *sim_callback; 50 52 51 53 #ifdef ERRINJ 52 54 uint32 errcnt = 0; … … 80 82 size_t slen; 81 83 82 84 if ((fp = fopen(fname, "r")) == NULL) { 83 fprintf(stderr, "couldn't open batch file %s\n", fname); 85 (*sim_callback->printf_filtered) (sim_callback, 86 "couldn't open batch file %s\n", fname); 84 87 return 0; 85 88 } 86 89 while (getline(&lbuf, &len, fp) > -1) { 87 90 slen = strlen(lbuf); 88 91 if (slen && (lbuf[slen - 1] == '\n')) { 89 92 lbuf[slen - 1] = 0; 90 printf("sis> %s\n", lbuf);93 (*sim_callback->printf_filtered) (sim_callback, "sis> %s\n", lbuf); 91 94 exec_cmd(sregs, lbuf); 92 95 } 93 96 } … … 279 282 err = 1; 280 283 switch (err) { 281 284 case 0: 282 printf("%s = %d (0x%08x)\n", reg, rval, rval);285 (*sim_callback->printf_filtered) (sim_callback, "%s = %d (0x%08x)\n", reg, rval, rval); 283 286 break; 284 287 case 1: 285 printf("no such regiser: %s\n", reg);288 (*sim_callback->printf_filtered) (sim_callback, "no such regiser: %s\n", reg); 286 289 break; 287 290 case 2: 288 printf("cannot set g0\n");291 (*sim_callback->printf_filtered) (sim_callback, "cannot set g0\n"); 289 292 break; 290 293 default: 291 294 break; … … 358 361 if ((flim > ebase.simtime) && (flim < 4294967296.0)) { 359 362 lim = (uint32) flim; 360 363 } else { 361 printf("error in expression\n");364 (*sim_callback->printf_filtered) (sim_callback, "error in expression\n"); 362 365 lim = -1; 363 366 } 364 367 } … … 381 384 clen = strlen(cmd1); 382 385 if (strncmp(cmd1, "bp", clen) == 0) { 383 386 for (i = 0; i < sregs->bptnum; i++) { 384 printf(" %d : 0x%08x\n", i + 1, sregs->bpts[i]);387 (*sim_callback->printf_filtered) (sim_callback, " %d : 0x%08x\n", i + 1, sregs->bpts[i]); 385 388 } 386 389 } else if (strncmp(cmd1, "+bp", clen) == 0) { 387 390 if ((cmd1 = strtok(NULL, " \t\n\r")) != NULL) { 388 391 sregs->bpts[sregs->bptnum] = VAL(cmd1) & ~0x3; 389 printf("added breakpoint %d at 0x%08x\n",392 (*sim_callback->printf_filtered) (sim_callback, "added breakpoint %d at 0x%08x\n", 390 393 sregs->bptnum + 1, sregs->bpts[sregs->bptnum]); 391 394 sregs->bptnum += 1; 392 395 } … … 394 397 if ((cmd1 = strtok(NULL, " \t\n\r")) != NULL) { 395 398 i = VAL(cmd1) - 1; 396 399 if ((i >= 0) && (i < sregs->bptnum)) { 397 printf("deleted breakpoint %d at 0x%08x\n", i + 1,400 (*sim_callback->printf_filtered) (sim_callback, "deleted breakpoint %d at 0x%08x\n", i + 1, 398 401 sregs->bpts[i]); 399 402 for (; i < sregs->bptnum - 1; i++) { 400 403 sregs->bpts[i] = sregs->bpts[i + 1]; … … 404 407 } 405 408 } else if (strncmp(cmd1, "batch", clen) == 0) { 406 409 if ((cmd1 = strtok(NULL, " \t\n\r")) == NULL) { 407 printf("no file specified\n");410 (*sim_callback->printf_filtered) (sim_callback, "no file specified\n"); 408 411 } else { 409 412 batch(sregs, cmd1); 410 413 } … … 420 423 if ((cmd1 = strtok(NULL, " \t\n\r")) != NULL) { 421 424 sis_verbose = VAL(cmd1); 422 425 } 423 printf("Debug level = %d\n",sis_verbose);426 (*sim_callback->printf_filtered) (sim_callback, "Debug level = %d\n",sis_verbose); 424 427 } else if (strncmp(cmd1, "dis", clen) == 0) { 425 428 if ((cmd1 = strtok(NULL, " \t\n\r")) != NULL) { 426 429 daddr = VAL(cmd1); … … 429 432 len = VAL(cmd2); 430 433 } else 431 434 len = 16; 432 printf("\n");435 (*sim_callback->printf_filtered) (sim_callback, "\n"); 433 436 dis_mem(daddr, len, &dinfo); 434 printf("\n");437 (*sim_callback->printf_filtered) (sim_callback, "\n"); 435 438 daddr += len * 4; 436 439 } else if (strncmp(cmd1, "echo", clen) == 0) { 437 440 if ((cmd1 = strtok(NULL, " \t\n\r")) != NULL) { 438 printf("%s\n", (&cmdsave[clen+1]));441 (*sim_callback->printf_filtered) (sim_callback, "%s\n", (&cmdsave[clen+1])); 439 442 } 440 443 #ifdef ERRINJ 441 444 } else if (strncmp(cmd1, "error", clen) == 0) { … … 443 446 errper = VAL(cmd1); 444 447 if (errper) { 445 448 event(errinj, 0, (len = (random()%errper))); 446 printf("Error injection started with period %d\n",len);449 (*sim_callback->printf_filtered) (sim_callback, "Error injection started with period %d\n",len); 447 450 } 448 } else printf("Injected errors: %d\n",errcnt);451 } else (*sim_callback->printf_filtered) (sim_callback, "Injected errors: %d\n",errcnt); 449 452 #endif 450 453 } else if (strncmp(cmd1, "float", clen) == 0) { 451 454 stat = disp_fpu(sregs); … … 459 462 sregs->npc = sregs->pc + 4; 460 463 if ((sregs->pc != 0) && (ebase.simtime == 0)) 461 464 boot_init(); 462 printf("resuming at 0x%08x\n",sregs->pc);465 (*sim_callback->printf_filtered) (sim_callback, "resuming at 0x%08x\n",sregs->pc); 463 466 if ((cmd2 = strtok(NULL, " \t\n\r")) != NULL) { 464 467 stat = run_sim(sregs, VAL(cmd2), 0); 465 468 } else { … … 475 478 if (sregs->histbuf != NULL) 476 479 free(sregs->histbuf); 477 480 sregs->histbuf = (struct histype *) calloc(sregs->histlen, sizeof(struct histype)); 478 printf("trace history length = %d\n\r", sregs->histlen);481 (*sim_callback->printf_filtered) (sim_callback, "trace history length = %d\n\r", sregs->histlen); 479 482 sregs->histind = 0; 480 483 481 484 } else { … … 483 486 for (i = 0; i < sregs->histlen; i++) { 484 487 if (j >= sregs->histlen) 485 488 j = 0; 486 printf(" %8d ", sregs->histbuf[j].time);489 (*sim_callback->printf_filtered) (sim_callback, " %8d ", sregs->histbuf[j].time); 487 490 dis_mem(sregs->histbuf[j].addr, 1, &dinfo); 488 491 j++; 489 492 } … … 495 498 while ((cmd1 = strtok(NULL, " \t\n\r")) != NULL) 496 499 last_load_addr = bfd_load(cmd1); 497 500 } else { 498 printf("load: no file specified\n");501 (*sim_callback->printf_filtered) (sim_callback, "load: no file specified\n"); 499 502 } 500 503 } else if (strncmp(cmd1, "mem", clen) == 0) { 501 504 if ((cmd1 = strtok(NULL, " \t\n\r")) != NULL) … … 565 568 } 566 569 sregs->pc = len & ~3; 567 570 sregs->npc = sregs->pc + 4; 568 printf("resuming at 0x%08x\n",sregs->pc);571 (*sim_callback->printf_filtered) (sim_callback, "resuming at 0x%08x\n",sregs->pc); 569 572 stat = run_sim(sregs, UINT64_MAX, 0); 570 573 daddr = sregs->pc; 571 574 sim_halt(); 572 575 } else if (strncmp(cmd1, "tlimit", clen) == 0) { 573 576 sregs->tlimit = limcalc(sregs->freq); 574 577 if (sregs->tlimit != (uint32) -1) 575 printf("simulation limit = %u (%.3f ms)\n",(uint32) sregs->tlimit,578 (*sim_callback->printf_filtered) (sim_callback, "simulation limit = %u (%.3f ms)\n",(uint32) sregs->tlimit, 576 579 sregs->tlimit / sregs->freq / 1000); 577 580 } else if (strncmp(cmd1, "tra", clen) == 0) { 578 581 if ((cmd1 = strtok(NULL, " \t\n\r")) == NULL) { … … 580 583 } else { 581 584 stat = run_sim(sregs, VAL(cmd1), 1); 582 585 } 583 printf("\n");586 (*sim_callback->printf_filtered) (sim_callback, "\n"); 584 587 daddr = sregs->pc; 585 588 sim_halt(); 586 589 } else if (strncmp(cmd1, "trun", clen) == 0) { … … 592 595 daddr = sregs->pc; 593 596 sim_halt(); 594 597 } else 595 printf("syntax error\n");598 (*sim_callback->printf_filtered) (sim_callback, "syntax error\n"); 596 599 } 597 600 if (cmdsave2 != NULL) 598 601 free(cmdsave2); … … 636 639 sregs->nbranch; 637 640 #endif 638 641 639 printf("\n Cycles : %9" PRIu64 "\n\r", ebase.simtime - sregs->simstart);640 printf(" Instructions : %9" PRIu64 "\n", sregs->ninst);642 (*sim_callback->printf_filtered) (sim_callback, "\n Cycles : %9" PRIu64 "\n\r", ebase.simtime - sregs->simstart); 643 (*sim_callback->printf_filtered) (sim_callback, " Instructions : %9" PRIu64 "\n", sregs->ninst); 641 644 642 645 #ifdef STAT 643 printf(" integer : %9.2f %%\n", 100.0 * (float) iinst / (float) sregs->ninst);644 printf(" load : %9.2f %%\n",646 (*sim_callback->printf_filtered) (sim_callback, " integer : %9.2f %%\n", 100.0 * (float) iinst / (float) sregs->ninst); 647 (*sim_callback->printf_filtered) (sim_callback, " load : %9.2f %%\n", 645 648 100.0 * (float) sregs->nload / (float) sregs->ninst); 646 printf(" store : %9.2f %%\n",649 (*sim_callback->printf_filtered) (sim_callback, " store : %9.2f %%\n", 647 650 100.0 * (float) sregs->nstore / (float) sregs->ninst); 648 printf(" branch : %9.2f %%\n",651 (*sim_callback->printf_filtered) (sim_callback, " branch : %9.2f %%\n", 649 652 100.0 * (float) sregs->nbranch / (float) sregs->ninst); 650 printf(" float : %9.2f %%\n",653 (*sim_callback->printf_filtered) (sim_callback, " float : %9.2f %%\n", 651 654 100.0 * (float) sregs->finst / (float) sregs->ninst); 652 printf(" Integer CPI : %9.2f\n",655 (*sim_callback->printf_filtered) (sim_callback, " Integer CPI : %9.2f\n", 653 656 ((float) (stime - sregs->pwdtime - sregs->fholdt - sregs->finst)) 654 657 / 655 658 (float) (sregs->ninst - sregs->finst)); 656 printf(" Float CPI : %9.2f\n",659 (*sim_callback->printf_filtered) (sim_callback, " Float CPI : %9.2f\n", 657 660 ((float) sregs->fholdt / (float) sregs->finst) + 1.0); 658 661 #endif 659 printf(" Overall CPI : %9.2f\n",662 (*sim_callback->printf_filtered) (sim_callback, " Overall CPI : %9.2f\n", 660 663 (float) (stime - sregs->pwdtime) / (float) sregs->ninst); 661 printf("\n ERC32 performance (%4.1f MHz): %5.2f MOPS (%5.2f MIPS, %5.2f MFLOPS)\n",664 (*sim_callback->printf_filtered) (sim_callback, "\n ERC32 performance (%4.1f MHz): %5.2f MOPS (%5.2f MIPS, %5.2f MFLOPS)\n", 662 665 sregs->freq, sregs->freq * (float) sregs->ninst / (float) (stime - sregs->pwdtime), 663 666 sregs->freq * (float) (sregs->ninst - sregs->finst) / 664 667 (float) (stime - sregs->pwdtime), 665 668 sregs->freq * (float) sregs->finst / (float) (stime - sregs->pwdtime)); 666 printf(" Simulated ERC32 time : %.2f s\n",669 (*sim_callback->printf_filtered) (sim_callback, " Simulated ERC32 time : %.2f s\n", 667 670 (float) (ebase.simtime - sregs->simstart) / 1000000.0 / sregs->freq); 668 printf(" Processor utilisation : %.2f %%\n",671 (*sim_callback->printf_filtered) (sim_callback, " Processor utilisation : %.2f %%\n", 669 672 100.0 * (1.0 - ((float) sregs->pwdtime / (float) stime))); 670 printf(" Real-time performance : %.2f %%\n",673 (*sim_callback->printf_filtered) (sim_callback, " Real-time performance : %.2f %%\n", 671 674 100.0 / (sregs->tottime / ((double) (stime) / (sregs->freq * 1.0E6)))); 672 printf(" Simulator performance : %.2f MIPS\n",675 (*sim_callback->printf_filtered) (sim_callback, " Simulator performance : %.2f MIPS\n", 673 676 (double)(sregs->ninst) / sregs->tottime / 1E6); 674 printf(" Used time (sys + user) : %.2f s\n\n", sregs->tottime);677 (*sim_callback->printf_filtered) (sim_callback, " Used time (sys + user) : %.2f s\n\n", sregs->tottime); 675 678 } 676 679 677 680 … … 692 695 int32 sig; 693 696 { 694 697 if (sig != 2) 695 printf("\n\n Signal handler error (%d)\n\n", sig);698 (*sim_callback->printf_filtered) (sim_callback, "\n\n Signal handler error (%d)\n\n", sig); 696 699 ctrl_c = 1; 697 700 } 698 701 … … 721 724 int i; 722 725 float t; 723 726 724 printf("\n fsr: %08X\n\n", sregs->fsr);727 (*sim_callback->printf_filtered) (sim_callback, "\n fsr: %08X\n\n", sregs->fsr); 725 728 726 729 #ifdef HOST_LITTLE_ENDIAN 727 730 for (i = 0; i < 32; i++) … … 730 733 731 734 for (i = 0; i < 32; i++) { 732 735 t = sregs->fs[i]; 733 printf(" f%02d %08x %14e ", i, sregs->fsi[i], sregs->fs[i]);736 (*sim_callback->printf_filtered) (sim_callback, " f%02d %08x %14e ", i, sregs->fsi[i], sregs->fs[i]); 734 737 if (!(i & 1)) 735 printf("%14e\n", sregs->fd[i >> 1]);738 (*sim_callback->printf_filtered) (sim_callback, "%14e\n", sregs->fd[i >> 1]); 736 739 else 737 printf("\n");740 (*sim_callback->printf_filtered) (sim_callback, "\n"); 738 741 } 739 printf("\n");742 (*sim_callback->printf_filtered) (sim_callback, "\n"); 740 743 return OK; 741 744 } 742 745 … … 749 752 int i; 750 753 751 754 cwp = ((cwp & 0x7) << 4); 752 printf("\n\t INS LOCALS OUTS GLOBALS\n");755 (*sim_callback->printf_filtered) (sim_callback, "\n\t INS LOCALS OUTS GLOBALS\n"); 753 756 for (i = 0; i < 8; i++) { 754 printf(" %d: %08X %08X %08X %08X\n", i,757 (*sim_callback->printf_filtered) (sim_callback, " %d: %08X %08X %08X %08X\n", i, 755 758 sregs->r[(cwp + i + 24) & 0x7f], 756 759 sregs->r[(cwp + i + 16) & 0x7f], sregs->r[(cwp + i + 8) & 0x7f], 757 760 sregs->g[i]); … … 776 779 777 780 uint32 i; 778 781 779 printf("\n psr: %08X wim: %08X tbr: %08X y: %08X\n",782 (*sim_callback->printf_filtered) (sim_callback, "\n psr: %08X wim: %08X tbr: %08X y: %08X\n", 780 783 sregs->psr, sregs->wim, sregs->tbr, sregs->y); 781 784 sis_memory_read (sregs->pc, (char *) &i, 4); 782 785 printf ("\n pc: %08X = %08X ", sregs->pc, i); … … 785 788 printf ("\n npc: %08X = %08X ", sregs->npc, i); 786 789 print_insn_sparc_sis(sregs->npc, &dinfo); 787 790 if (sregs->err_mode) 788 printf("\n IU in error mode");789 printf("\n\n");791 (*sim_callback->printf_filtered) (sim_callback, "\n IU in error mode"); 792 (*sim_callback->printf_filtered) (sim_callback, "\n\n"); 790 793 } 791 794 792 795 static void … … 804 807 char *p; 805 808 806 809 for (i = addr & ~3; i < ((addr + len) & ~3); i += 16) { 807 printf("\n %8X ", i);810 (*sim_callback->printf_filtered) (sim_callback, "\n %8X ", i); 808 811 for (j = 0; j < 4; j++) { 809 812 sis_memory_read ((i + (j * 4)), data.u8, 4); 810 813 printf ("%08x ", data.u32); 811 814 mem[j] = data.u32; 812 815 } 813 printf(" ");816 (*sim_callback->printf_filtered) (sim_callback, " "); 814 817 p = (char *) mem; 815 818 for (j = 0; j < 16; j++) { 816 819 if (isprint (p[j ^ EBT])) … … 819 822 putchar('.'); 820 823 } 821 824 } 822 printf("\n\n");825 (*sim_callback->printf_filtered) (sim_callback, "\n\n"); 823 826 } 824 827 825 828 void … … 839 842 printf (" %08x %08x ", i, data.u32); 840 843 print_insn_sparc_sis(i, info); 841 844 if (i >= 0xfffffffc) break; 842 printf("\n");845 (*sim_callback->printf_filtered) (sim_callback, "\n"); 843 846 } 844 847 } 845 848 … … 854 857 struct evcell *ev1, *evins; 855 858 856 859 if (ebase.freeq == NULL) { 857 printf("Error, too many events in event queue\n");860 (*sim_callback->printf_filtered) (sim_callback, "Error, too many events in event queue\n"); 858 861 return; 859 862 } 860 863 ev1 = &ebase.eq; … … 959 962 uint64 endtime; 960 963 961 964 if (ebase.eq.nxt == NULL) 962 printf("Warning: event queue empty - power-down mode not entered\n");965 (*sim_callback->printf_filtered) (sim_callback, "Warning: event queue empty - power-down mode not entered\n"); 963 966 endtime = ebase.simtime; 964 967 while (!ext_irl && (ebase.eq.nxt != NULL)) { 965 968 ebase.simtime = ebase.eq.nxt->time; … … 971 974 ebase.freeq = evrem; 972 975 cfunc(arg); 973 976 if (ctrl_c) { 974 printf("\bwarning: power-down mode interrupted\n");977 (*sim_callback->printf_filtered) (sim_callback, "\bwarning: power-down mode interrupted\n"); 975 978 break; 976 979 } 977 980 } … … 1039 1042 pbfd = bfd_openr(fname, 0); 1040 1043 1041 1044 if (pbfd == NULL) { 1042 printf("open of %s failed\n", fname);1045 (*sim_callback->printf_filtered) (sim_callback, "open of %s failed\n", fname); 1043 1046 return -1; 1044 1047 } 1045 1048 if (!bfd_check_format(pbfd, bfd_object)) { 1046 printf("file %s doesn't seem to be an object file\n", fname);1049 (*sim_callback->printf_filtered) (sim_callback, "file %s doesn't seem to be an object file\n", fname); 1047 1050 return -1; 1048 1051 } 1049 1052 1050 1053 arch = bfd_get_arch_info (pbfd); 1051 1054 if (sis_verbose) 1052 printf("loading %s:", fname);1055 (*sim_callback->printf_filtered) (sim_callback, "loading %s:", fname); 1053 1056 for (section = pbfd->sections; section; section = section->next) { 1054 1057 if (bfd_get_section_flags(pbfd, section) & SEC_ALLOC) { 1055 1058 bfd_vma section_address; … … 1087 1090 section_size = bfd_section_size(pbfd, section); 1088 1091 1089 1092 if (sis_verbose) 1090 printf("\nsection %s at 0x%08lx (0x%lx bytes)",1093 (*sim_callback->printf_filtered) (sim_callback, "\nsection %s at 0x%08lx (0x%lx bytes)", 1091 1094 section_name, section_address, section_size); 1092 1095 1093 1096 /* Text, data or lit */ … … 1113 1116 } 1114 1117 } else /* BSS */ 1115 1118 if (sis_verbose) 1116 printf("(not loaded)");1119 (*sim_callback->printf_filtered) (sim_callback, "(not loaded)"); 1117 1120 } 1118 1121 } 1119 1122 if (sis_verbose) 1120 printf("\n");1123 (*sim_callback->printf_filtered) (sim_callback, "\n"); 1121 1124 1122 1125 return bfd_get_start_address (pbfd); 1123 1126 } -
sim/erc32/interf.c
diff -ruw gdb-7.11.orig1/sim/erc32/interf.c gdb-7.11/sim/erc32/interf.c
old new 57 57 58 58 int sis_gdb_break = 1; 59 59 60 host_callback *sim_callback;61 62 60 int 63 61 run_sim(sregs, icount, dis) 64 62 struct pstate *sregs; … … 89 87 #if 0 /* DELETE ME! for debugging purposes only */ 90 88 if (sis_verbose > 1) 91 89 if (sregs->pc == 0 || sregs->npc == 0) 92 printf ("bogus pc or npc\n");90 (*sim_callback->printf_filtered) (sim_callback, "bogus pc or npc\n"); 93 91 #endif 94 92 mexc = memory_iread (sregs->pc, &sregs->inst, &sregs->hold); 95 93 #if 0 /* DELETE ME! for debugging purposes only */ 96 94 if (sis_verbose > 2) 97 printf("pc %x, np %x, sp %x, fp %x, wm %x, cw %x, i %08x\n",95 (*sim_callback->printf_filtered) (sim_callback, "pc %x, np %x, sp %x, fp %x, wm %x, cw %x, i %08x\n", 98 96 sregs->pc, sregs->npc, 99 97 sregs->r[(((sregs->psr & 7) << 4) + 14) & 0x7f], 100 98 sregs->r[(((sregs->psr & 7) << 4) + 30) & 0x7f], … … 192 190 if (strcmp(argv[stat], "-dumbio") == 0) { 193 191 dumbio = 1; 194 192 } else 193 if (strcmp(argv[stat], "-nouartrx") == 0) { 194 nouartrx = 1; 195 } else 195 196 if (strcmp(argv[stat], "-wrp") == 0) { 196 197 wrp = 1; 197 198 } else … … 430 431 #if 1 431 432 if (sis_verbose > 2) { 432 433 uint32 fp = sregs.r[(win * 16 + 30) & 0x7f]; 433 printf("flush_window: win %d, sp %x, fp %x\n", win, sp, fp);434 (*sim_callback->printf_filtered) (sim_callback, "flush_window: win %d, sp %x, fp %x\n", win, sp, fp); 434 435 } 435 436 #endif 436 437 -
sim/erc32/sis.c
diff -ruw gdb-7.11.orig1/sim/erc32/sis.c gdb-7.11/sim/erc32/sis.c
old new 199 199 #endif 200 200 } else if (strcmp(argv[stat], "-dumbio") == 0) { 201 201 dumbio = 1; 202 } else if (strcmp(argv[stat], "-nouartrx") == 0) { 203 nouartrx = 1; 202 204 } else { 203 205 printf("unknown option %s\n", argv[stat]); 204 206 usage(); … … 293 295 } 294 296 return 0; 295 297 } 296 -
sim/erc32/sis.h
diff -ruw gdb-7.11.orig1/sim/erc32/sis.h gdb-7.11/sim/erc32/sis.h
old new 158 158 /* Prototypes */ 159 159 160 160 /* erc32.c */ 161 extern void init_sim ( void);161 extern void init_sim (); 162 162 extern void reset (void); 163 163 extern void error_mode (uint32 pc); 164 164 extern void sim_halt (void); … … 200 200 extern void sys_halt (void); 201 201 extern int bfd_load (const char *fname); 202 202 extern double get_time (void); 203 extern int nouartrx; 204 extern host_callback *sim_callback; 203 205 204 206 /* exec.c */ 205 207 extern int dispatch_instruction (struct pstate *sregs);
Note: See TracBrowser
for help on using the repository browser.