Changeset 3f6c16fe in mainline
- Timestamp:
- 2012-11-22T22:48:03Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 711a38b
- Parents:
- e32720ff
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/console/cmd.c
re32720ff r3f6c16fe 696 696 uint8_t *ptr = NULL; 697 697 #ifdef IO_SPACE_BOUNDARY 698 if ( argv->intval < IO_SPACE_BOUNDARY)699 ptr = argv[0].intval;698 if ((void *) argv->intval < IO_SPACE_BOUNDARY) 699 ptr = (void *) argv[0].intval; 700 700 else 701 701 #endif 702 ptr = (uint8_t*)km_map(argv[0].intval, sizeof(uint8_t), PAGE_NOT_CACHEABLE); 702 ptr = (uint8_t*) km_map(argv[0].intval, sizeof(uint8_t), 703 PAGE_NOT_CACHEABLE); 703 704 const uint8_t val = pio_read_8(ptr); 704 printf("read % x: %"PRIx8"\n", argv[0].intval, val);705 printf("read %"PRIxn": %"PRIx8"\n", argv[0].intval, val); 705 706 #ifdef IO_SPACE_BOUNDARY 706 if ( argv->intval < IO_SPACE_BOUNDARY)707 if ((void *) argv->intval < IO_SPACE_BOUNDARY) 707 708 return 1; 708 709 #endif … … 721 722 uint16_t *ptr = NULL; 722 723 #ifdef IO_SPACE_BOUNDARY 723 if ( argv->intval < IO_SPACE_BOUNDARY)724 ptr = argv[0].intval;724 if ((void *) argv->intval < IO_SPACE_BOUNDARY) 725 ptr = (void *)argv[0].intval; 725 726 else 726 727 #endif 727 ptr = (uint16_t*)km_map(argv[0].intval, sizeof(uint16_t), PAGE_NOT_CACHEABLE); 728 ptr = (uint16_t*)km_map(argv[0].intval, sizeof(uint16_t), 729 PAGE_NOT_CACHEABLE); 728 730 const uint16_t val = pio_read_16(ptr); 729 printf("read % x: %"PRIx16"\n", argv[0].intval, val);731 printf("read %"PRIxn": %"PRIx16"\n", argv[0].intval, val); 730 732 #ifdef IO_SPACE_BOUNDARY 731 if ( argv->intval < IO_SPACE_BOUNDARY)733 if ((void *) argv->intval < IO_SPACE_BOUNDARY) 732 734 return 1; 733 735 #endif … … 746 748 uint32_t *ptr = NULL; 747 749 #ifdef IO_SPACE_BOUNDARY 748 if ( argv->intval < IO_SPACE_BOUNDARY)749 ptr = argv[0].intval;750 if ((void *) argv->intval < IO_SPACE_BOUNDARY) 751 ptr = (void *) argv[0].intval; 750 752 else 751 753 #endif 752 ptr = (uint32_t*)km_map(argv[0].intval, sizeof(uint32_t), PAGE_NOT_CACHEABLE); 754 ptr = (uint32_t*)km_map(argv[0].intval, sizeof(uint32_t), 755 PAGE_NOT_CACHEABLE); 753 756 const uint32_t val = pio_read_32(ptr); 754 printf("read % #x: %#"PRIx32"\n", argv[0].intval, val);757 printf("read %"PRIxn": %"PRIx32"\n", argv[0].intval, val); 755 758 #ifdef IO_SPACE_BOUNDARY 756 if ( argv->intval < IO_SPACE_BOUNDARY)759 if ((void *) argv->intval < IO_SPACE_BOUNDARY) 757 760 return 1; 758 761 #endif … … 771 774 uint8_t *ptr = NULL; 772 775 #ifdef IO_SPACE_BOUNDARY 773 if ( argv->intval < IO_SPACE_BOUNDARY)774 ptr = argv[0].intval;776 if ((void *) argv->intval < IO_SPACE_BOUNDARY) 777 ptr = (void *) argv[0].intval; 775 778 else 776 779 #endif 777 ptr = (uint8_t*)km_map(argv[0].intval, sizeof(uint8_t), PAGE_NOT_CACHEABLE); 778 printf("write %x: %"PRIx8"\n", argv[0].intval, (uint8_t)argv[1].intval); 780 ptr = (uint8_t*)km_map(argv[0].intval, sizeof(uint8_t), 781 PAGE_NOT_CACHEABLE); 782 printf("write %"PRIxn": %"PRIx8"\n", argv[0].intval, 783 (uint8_t)argv[1].intval); 779 784 pio_write_8(ptr, (uint8_t)argv[1].intval); 780 785 #ifdef IO_SPACE_BOUNDARY 781 if ( argv->intval < IO_SPACE_BOUNDARY)786 if ((void *) argv->intval < IO_SPACE_BOUNDARY) 782 787 return 1; 783 788 #endif … … 796 801 uint16_t *ptr = NULL; 797 802 #ifdef IO_SPACE_BOUNDARY 798 if ( argv->intval < IO_SPACE_BOUNDARY)799 ptr = argv[0].intval;803 if ((void *) argv->intval < IO_SPACE_BOUNDARY) 804 ptr = (void *) argv[0].intval; 800 805 else 801 806 #endif 802 ptr = (uint16_t*)km_map(argv[0].intval, sizeof(uint16_t), PAGE_NOT_CACHEABLE); 803 printf("write %x: %"PRIx16"\n", argv[0].intval, (uint16_t)argv[1].intval); 807 ptr = (uint16_t*)km_map(argv[0].intval, sizeof(uint16_t), 808 PAGE_NOT_CACHEABLE); 809 printf("write %"PRIxn": %"PRIx16"\n", argv[0].intval, 810 (uint16_t)argv[1].intval); 804 811 pio_write_16(ptr, (uint16_t)argv[1].intval); 805 812 #ifdef IO_SPACE_BOUNDARY 806 if ( argv->intval < IO_SPACE_BOUNDARY)813 if ((void *) argv->intval < IO_SPACE_BOUNDARY) 807 814 return 1; 808 815 #endif … … 821 828 uint32_t *ptr = NULL; 822 829 #ifdef IO_SPACE_BOUNDARY 823 if ( argv->intval < IO_SPACE_BOUNDARY)824 ptr = argv[0].intval;830 if ((void *) argv->intval < IO_SPACE_BOUNDARY) 831 ptr = (void *) argv[0].intval; 825 832 else 826 833 #endif 827 ptr = (uint32_t*)km_map(argv[0].intval, sizeof(uint32_t), PAGE_NOT_CACHEABLE); 828 printf("write %x: %"PRIx32"\n", argv[0].intval, (uint32_t)argv[1].intval); 834 ptr = (uint32_t*)km_map(argv[0].intval, sizeof(uint32_t), 835 PAGE_NOT_CACHEABLE); 836 printf("write %"PRIxn": %"PRIx32"\n", argv[0].intval, 837 (uint32_t)argv[1].intval); 829 838 pio_write_32(ptr, (uint32_t)argv[1].intval); 830 839 #ifdef IO_SPACE_BOUNDARY 831 if ( argv->intval < IO_SPACE_BOUNDARY)840 if ((void *) argv->intval < IO_SPACE_BOUNDARY) 832 841 return 1; 833 842 #endif
Note:
See TracChangeset
for help on using the changeset viewer.