Changeset f300523 in mainline
- Timestamp:
- 2017-11-29T18:43:10Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 39026d7c
- Parents:
- 48b77ed
- Location:
- uspace
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/modules/sleep/sleep.c
r48b77ed rf300523 27 27 */ 28 28 29 #include <async.h> 29 30 #include <errno.h> 30 31 #include <stdio.h> 31 32 #include <stdlib.h> 32 #include <thread.h>33 33 #include "config.h" 34 34 #include "util.h" … … 131 131 } 132 132 133 (void) thread_usleep(duration);133 async_usleep(duration); 134 134 135 135 return CMD_SUCCESS; -
uspace/app/tester/hw/serial/serial1.c
r48b77ed rf300523 45 45 #include <stddef.h> 46 46 #include <str.h> 47 #include <thread.h>48 47 #include "../../tester.h" 49 48 … … 162 161 TPRINTF("Read %zd bytes\n", nread); 163 162 164 if (nread == 0) 165 thread_usleep(DEFAULT_SLEEP); 166 else { 167 buf[nread] = 0; 168 169 /* 170 * Write data back to the device to test the opposite 171 * direction of data transfer. 172 */ 173 rc = chardev_write(chardev, buf, nread, &nwritten); 174 if (rc != EOK) { 175 (void) serial_set_comm_props(serial, old_baud, 176 old_par, old_word_size, old_stop); 177 178 free(buf); 179 chardev_close(chardev); 180 serial_close(serial); 181 async_hangup(sess); 182 return "Failed writing to serial device"; 183 } 184 185 if (nwritten != nread) { 186 (void) serial_set_comm_props(serial, old_baud, 187 old_par, old_word_size, old_stop); 188 189 free(buf); 190 chardev_close(chardev); 191 serial_close(serial); 192 async_hangup(sess); 193 return "Written less data than read from serial device"; 194 } 195 196 TPRINTF("Written %zd bytes\n", nwritten); 197 } 163 buf[nread] = 0; 164 165 /* 166 * Write data back to the device to test the opposite 167 * direction of data transfer. 168 */ 169 rc = chardev_write(chardev, buf, nread, &nwritten); 170 if (rc != EOK) { 171 (void) serial_set_comm_props(serial, old_baud, 172 old_par, old_word_size, old_stop); 173 174 free(buf); 175 chardev_close(chardev); 176 serial_close(serial); 177 async_hangup(sess); 178 return "Failed writing to serial device"; 179 } 180 181 if (nwritten != nread) { 182 (void) serial_set_comm_props(serial, old_baud, 183 old_par, old_word_size, old_stop); 184 185 free(buf); 186 chardev_close(chardev); 187 serial_close(serial); 188 async_hangup(sess); 189 return "Written less data than read from serial device"; 190 } 191 192 TPRINTF("Written %zd bytes\n", nwritten); 198 193 199 194 total += nread; -
uspace/drv/nic/e1k/e1k.c
r48b77ed rf300523 33 33 */ 34 34 35 #include <async.h> 35 36 #include <assert.h> 36 37 #include <stdio.h> … … 38 39 #include <adt/list.h> 39 40 #include <align.h> 40 #include <thread.h>41 41 #include <byteorder.h> 42 42 #include <as.h> … … 372 372 fibril_mutex_unlock(&e1000->ctrl_lock); 373 373 374 thread_usleep(10);374 async_usleep(10); 375 375 376 376 fibril_mutex_lock(&e1000->ctrl_lock); … … 1724 1724 1725 1725 /* Wait for the reset */ 1726 thread_usleep(20);1726 async_usleep(20); 1727 1727 1728 1728 /* check if RST_BIT cleared */ … … 1812 1812 * transfers to descriptors. 1813 1813 */ 1814 thread_usleep(100);1814 async_usleep(100); 1815 1815 1816 1816 return EOK; … … 2238 2238 uint32_t eerd = E1000_REG_READ(e1000, E1000_EERD); 2239 2239 while ((eerd & e1000->info.eerd_done) == 0) { 2240 thread_usleep(1);2240 async_usleep(1); 2241 2241 eerd = E1000_REG_READ(e1000, E1000_EERD); 2242 2242 } -
uspace/drv/nic/ne2k/dp8390.c
r48b77ed rf300523 55 55 56 56 #include <assert.h> 57 #include <async.h> 57 58 #include <byteorder.h> 58 59 #include <errno.h> 59 60 #include <stdio.h> 60 61 #include <ddi.h> 61 #include <thread.h>62 62 #include "dp8390.h" 63 63 … … 172 172 /* Reset the ethernet card */ 173 173 uint8_t val = pio_read_8(ne2k->port + NE2K_RESET); 174 thread_usleep(2000);174 async_usleep(2000); 175 175 pio_write_8(ne2k->port + NE2K_RESET, val); 176 thread_usleep(2000);176 async_usleep(2000); 177 177 178 178 /* Reset the DP8390 */ -
uspace/drv/nic/rtl8139/driver.c
r48b77ed rf300523 28 28 29 29 #include <assert.h> 30 #include <async.h> 30 31 #include <errno.h> 31 32 #include <align.h> 32 #include <thread.h>33 33 #include <byteorder.h> 34 34 #include <libarch/barrier.h> … … 435 435 memory_barrier(); 436 436 while(pio_read_8(io_base + CR) & CR_RST) { 437 thread_usleep(1);437 async_usleep(1); 438 438 read_barrier(); 439 439 } -
uspace/drv/nic/rtl8169/driver.c
r48b77ed rf300523 28 28 29 29 #include <assert.h> 30 #include <async.h> 30 31 #include <errno.h> 31 32 #include <align.h> … … 34 35 35 36 #include <as.h> 36 #include <thread.h>37 37 #include <ddf/log.h> 38 38 #include <ddf/interrupt.h> … … 763 763 memory_barrier(); 764 764 while (pio_read_8(rtl8169->regs + CR) & CR_RST) { 765 thread_usleep(1);765 async_usleep(1); 766 766 read_barrier(); 767 767 } … … 1176 1176 do { 1177 1177 phyar = pio_read_32(rtl8169->regs + PHYAR); 1178 thread_usleep(20);1178 async_usleep(20); 1179 1179 } while ((phyar & PHYAR_RW_WRITE) == 0); 1180 1180 … … 1194 1194 do { 1195 1195 phyar = pio_read_32(rtl8169->regs + PHYAR); 1196 thread_usleep(20);1196 async_usleep(20); 1197 1197 } while ((phyar & PHYAR_RW_WRITE) != 0); 1198 1198 1199 thread_usleep(20);1199 async_usleep(20); 1200 1200 } 1201 1201 -
uspace/srv/hid/isdv4_tablet/isdv4.c
r48b77ed rf300523 27 27 */ 28 28 29 #include <async.h> 29 30 #include <errno.h> 30 31 #include <io/chardev.h> … … 33 34 #include <stdint.h> 34 35 #include <stdlib.h> 35 #include <thread.h>36 36 37 37 #include "isdv4.h" … … 401 401 return EIO; 402 402 403 thread_usleep(250000); /* 250 ms */403 async_usleep(250000); /* 250 ms */ 404 404 405 405 // FIXME: Read all possible garbage before sending commands
Note:
See TracChangeset
for help on using the changeset viewer.