Changeset 204 for soft/giet_vm/boot/boot_init.c
- Timestamp:
- Aug 14, 2012, 8:14:55 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/boot/boot_init.c
r203 r204 286 286 void boot_puts(const char *buffer) 287 287 { 288 unsigned int* tty_address = (unsigned int*)&seg_tty_base; 288 unsigned int* tty_address = (unsigned int*)( (unsigned)&seg_tty_base + 289 (CLUSTER_IO_ID * (unsigned)CLUSTER_SIZE) ); 289 290 unsigned int n; 290 291 … … 297 298 } 298 299 //////////////////////////////////////////////////////////////////////////// 299 // boot_put w()300 // boot_putx() 300 301 // (it uses TTY0) 301 302 //////////////////////////////////////////////////////////////////////////// 302 void boot_put w(unsigned int val)303 void boot_putx(unsigned int val) 303 304 { 304 305 static const char HexaTab[] = "0123456789ABCDEF"; … … 316 317 } 317 318 boot_puts(buf); 319 } 320 //////////////////////////////////////////////////////////////////////////// 321 // boot_putd() 322 // (it uses TTY0) 323 //////////////////////////////////////////////////////////////////////////// 324 void boot_putd(unsigned int val) 325 { 326 static const char DecTab[] = "0123456789"; 327 char buf[11]; 328 unsigned int i; 329 unsigned int first; 330 331 buf[10] = 0; 332 333 for ( i = 0 ; i < 10 ; i++ ) 334 { 335 if ((val != 0) || (i == 0)) 336 { 337 buf[9-i] = DecTab[val % 10]; 338 first = 9-i; 339 } 340 else 341 { 342 break; 343 } 344 val /= 10; 345 } 346 boot_puts( &buf[first] ); 318 347 } 319 348 … … 495 524 { 496 525 boot_puts("Unfound page table for vspace "); 497 boot_put w(vspace_id);526 boot_putd(vspace_id); 498 527 boot_puts("\n"); 499 528 boot_exit(); … … 530 559 if ( ( *pt_flags & PTE_V) != 0 ) // page already mapped 531 560 { 532 boot_puts("\n[BOOT ERROR] in boot_add_pte() function\n"); 533 boot_puts("page already mapped\n"); 561 boot_puts("\n[BOOT ERROR] double mapping in vspace "); 562 boot_putd( vspace_id ); 563 boot_puts(" for vpn = "); 564 boot_putx( vpn ); 565 boot_puts("\n"); 534 566 boot_exit(); 535 567 } … … 579 611 boot_puts( vseg[vseg_id].name ); 580 612 boot_puts(" : flags = "); 581 boot_put w( flags );613 boot_putx( flags ); 582 614 boot_puts(" / npages = "); 583 boot_put w( npages );615 boot_putd( npages ); 584 616 boot_puts(" / pbase = "); 585 boot_put w( vseg[vseg_id].pbase );617 boot_putx( vseg[vseg_id].pbase ); 586 618 boot_puts("\n"); 587 619 #endif … … 615 647 boot_puts( vseg[vseg_id].name ); 616 648 boot_puts(" / flags = "); 617 boot_put w( flags );649 boot_putx( flags ); 618 650 boot_puts(" / npages = "); 619 boot_put w( npages );651 boot_putd( npages ); 620 652 boot_puts(" / pbase = "); 621 boot_put w( vseg[vseg_id].pbase );653 boot_putx( vseg[vseg_id].pbase ); 622 654 boot_puts("\n"); 623 655 #endif … … 720 752 boot_puts( "\n[BOOT ERROR] in boot_vseg_map() function, " ); 721 753 boot_puts("PTAB too small, minumum size is: "); 722 boot_put w( PT1_SIZE + PT2_SIZE);754 boot_putx( PT1_SIZE + PT2_SIZE); 723 755 boot_exit(); 724 756 } … … 750 782 boot_puts("\n"); 751 783 boot_puts("vseg pbase = "); 752 boot_put w( vseg->pbase );784 boot_putx( vseg->pbase ); 753 785 boot_puts("\n"); 754 786 boot_puts("vseg length = "); 755 boot_put w( vseg->length );787 boot_putx( vseg->length ); 756 788 boot_puts("\n"); 757 789 boot_puts("pseg pbase = "); 758 boot_put w( pseg->base );790 boot_putx( pseg->base ); 759 791 boot_puts("\n"); 760 792 boot_puts("pseg length = "); 761 boot_put w( pseg->length );793 boot_putx( pseg->length ); 762 794 boot_puts("\n"); 763 795 boot_exit(); … … 771 803 boot_puts( vseg->name ); 772 804 boot_puts(" : len = "); 773 boot_put w( vseg->length );805 boot_putx( vseg->length ); 774 806 boot_puts(" / vbase = "); 775 boot_put w( vseg->vbase );807 boot_putx( vseg->vbase ); 776 808 boot_puts(" / pbase = "); 777 boot_put w( vseg->pbase );809 boot_putx( vseg->pbase ); 778 810 boot_puts("\n"); 779 811 #endif … … 795 827 { 796 828 boot_puts("\n[BOOT ERROR] Illegal mapping signature: "); 797 boot_put w(header->signature);829 boot_putx(header->signature); 798 830 boot_puts("\n"); 799 831 boot_exit(); … … 805 837 boot_puts("\n[BOOT ERROR] Incoherent NB_CLUSTERS"); 806 838 boot_puts("\n - In giet_config, value = "); 807 boot_put w( NB_CLUSTERS );839 boot_putd ( NB_CLUSTERS ); 808 840 boot_puts("\n - In mapping_info, value = "); 809 boot_put w( header->clusters );841 boot_putd ( header->clusters ); 810 842 boot_puts("\n"); 811 843 boot_exit(); … … 823 855 unsigned int periph_id; 824 856 unsigned int cluster_id; 825 unsigned int channels;826 857 unsigned int tty_found = 0; 827 858 unsigned int nic_found = 0; … … 832 863 { 833 864 boot_puts("\n[BOOT ERROR] too much processors in cluster "); 834 boot_put w( cluster_id );865 boot_putd( cluster_id ); 835 866 boot_puts(" : procs = "); 836 boot_put w( cluster[cluster_id].procs );867 boot_putd ( cluster[cluster_id].procs ); 837 868 boot_puts("\n"); 838 869 boot_exit(); … … 854 885 { 855 886 boot_puts("\n[BOOT ERROR] Wrong NB_TTYS in cluster "); 856 boot_put w( cluster_id );887 boot_putd( cluster_id ); 857 888 boot_puts(" : ttys = "); 858 boot_put w( periph[periph_id].channels );889 boot_putd ( periph[periph_id].channels ); 859 890 boot_puts("\n"); 860 891 boot_exit(); … … 873 904 { 874 905 boot_puts("\n[BOOT ERROR] Wrong NB_NICS in cluster "); 875 boot_put w( cluster_id );906 boot_putd( cluster_id ); 876 907 boot_puts(" : nics = "); 877 boot_put w( periph[periph_id].channels );908 boot_putd ( periph[periph_id].channels ); 878 909 boot_puts("\n"); 879 910 boot_exit(); … … 887 918 { 888 919 boot_puts("\n[BOOT ERROR] Too much user timers in cluster "); 889 boot_put w( cluster_id );920 boot_putd( cluster_id ); 890 921 boot_puts(" : timers = "); 891 boot_put w( periph[periph_id].channels );922 boot_putd ( periph[periph_id].channels ); 892 923 boot_puts("\n"); 893 924 boot_exit(); … … 900 931 { 901 932 boot_puts("\n[BOOT ERROR] Too much DMA channels in cluster "); 902 boot_put w( cluster_id );933 boot_putd( cluster_id ); 903 934 boot_puts(" : channels = "); 904 boot_put w( periph[periph_id].channels );935 boot_putd ( periph[periph_id].channels ); 905 936 boot_puts("\n"); 906 937 boot_exit(); … … 937 968 { 938 969 boot_puts("\n[BOOT ERROR] The number of processors in cluster "); 939 boot_put w( cluster_id );970 boot_putd( cluster_id ); 940 971 boot_puts(" is larger than NB_PROCS_MAX \n"); 941 972 boot_exit(); … … 959 990 #if BOOT_DEBUG_PT 960 991 boot_puts("cluster "); 961 boot_put w(cluster_id);992 boot_putd(cluster_id); 962 993 boot_puts(" / pseg "); 963 994 boot_puts(pseg[pseg_id].name); 964 995 boot_puts(" : next_base = "); 965 boot_put w(pseg[pseg_id].next_base);996 boot_putx(pseg[pseg_id].next_base); 966 997 boot_puts("\n"); 967 998 #endif … … 1028 1059 #if BOOT_DEBUG_PT 1029 1060 boot_puts("\n>>> page table physical address = "); 1030 boot_put w((unsigned int)boot_ptabs_paddr[vspace_id]);1061 boot_putx((unsigned int)boot_ptabs_paddr[vspace_id]); 1031 1062 boot_puts(", page table number of PT2 = "); 1032 boot_put w((unsigned int)boot_max_pt2[vspace_id]);1063 boot_putd((unsigned int)boot_max_pt2[vspace_id]); 1033 1064 boot_puts("\n"); 1034 1065 #endif … … 1082 1113 boot_puts( vobj[vobj_id].name); 1083 1114 boot_puts(" / depth = "); 1084 boot_put w( mwmr->depth );1115 boot_putd( mwmr->depth ); 1085 1116 boot_puts(" / width = "); 1086 boot_put w( mwmr->width );1117 boot_putd( mwmr->width ); 1087 1118 boot_puts("\n"); 1088 1119 #endif … … 1095 1126 boot_puts( vobj[vobj_id].name); 1096 1127 boot_puts(" / length = "); 1097 boot_put w( vobj[vobj_id].length );1128 boot_putx( vobj[vobj_id].length ); 1098 1129 boot_puts("\n"); 1099 1130 #endif … … 1106 1137 boot_puts( vobj[vobj_id].name); 1107 1138 boot_puts(" / length = "); 1108 boot_put w( vobj[vobj_id].length );1139 boot_putx( vobj[vobj_id].length ); 1109 1140 boot_puts("\n"); 1110 1141 #endif … … 1120 1151 boot_puts( vobj[vobj_id].name); 1121 1152 boot_puts(" / init_value = "); 1122 boot_put w( barrier->init );1153 boot_putd( barrier->init ); 1123 1154 boot_puts("\n"); 1124 1155 #endif … … 1142 1173 boot_puts( vobj[vobj_id].name); 1143 1174 boot_puts(" / length = "); 1144 boot_put w( vobj[vobj_id].length );1175 boot_putx( vobj[vobj_id].length ); 1145 1176 boot_puts("\n"); 1146 1177 #endif … … 1154 1185 boot_puts( vobj[vobj_id].name); 1155 1186 boot_puts(" / length = "); 1156 boot_put w( vobj[vobj_id].length );1187 boot_putx( vobj[vobj_id].length ); 1157 1188 boot_puts("\n"); 1158 1189 #endif … … 1173 1204 { 1174 1205 boot_puts("\n[INIT ERROR] Missing PTAB for vspace "); 1175 boot_put w( vspace_id );1206 boot_putd( vspace_id ); 1176 1207 boot_exit(); 1177 1208 } … … 1185 1216 volatile unsigned int *cbase = (unsigned int*) coproc; 1186 1217 1187 1188 1218 cbase[MWMR_CONFIG_FIFO_WAY] = way ; 1189 1219 cbase[MWMR_CONFIG_FIFO_NO] = no ; … … 1222 1252 #if BOOT_DEBUG_PERI 1223 1253 boot_puts("\n[BOOT DEBUG] ****** peripheral initialisation in cluster "); 1224 boot_put w( cluster_id );1254 boot_putd( cluster_id ); 1225 1255 boot_puts(" ******\n"); 1226 1256 #endif … … 1245 1275 #if BOOT_DEBUG_PERI 1246 1276 boot_puts("- IOC initialised : "); 1247 boot_put w( channels );1277 boot_putd( channels ); 1248 1278 boot_puts(" channels\n"); 1249 1279 #endif … … 1261 1291 #if BOOT_DEBUG_PERI 1262 1292 boot_puts("- DMA initialised : "); 1263 boot_put w( channels );1293 boot_putd( channels ); 1264 1294 boot_puts(" channels\n"); 1265 1295 #endif … … 1276 1306 #if BOOT_DEBUG_PERI 1277 1307 boot_puts("- NIC initialised : "); 1278 boot_put w( channels );1308 boot_putd( channels ); 1279 1309 boot_puts(" channels\n"); 1280 1310 #endif … … 1298 1328 #if BOOT_DEBUG_PERI 1299 1329 boot_puts("- IOB initialised : "); 1300 boot_put w( channels );1330 boot_putd( channels ); 1301 1331 boot_puts(" channels\n"); 1302 1332 #endif … … 1304 1334 1305 1335 } // end for periphs 1306 /* 1336 1307 1337 for ( coproc_id = cluster[cluster_id].coproc_offset ; 1308 1338 coproc_id < cluster[cluster_id].coproc_offset + cluster[cluster_id].coprocs ; … … 1315 1345 #if BOOT_DEBUG_PERI 1316 1346 boot_puts("[BOOT] mwmr coproc initialisation of "); 1317 boot_put w((unsigned int) coproc[coproc_id].name);1347 boot_putx((unsigned int) coproc[coproc_id].name); 1318 1348 boot_puts(", nb ports"); 1319 boot_put w((unsigned int)coproc[coproc_id].ports);1349 boot_putd((unsigned int)coproc[coproc_id].ports); 1320 1350 boot_puts("\n"); 1321 1351 #endif … … 1356 1386 } 1357 1387 } // end for coprocs 1358 */ 1388 1359 1389 } // end for clusters 1360 1390 } // end boot_peripherals_init() … … 1417 1447 #if BOOT_DEBUG_SCHED 1418 1448 boot_puts("\n[BOOT DEBUG] Initialise schedulers / IT vector in cluster "); 1419 boot_put w( cluster_id );1449 boot_putd( cluster_id ); 1420 1450 boot_puts("\n"); 1421 1451 #endif … … 1440 1470 { 1441 1471 boot_puts("\n[BOOT ERROR] Missing RAM pseg in cluster "); 1442 boot_put w( cluster_id );1472 boot_putd( cluster_id ); 1443 1473 boot_puts("\n"); 1444 1474 boot_exit(); … … 1459 1489 #if BOOT_DEBUG_SCHED 1460 1490 boot_puts("\nProc "); 1461 boot_put w( proc_id );1491 boot_putd( proc_id ); 1462 1492 boot_puts(" : scheduler pbase = "); 1463 boot_put w( pseg_pbase + (proc_id<<12) );1493 boot_putx( pseg_pbase + (proc_id<<12) ); 1464 1494 boot_puts("\n"); 1465 1495 #endif … … 1488 1518 #if BOOT_DEBUG_SCHED 1489 1519 boot_puts("- IRQ : icu = "); 1490 boot_put w( icu_id );1520 boot_putd( icu_id ); 1491 1521 boot_puts(" / type = "); 1492 boot_put w( type );1522 boot_putd( type ); 1493 1523 boot_puts(" / isr = "); 1494 boot_put w( isr_id );1524 boot_putd( isr_id ); 1495 1525 boot_puts(" / channel = "); 1496 boot_put w( channel );1526 boot_putd( channel ); 1497 1527 boot_puts("\n"); 1498 1528 #endif … … 1627 1657 { 1628 1658 boot_puts("\n[BOOT ERROR] : "); 1629 boot_put w( ltid );1659 boot_putd( ltid ); 1630 1660 boot_puts(" tasks allocated to processor "); 1631 boot_put w( gpid );1661 boot_putd( gpid ); 1632 1662 boot_puts(" / max is 15\n"); 1633 1663 boot_exit(); … … 1659 1689 boot_puts( task[task_id].name ); 1660 1690 boot_puts(" allocated to processor "); 1661 boot_put w( gpid );1691 boot_putd( gpid ); 1662 1692 boot_puts(" - ctx[LTID] = "); 1663 boot_put w( ltid );1693 boot_putd( ltid ); 1664 1694 boot_puts("\n"); 1665 1695 1666 1696 boot_puts(" - ctx[SR] = "); 1667 boot_put w( ctx_sr );1697 boot_putx( ctx_sr ); 1668 1698 boot_puts("\n"); 1669 1699 1670 1700 boot_puts(" - ctx[SR] = "); 1671 boot_put w( ctx_sp );1701 boot_putx( ctx_sp ); 1672 1702 boot_puts("\n"); 1673 1703 1674 1704 boot_puts(" - ctx[RA] = "); 1675 boot_put w( ctx_ra );1705 boot_putx( ctx_ra ); 1676 1706 boot_puts("\n"); 1677 1707 1678 1708 boot_puts(" - ctx[EPC] = "); 1679 boot_put w( ctx_epc );1709 boot_putx( ctx_epc ); 1680 1710 boot_puts("\n"); 1681 1711 1682 1712 boot_puts(" - ctx[PTPR] = "); 1683 boot_put w( ctx_ptpr );1713 boot_putx( ctx_ptpr ); 1684 1714 boot_puts("\n"); 1685 1715 1686 1716 boot_puts(" - ctx[TTY] = "); 1687 boot_put w( ctx_tty );1717 boot_putd( ctx_tty ); 1688 1718 boot_puts("\n"); 1689 1719 1690 1720 boot_puts(" - ctx[NIC] = "); 1691 boot_put w( ctx_nic );1721 boot_putd( ctx_nic ); 1692 1722 boot_puts("\n"); 1693 1723 1694 1724 boot_puts(" - ctx[TIMER] = "); 1695 boot_put w( ctx_timer );1725 boot_putd( ctx_timer ); 1696 1726 boot_puts("\n"); 1697 1727 1698 1728 boot_puts(" - ctx[FBDMA] = "); 1699 boot_put w( ctx_fbdma );1729 boot_putd( ctx_fbdma ); 1700 1730 boot_puts("\n"); 1701 1731 1702 1732 boot_puts(" - ctx[PTAB] = "); 1703 boot_put w( ctx_ptab );1733 boot_putx( ctx_ptab ); 1704 1734 boot_puts("\n"); 1705 1735 1706 1736 boot_puts(" - ctx[VSID] = "); 1707 boot_put w( vspace_id );1737 boot_putd( vspace_id ); 1708 1738 boot_puts("\n"); 1709 1739 … … 1732 1762 1733 1763 boot_puts("\n[BOOT] Mapping check completed at cycle "); 1734 boot_put w( boot_proctime() );1764 boot_putd( boot_proctime() ); 1735 1765 boot_puts("\n"); 1736 1766 … … 1739 1769 1740 1770 boot_puts("\n[BOOT] Pseg allocators initialisation completed at cycle "); 1741 boot_put w( boot_proctime() );1771 boot_putd( boot_proctime() ); 1742 1772 boot_puts("\n"); 1743 1773 … … 1746 1776 1747 1777 boot_puts("\n[BOOT] Page Tables initialisation completed at cycle "); 1748 boot_put w( boot_proctime() );1778 boot_putd( boot_proctime() ); 1749 1779 boot_puts("\n"); 1750 1780 … … 1753 1783 1754 1784 boot_puts("\n[BOOT] Vobjs initialisation completed at cycle : "); 1755 boot_put w( boot_proctime() );1785 boot_putd( boot_proctime() ); 1756 1786 boot_puts("\n"); 1757 1787 … … 1760 1790 1761 1791 boot_puts("\n[BOOT] Peripherals initialisation completed at cycle "); 1762 boot_put w( boot_proctime() );1792 boot_putd( boot_proctime() ); 1763 1793 boot_puts("\n"); 1764 1794 … … 1768 1798 1769 1799 boot_puts("\n[BOOT] MMU activation completed at cycle "); 1770 boot_put w( boot_proctime() );1800 boot_putd( boot_proctime() ); 1771 1801 boot_puts("\n"); 1772 1802 … … 1775 1805 1776 1806 boot_puts("\n[BOOT] Schedulers initialisation completed at cycle "); 1777 boot_put w( boot_proctime() );1807 boot_putd( boot_proctime() ); 1778 1808 boot_puts("\n"); 1779 1809
Note: See TracChangeset
for help on using the changeset viewer.