Changeset b9f1585 in mainline
- Timestamp:
- 2019-01-03T06:53:22Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 043d464f
- Parents:
- b4a4ad94 (diff), 7acd787 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Files:
-
- 9 added
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
.gitignore
rb4a4ad94 rb9f1585 130 130 uspace/app/nic/nic 131 131 uspace/app/nterm/nterm 132 uspace/app/pci/pci 132 133 uspace/app/perf/perf 133 134 uspace/app/ping/ping -
abi/include/abi/ipc/interfaces.h
rb4a4ad94 rb9f1585 183 183 FOURCC_COMPACT('v', 'b', 'd', ' ') | IFACE_EXCHANGE_SERIALIZE, 184 184 INTERFACE_IPC_TEST = 185 FOURCC_COMPACT('i', 'p', 'c', 't') | IFACE_EXCHANGE_SERIALIZE 185 FOURCC_COMPACT('i', 'p', 'c', 't') | IFACE_EXCHANGE_SERIALIZE, 186 INTERFACE_PCI = 187 FOURCC_COMPACT('p', 'c', 'i', ' ') | IFACE_EXCHANGE_SERIALIZE 186 188 } iface_t; 187 189 -
boot/Makefile.common
rb4a4ad94 rb9f1585 206 206 netecho \ 207 207 nterm \ 208 pci \ 208 209 ping \ 209 210 pkg \ -
boot/arch/arm32/src/mm.c
rb4a4ad94 rb9f1585 99 99 * 100 100 * Memory areas used for I/O are excluded from caching. 101 * At the moment caching is enabled only on GTA02.102 101 * 103 102 * @param section The section number. … … 171 170 { 172 171 /* 173 * Create 1:1 virtual-physical mapping. 174 * Physical memory on BBxM a BBone starts at 2GB 175 * boundary, icp has a memory mirror at 2GB. 176 * (ARM Integrator Core Module User guide ch. 6.3, p. 6-7) 177 * gta02 somehow works (probably due to limited address size), 178 * s3c2442b manual ch. 5, p.5-1: 179 * "Address space: 128Mbytes per bank (total 1GB/8 banks)" 180 */ 181 for (pfn_t page = 0; page < PTL0_ENTRIES; ++page) 182 init_ptl0_section(&boot_pt[page], page); 172 * Our goal is to create page tables that serve two purposes: 173 * 174 * 1. Allow the loader to run in identity-mapped virtual memory and use 175 * I/O devices (e.g. an UART for logging). 176 * 2. Allow the kernel to start running in virtual memory from addresses 177 * above 2G. 178 * 179 * The matters are slightly complicated by the different locations of 180 * physical memory and I/O devices on the various boards that we 181 * support. We see two cases (but other are still possible): 182 * 183 * a) Both RAM and I/O is in memory below 2G 184 * For instance, this is the case of GTA02, Integrator/CP 185 * and RaspberryPi 186 * b) RAM starts at 2G and I/O devices are below 2G 187 * For example, this is the case of BeagleBone and BeagleBoard XM 188 * 189 * This leads to two possible setups of boot page tables: 190 * 191 * A) To arrange for a), split the virtual address space into two 192 * halves, both identity-mapping the first 2G of physical address 193 * space. 194 * B) To accommodate b), create one larger virtual address space 195 * identity-mapping the entire physical address space. 196 */ 197 198 for (pfn_t page = 0; page < PTL0_ENTRIES; page++) { 199 pfn_t frame = page; 200 if (BOOT_BASE < 0x80000000UL && page >= PTL0_ENTRIES / 2) 201 frame -= PTL0_ENTRIES / 2; 202 init_ptl0_section(&boot_pt[page], frame); 203 } 183 204 184 205 /* -
boot/arch/ia64/src/main.c
rb4a4ad94 rb9f1585 94 94 cur += md_size) { 95 95 efi_v1_memdesc_t *md = (efi_v1_memdesc_t *) cur; 96 memmap_item_t *o = NULL; 97 98 if (items) 99 o = &memmap[items - 1]; 96 100 97 101 switch ((efi_memory_type_t) md->type) { 102 case EFI_LOADER_CODE: 103 case EFI_LOADER_DATA: 104 case EFI_BOOT_SERVICES_CODE: 105 case EFI_BOOT_SERVICES_DATA: 98 106 case EFI_CONVENTIONAL_MEMORY: 107 if (o && o->type == MEMMAP_FREE_MEM && 108 o->base + o->size == md->phys_start) { 109 o->size += md->pages * EFI_PAGE_SIZE; 110 continue; 111 } 99 112 memmap[items].type = MEMMAP_FREE_MEM; 100 113 break; -
kernel/genarch/src/fb/fb.c
rb4a4ad94 rb9f1585 76 76 (instance)->cols + (col)) 77 77 78 #define BB_NEXT_COL(pos) (++(pos)) 79 78 80 #define GLYPH_POS(instance, glyph, y) \ 79 81 ((glyph) * (instance)->glyphbytes + (y) * (instance)->glyphscanline) … … 270 272 unsigned int x; 271 273 unsigned int col; 274 size_t bb_pos = BB_POS(instance, 0, row); 275 size_t bb_pos1 = BB_POS(instance, 0, row + 1); 272 276 273 277 for (col = 0, x = 0; col < instance->cols; … … 276 280 277 281 if (row < instance->rows - 1) { 278 if (instance->backbuf[ BB_POS(instance, col, row)] ==279 instance->backbuf[ BB_POS(instance, col, row + 1)])280 continue;281 282 glyph = instance->backbuf[ BB_POS(instance, col, row + 1)];282 if (instance->backbuf[bb_pos] == 283 instance->backbuf[bb_pos1]) 284 goto skip; 285 286 glyph = instance->backbuf[bb_pos1]; 283 287 } else 284 288 glyph = 0; … … 287 291 &instance->glyphs[GLYPH_POS(instance, glyph, yd)], 288 292 instance->glyphscanline); 293 skip: 294 BB_NEXT_COL(bb_pos); 295 BB_NEXT_COL(bb_pos1); 289 296 } 290 297 } … … 373 380 unsigned int x; 374 381 unsigned int col; 382 size_t bb_pos = BB_POS(instance, 0, row); 375 383 376 384 for (col = 0, x = 0; col < instance->cols; 377 385 col++, x += FONT_WIDTH) { 378 386 uint16_t glyph = 379 instance->backbuf[ BB_POS(instance, col, row)];387 instance->backbuf[bb_pos]; 380 388 void *dst = &instance->addr[FB_POS(instance, x, y + yd)]; 381 389 void *src = &instance->glyphs[GLYPH_POS(instance, glyph, yd)]; 382 390 memcpy(dst, src, instance->glyphscanline); 391 BB_NEXT_COL(bb_pos); 383 392 } 384 393 } -
tools/toolchain.sh
rb4a4ad94 rb9f1585 61 61 echo "Syntax:" 62 62 echo " $0 [--no-install] [--non-helenos-target] <platform>" 63 echo " $0 --test-version [<platform>]" 63 64 echo 64 65 echo "Possible target platforms are:" … … 95 96 } 96 97 98 test_version() { 99 echo "Cross-compiler toolchain build script" 100 echo 101 echo "Start testing the version of the installed software" 102 echo 103 104 if [ -z "$1" ] || [ "$1" == "all" ] ; then 105 PLATFORMS=("amd64" "arm32" "ia32" "ia64" "mips32" "mips32eb" "ppc32" "riscv64" "sparc64") 106 else 107 PLATFORMS=("$1") 108 fi 109 110 111 if [ -z "${CROSS_PREFIX}" ] ; then 112 CROSS_PREFIX="/usr/local/cross" 113 fi 114 115 for i in "${PLATFORMS[@]}" 116 do 117 PLATFORM="$i" 118 set_target_from_platform "$PLATFORM" 119 PREFIX="${CROSS_PREFIX}/bin/${HELENOS_TARGET}" 120 121 echo "== $PLATFORM ==" 122 test_app_version "Binutils" "ld" "GNU\ ld\ \(GNU\ Binutils\)\ ((\.|[0-9])+)" "$BINUTILS_VERSION" 123 test_app_version "GCC" "gcc" "gcc\ version\ ((\.|[0-9])+)" "$GCC_VERSION" 124 test_app_version "GDB" "gdb" "GNU\ gdb\ \(GDB\)\s+((\.|[0-9])+)" "$GDB_VERSION" 125 done 126 127 exit 128 } 129 130 test_app_version() { 131 PKGNAME="$1" 132 APPNAME="$2" 133 REGEX="$3" 134 INS_VERSION="$4" 135 136 137 APP="${PREFIX}-${APPNAME}" 138 if [ ! -e $APP ]; then 139 echo "- $PKGNAME is missing" 140 else 141 { 142 OUT=$(${APP} -v 2>&1) 143 } &> /dev/null 144 145 if [[ "$OUT" =~ $REGEX ]]; then 146 VERSION="${BASH_REMATCH[1]}" 147 if [ "$INS_VERSION" = "$VERSION" ]; then 148 echo "+ $PKGNAME is uptodate ($INS_VERSION)" 149 else 150 echo "- $PKGNAME ($VERSION) is outdated ($INS_VERSION)" 151 fi 152 else 153 echo "- $PKGNAME Unexpected output" 154 fi 155 fi 156 } 157 158 159 97 160 change_title() { 98 161 echo -en "\e]0;$1\a" … … 408 471 while [ "$#" -gt 1 ] ; do 409 472 case "$1" in 473 --test-version) 474 test_version "$2" 475 exit 476 ;; 410 477 --no-install) 411 478 REAL_INSTALL=false … … 427 494 428 495 case "$1" in 496 --test-version) 497 test_version 498 ;; 429 499 amd64|arm32|ia32|ia64|mips32|mips32eb|ppc32|riscv64|sparc64) 430 500 prepare -
uspace/Makefile
rb4a4ad94 rb9f1585 67 67 app/netecho \ 68 68 app/nterm \ 69 app/pci \ 69 70 app/perf \ 70 71 app/redir \ -
uspace/app/bdsh/cmds/modules/ls/ls.c
rb4a4ad94 rb9f1585 199 199 200 200 /* Populate the directory list. */ 201 if (ls.recursive ) {201 if (ls.recursive && nbdirs > 0) { 202 202 tmp = (struct dir_elem_t *) realloc(*dir_list_ptr, 203 203 nbdirs * sizeof(struct dir_elem_t)); -
uspace/drv/bus/pci/pciintel/Makefile
rb4a4ad94 rb9f1585 32 32 33 33 SOURCES = \ 34 ctl.c \ 34 35 pci.c 35 36 -
uspace/drv/bus/pci/pciintel/pci.c
rb4a4ad94 rb9f1585 1 1 /* 2 * Copyright (c) 2019 Jiri Svoboda 2 3 * Copyright (c) 2010 Lenka Trochtova 3 * Copyright (c) 2018 Jiri Svoboda4 4 * All rights reserved. 5 5 * … … 58 58 #include <pci_dev_iface.h> 59 59 60 #include "ctl.h" 60 61 #include "pci.h" 62 #include "pci_regs.h" 61 63 62 64 #define NAME "pciintel" … … 73 75 74 76 /** Obtain PCI bus soft-state from DDF device node */ 75 #if 0 76 static pci_bus_t *pci_bus(ddf_dev_t *dnode) 77 pci_bus_t *pci_bus(ddf_dev_t *dnode) 77 78 { 78 79 return ddf_dev_data_get(dnode); 79 80 } 80 #endif81 81 82 82 /** Obtain PCI bus soft-state from function soft-state */ … … 448 448 449 449 /* TODO add subsys ids, but those exist only in header type 0 */ 450 } 451 452 /** Get first PCI function. 453 * 454 * @param bus PCI bus 455 * @return First PCI function on @a bus or @c NULL if there is none 456 */ 457 pci_fun_t *pci_fun_first(pci_bus_t *bus) 458 { 459 link_t *link; 460 461 link = list_first(&bus->funs); 462 if (link == NULL) 463 return NULL; 464 465 return list_get_instance(link, pci_fun_t, lfuns); 466 } 467 468 /** Get next PCI function. 469 * 470 * @param cur Current function 471 * @return Next PCI function on the same bus or @c NULL if there is none 472 */ 473 pci_fun_t *pci_fun_next(pci_fun_t *cur) 474 { 475 link_t *link; 476 477 link = list_next(&cur->lfuns, &cur->busptr->funs); 478 if (link == NULL) 479 return NULL; 480 481 return list_get_instance(link, pci_fun_t, lfuns); 450 482 } 451 483 … … 691 723 continue; 692 724 } 725 726 list_append(&fun->lfuns, &bus->funs); 693 727 } 694 728 } … … 718 752 goto fail; 719 753 } 754 755 list_initialize(&bus->funs); 720 756 fibril_mutex_initialize(&bus->conf_mutex); 721 757 … … 802 838 } 803 839 840 ddf_fun_set_conn_handler(ctl, pci_ctl_connection); 841 804 842 /* Enumerate functions. */ 805 843 ddf_msg(LVL_DEBUG, "Enumerating the bus"); … … 816 854 } 817 855 856 rc = ddf_fun_add_to_category(ctl, "pci"); 857 if (rc != EOK) { 858 ddf_msg(LVL_ERROR, "Failed adding control function to category " 859 "'pci'."); 860 goto fail; 861 } 862 818 863 hw_res_clean_resource_list(&hw_resources); 819 864 -
uspace/drv/bus/pci/pciintel/pci.h
rb4a4ad94 rb9f1585 37 37 #define PCI_H_ 38 38 39 #include <adt/list.h> 40 #include <ddi.h> 39 41 #include <ddf/driver.h> 40 #include "pci_regs.h"42 #include <fibril_synch.h> 41 43 42 44 #define PCI_MAX_HW_RES 10 … … 50 52 pio_window_t pio_win; 51 53 fibril_mutex_t conf_mutex; 54 /** List of functions (of pci_fun_t) */ 55 list_t funs; 52 56 } pci_bus_t; 53 57 … … 55 59 pci_bus_t *busptr; 56 60 ddf_fun_t *fnode; 61 /** Link to @c busptr->funs */ 62 link_t lfuns; 57 63 58 64 int bus; … … 71 77 } pci_fun_t; 72 78 79 extern pci_bus_t *pci_bus(ddf_dev_t *); 80 73 81 extern void pci_fun_create_match_ids(pci_fun_t *); 82 extern pci_fun_t *pci_fun_first(pci_bus_t *); 83 extern pci_fun_t *pci_fun_next(pci_fun_t *); 74 84 75 85 extern uint8_t pci_conf_read_8(pci_fun_t *, int); -
uspace/lib/c/Makefile
rb4a4ad94 rb9f1585 165 165 generic/assert.c \ 166 166 generic/bsearch.c \ 167 generic/pci.c \ 167 168 generic/pio_trace.c \ 168 169 generic/qsort.c \ -
uspace/lib/c/generic/io/chargrid.c
rb4a4ad94 rb9f1585 263 263 void chargrid_set_cursor(chargrid_t *scrbuf, sysarg_t col, sysarg_t row) 264 264 { 265 if (col >= scrbuf->cols || row >= scrbuf->rows) 266 return; 267 265 268 scrbuf->col = col; 266 269 scrbuf->row = row; -
uspace/lib/clui/tinput.c
rb4a4ad94 rb9f1585 56 56 } seek_dir_t; 57 57 58 static void tinput_update_origin(tinput_t *); 58 59 static void tinput_init(tinput_t *); 59 60 static void tinput_insert_string(tinput_t *, const char *); … … 71 72 static void tinput_console_set_lpos(tinput_t *ti, unsigned lpos) 72 73 { 73 console_set_pos(ti->console, LIN_TO_COL(ti, lpos), 74 LIN_TO_ROW(ti, lpos)); 74 unsigned col = LIN_TO_COL(ti, lpos); 75 unsigned row = LIN_TO_ROW(ti, lpos); 76 77 assert(col < ti->con_cols); 78 assert(row < ti->con_rows); 79 console_set_pos(ti->console, col, row); 75 80 } 76 81 … … 163 168 static void tinput_position_caret(tinput_t *ti) 164 169 { 170 tinput_update_origin(ti); 165 171 tinput_console_set_lpos(ti, ti->text_coord + ti->pos); 166 172 } … … 232 238 233 239 tinput_display_tail(ti, ti->pos - 1, 0); 234 tinput_update_origin(ti);235 240 tinput_position_caret(ti); 236 241 } … … 276 281 277 282 tinput_display_tail(ti, ti->pos - ilen, 0); 278 tinput_update_origin(ti);279 283 tinput_position_caret(ti); 280 284 } -
uspace/srv/locsrv/locsrv.c
rb4a4ad94 rb9f1585 1390 1390 categ_dir_add_cat(&cdir, cat); 1391 1391 1392 cat = category_new("pci"); 1393 categ_dir_add_cat(&cdir, cat); 1394 1392 1395 return true; 1393 1396 } -
uspace/srv/vfs/vfs_ops.c
rb4a4ad94 rb9f1585 892 892 rc = vfs_fd_alloc(&file, false, out_fd); 893 893 if (rc != EOK) { 894 fibril_rwlock_read_unlock(&namespace_rwlock); 894 895 vfs_node_put(node); 895 896 vfs_file_put(parent);
Note:
See TracChangeset
for help on using the changeset viewer.