Changes in / [85d2fe2e:ec351c3] in mainline
- Files:
-
- 3 added
- 3 deleted
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/Makefile.build
r85d2fe2e rec351c3 34 34 OPTIMIZATION = 3 35 35 36 DEFS = -DRELEASE=$(RELEASE) "-D COPYRIGHT=$(COPYRIGHT)" "-DNAME=$(NAME)" -D__$(BITS)_BITS__ -D__$(ENDIANESS)__36 DEFS = -DRELEASE=$(RELEASE) "-DNAME=$(NAME)" -D__$(BITS)_BITS__ -D__$(ENDIANESS)__ 37 37 38 38 GCC_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \ -
boot/arch/ia64/src/main.c
r85d2fe2e rec351c3 189 189 printf("\nInflating components ... "); 190 190 191 /*192 * We will use the next available address for a copy of each component to193 * make sure that inflate() works with disjunctive memory regions.194 */195 top = ALIGN_UP(top, PAGE_SIZE);196 197 191 for (i = cnt; i > 0; i--) { 198 192 printf("%s ", components[i - 1].name); 199 193 200 /* 201 * Copy the component to a location which is guaranteed not to 202 * overlap with the destination for inflate(). 203 */ 204 memmove((void *) top, components[i - 1].start, components[i - 1].size); 205 206 int err = inflate((void *) top, components[i - 1].size, 194 int err = inflate(components[i - 1].start, components[i - 1].size, 207 195 dest[i - 1], components[i - 1].inflated); 208 196 -
boot/generic/include/memstr.h
r85d2fe2e rec351c3 36 36 37 37 extern void *memcpy(void *, const void *, size_t); 38 extern void *memmove(void *, const void *, size_t);39 38 40 39 #endif -
boot/generic/src/memstr.c
r85d2fe2e rec351c3 51 51 } 52 52 53 /** Move memory block with possible overlapping.54 *55 * Copy cnt bytes from src address to dst address. The source56 * and destination memory areas may overlap.57 *58 * @param dst Destination address to copy to.59 * @param src Source address to copy from.60 * @param cnt Number of bytes to copy.61 *62 * @return Destination address.63 *64 */65 void *memmove(void *dst, const void *src, size_t cnt)66 {67 /* Nothing to do? */68 if (src == dst)69 return dst;70 71 /* Non-overlapping? */72 if ((dst >= src + cnt) || (src >= dst + cnt))73 return memcpy(dst, src, cnt);74 75 uint8_t *dp;76 const uint8_t *sp;77 78 /* Which direction? */79 if (src > dst) {80 /* Forwards. */81 dp = dst;82 sp = src;83 84 while (cnt-- != 0)85 *dp++ = *sp++;86 } else {87 /* Backwards. */88 dp = dst + (cnt - 1);89 sp = src + (cnt - 1);90 91 while (cnt-- != 0)92 *dp-- = *sp--;93 }94 95 return dst;96 }97 98 53 /** @} 99 54 */ -
boot/generic/src/version.c
r85d2fe2e rec351c3 32 32 33 33 static const char *project = "HelenOS bootloader"; 34 static const char *copyright = STRING(COPYRIGHT);34 static const char *copyright = "Copyright (c) 2001-2011 HelenOS project"; 35 35 static const char *release = STRING(RELEASE); 36 36 static const char *name = STRING(NAME); -
kernel/Makefile
r85d2fe2e rec351c3 90 90 endif 91 91 92 DEFS = -DKERNEL -DRELEASE=$(RELEASE) "-D COPYRIGHT=$(COPYRIGHT)" "-DNAME=$(NAME)" -D__$(BITS)_BITS__ -D__$(ENDIANESS)__92 DEFS = -DKERNEL -DRELEASE=$(RELEASE) "-DNAME=$(NAME)" -D__$(BITS)_BITS__ -D__$(ENDIANESS)__ 93 93 94 94 GCC_CFLAGS = -I$(INCLUDES) -O$(OPTIMIZATION) -imacros $(CONFIG_HEADER) \ -
kernel/generic/src/main/version.c
r85d2fe2e rec351c3 38 38 39 39 static const char *project = "SPARTAN kernel"; 40 static const char *copyright = STRING(COPYRIGHT);40 static const char *copyright = "Copyright (c) 2001-2011 HelenOS project"; 41 41 static const char *release = STRING(RELEASE); 42 42 static const char *name = STRING(NAME); -
uspace/app/getterm/Makefile
r85d2fe2e rec351c3 29 29 30 30 USPACE_PREFIX = ../.. 31 DEFS = -DRELEASE=$(RELEASE) "-D COPYRIGHT=$(COPYRIGHT)" "-DNAME=$(NAME)"31 DEFS = -DRELEASE=$(RELEASE) "-DNAME=$(NAME)" 32 32 BINARY = getterm 33 33 -
uspace/app/getterm/version.c
r85d2fe2e rec351c3 40 40 #include "version.h" 41 41 42 static const char *copyright = STRING(COPYRIGHT);43 42 static const char *release = STRING(RELEASE); 44 43 static const char *name = STRING(NAME); … … 62 61 printf("HelenOS release %s (%s)%s%s\n", release, name, revision, timestamp); 63 62 printf("Running on %s (%s)\n", arch, term); 64 printf(" %s\n\n", copyright);63 printf("Copyright (c) 2001-2011 HelenOS project\n\n"); 65 64 } 66 65 -
uspace/app/sportdmp/sportdmp.c
r85d2fe2e rec351c3 27 27 */ 28 28 29 #include <errno.h> 30 #include <stdio.h> 31 #include <devman.h> 32 #include <ipc/devman.h> 29 33 #include <device/char_dev.h> 30 #include <errno.h>31 34 #include <ipc/serial_ctl.h> 32 #include <loc.h>33 #include <stdio.h>34 35 35 36 #define BUF_SIZE 1 36 37 37 static void syntax_print(void) 38 { 39 fprintf(stderr, "Usage: sportdmp <baud> <device_service>\n"); 38 static void syntax_print() { 39 fprintf(stderr, "Usage: sportdmp <baud> <device_path>\n"); 40 40 } 41 41 42 42 int main(int argc, char **argv) 43 43 { 44 const char* svc_path = "devices/\\hw\\pci0\\00:01.0\\com1\\a";44 const char* devpath = "/hw/pci0/00:01.0/com1/a"; 45 45 sysarg_t baud = 9600; 46 46 … … 56 56 57 57 if (argc > 2) { 58 svc_path = argv[2];58 devpath = argv[2]; 59 59 } 60 60 … … 64 64 } 65 65 66 service_id_t svc_id;67 int rc = loc_service_get_id(svc_path, &svc_id, IPC_FLAG_BLOCKING);66 devman_handle_t device; 67 int rc = devman_fun_get_handle(devpath, &device, IPC_FLAG_BLOCKING); 68 68 if (rc != EOK) { 69 fprintf(stderr, "Cannot find device service %s\n", svc_path);69 fprintf(stderr, "Cannot open device %s\n", devpath); 70 70 return 1; 71 71 } 72 72 73 async_sess_t *sess = loc_service_connect(EXCHANGE_SERIALIZE, svc_id,73 async_sess_t *sess = devman_device_connect(EXCHANGE_SERIALIZE, device, 74 74 IPC_FLAG_BLOCKING); 75 75 if (!sess) { 76 fprintf(stderr, " Failed connecting to service %s\n", svc_path);76 fprintf(stderr, "Cannot connect device\n"); 77 77 } 78 78 … … 83 83 84 84 if (rc != EOK) { 85 fprintf(stderr, " Failed settingserial properties\n");85 fprintf(stderr, "Cannot set serial properties\n"); 86 86 return 2; 87 87 } … … 89 89 uint8_t *buf = (uint8_t *) malloc(BUF_SIZE); 90 90 if (buf == NULL) { 91 fprintf(stderr, " Failed allocatingbuffer\n");91 fprintf(stderr, "Cannot allocate buffer\n"); 92 92 return 3; 93 93 } -
uspace/app/tester/hw/serial/serial1.c
r85d2fe2e rec351c3 42 42 #include <async.h> 43 43 #include <ipc/services.h> 44 #include <loc.h> 44 #include <ipc/devman.h> 45 #include <devman.h> 45 46 #include <device/char_dev.h> 46 47 #include <str.h> … … 70 71 } 71 72 72 service_id_t svc_id;73 int res = loc_service_get_id("devices/\\hw\\pci0\\00:01.0\\com1\\a",74 &svc_id,IPC_FLAG_BLOCKING);73 devman_handle_t handle; 74 int res = devman_fun_get_handle("/hw/pci0/00:01.0/com1/a", &handle, 75 IPC_FLAG_BLOCKING); 75 76 if (res != EOK) 76 return " Failed getting serial port service ID";77 78 async_sess_t *sess = loc_service_connect(EXCHANGE_SERIALIZE, svc_id,77 return "Could not get serial device handle"; 78 79 async_sess_t *sess = devman_device_connect(EXCHANGE_SERIALIZE, handle, 79 80 IPC_FLAG_BLOCKING); 80 81 if (!sess) 81 return " Failed connectingto serial device";82 return "Unable to connect to serial device"; 82 83 83 84 char *buf = (char *) malloc(cnt + 1); 84 85 if (buf == NULL) { 85 86 async_hangup(sess); 86 return "Failed allocatinginput buffer";87 return "Failed to allocate input buffer"; 87 88 } 88 89 … … 111 112 free(buf); 112 113 async_hangup(sess); 113 return "Failed settingserial communication parameters";114 } 115 116 TPRINTF("Trying reading%zu characters from serial device "117 "( svc_id=%" PRIun ")\n", cnt, svc_id);114 return "Failed to set serial communication parameters"; 115 } 116 117 TPRINTF("Trying to read %zu characters from serial device " 118 "(handle=%" PRIun ")\n", cnt, handle); 118 119 119 120 size_t total = 0; … … 129 130 free(buf); 130 131 async_hangup(sess); 131 return "Failed read ingfrom serial device";132 return "Failed read from serial device"; 132 133 } 133 134 … … 164 165 free(buf); 165 166 async_hangup(sess); 166 return "Failed writ ingto serial device";167 return "Failed write to serial device"; 167 168 } 168 169 -
uspace/app/websrv/websrv.c
r85d2fe2e rec351c3 200 200 { 201 201 if (str_cmp(uri, "/") == 0) 202 uri = "/index.htm l";202 uri = "/index.htm"; 203 203 204 204 char *fname; -
uspace/drv/bus/isa/isa.c
r85d2fe2e rec351c3 66 66 #include <ops/hw_res.h> 67 67 68 #include <devman.h> 69 #include <ipc/devman.h> 68 70 #include <device/hw_res.h> 69 71 -
uspace/drv/bus/usb/uhcirh/port.c
r85d2fe2e rec351c3 37 37 #include <str_error.h> 38 38 #include <async.h> 39 #include <devman.h> 39 40 40 41 #include <usb/usb.h> /* usb_address_t */ -
uspace/drv/bus/usb/usbhub/port.c
r85d2fe2e rec351c3 35 35 36 36 #include <bool.h> 37 #include <devman.h> 37 38 #include <errno.h> 38 39 #include <str_error.h> -
uspace/drv/char/ns8250/ns8250.c
r85d2fe2e rec351c3 74 74 #define DLAB_MASK (1 << 7) 75 75 76 /** Interrupt Enable Register definition. */77 #define NS8250_IER_RXREADY (1 << 0)78 #define NS8250_IER_THRE (1 << 1)79 #define NS8250_IER_RXSTATUS (1 << 2)80 #define NS8250_IER_MODEM_STATUS (1 << 3)81 82 /** Interrupt ID Register definition. */83 #define NS8250_IID_ACTIVE (1 << 0)84 85 /** FIFO Control Register definition. */86 #define NS8250_FCR_FIFOENABLE (1 << 0)87 #define NS8250_FCR_RXFIFORESET (1 << 1)88 #define NS8250_FCR_TXFIFORESET (1 << 2)89 #define NS8250_FCR_DMAMODE (1 << 3)90 #define NS8250_FCR_RXTRIGGERLOW (1 << 6)91 #define NS8250_FCR_RXTRIGGERHI (1 << 7)92 93 /** Line Control Register definition. */94 #define NS8250_LCR_STOPBITS (1 << 2)95 #define NS8250_LCR_PARITY (1 << 3)96 #define NS8250_LCR_SENDBREAK (1 << 6)97 #define NS8250_LCR_DLAB (1 << 7)98 99 /** Modem Control Register definition. */100 #define NS8250_MCR_DTR (1 << 0)101 #define NS8250_MCR_RTS (1 << 1)102 #define NS8250_MCR_OUT1 (1 << 2)103 #define NS8250_MCR_OUT2 (1 << 3)104 #define NS8250_MCR_LOOPBACK (1 << 4)105 #define NS8250_MCR_ALL (0x1f)106 107 /** Line Status Register definition. */108 #define NS8250_LSR_RXREADY (1 << 0)109 #define NS8250_LSR_OE (1 << 1)110 #define NS8250_LSR_PE (1 << 2)111 #define NS8250_LSR_FE (1 << 3)112 #define NS8250_LSR_BREAK (1 << 4)113 #define NS8250_LSR_THRE (1 << 5)114 #define NS8250_LSR_TSE (1 << 6)115 116 /** Modem Status Register definition. */117 #define NS8250_MSR_DELTACTS (1 << 0)118 #define NS8250_MSR_DELTADSR (1 << 1)119 #define NS8250_MSR_RITRAILING (1 << 2)120 #define NS8250_MSR_DELTADCD (1 << 3)121 #define NS8250_MSR_CTS (1 << 4)122 #define NS8250_MSR_DSR (1 << 5)123 #define NS8250_MSR_RI (1 << 6)124 #define NS8250_MSR_DCD (1 << 7)125 #define NS8250_MSR_SIGNALS (NS8250_MSR_CTS | NS8250_MSR_DSR \126 | NS8250_MSR_RI | NS8250_MSR_DCD)127 128 76 /** Obtain soft-state structure from function node */ 129 77 #define NS8250(fnode) ((ns8250_t *) ((fnode)->dev->driver_data)) … … 148 96 } stop_bit_t; 149 97 150 /** 8250 UART registers layout. */151 typedef struct {152 ioport8_t data; /**< Data register. */153 ioport8_t ier; /**< Interrupt Enable Reg. */154 ioport8_t iid; /**< Interrupt ID Reg. */155 ioport8_t lcr; /**< Line Control Reg. */156 ioport8_t mcr; /**< Modem Control Reg. */157 ioport8_t lsr; /**< Line Status Reg. */158 ioport8_t msr; /**< Modem Status Reg. */159 } ns8250_regs_t;160 161 98 /** The driver data for the serial port devices. */ 162 99 typedef struct ns8250 { … … 165 102 /** DDF function node */ 166 103 ddf_fun_t *fun; 167 /** I/O registers **/168 ns8250_regs_t *regs;169 104 /** Is there any client conntected to the device? */ 170 105 bool client_connected; … … 189 124 * otherwise. 190 125 */ 191 static bool ns8250_received( ns8250_regs_t *regs)192 { 193 return (pio_read_8( ®s->lsr) & NS8250_LSR_RXREADY) != 0;126 static bool ns8250_received(ioport8_t *port) 127 { 128 return (pio_read_8(port + 5) & 1) != 0; 194 129 } 195 130 … … 199 134 * @return The data read. 200 135 */ 201 static uint8_t ns8250_read_8( ns8250_regs_t *regs)202 { 203 return pio_read_8( ®s->data);136 static uint8_t ns8250_read_8(ioport8_t *port) 137 { 138 return pio_read_8(port); 204 139 } 205 140 … … 208 143 * @param port The base address of the serial port device's ports. 209 144 */ 210 static bool is_transmit_empty( ns8250_regs_t *regs)211 { 212 return (pio_read_8( ®s->lsr) & NS8250_LSR_THRE) != 0;145 static bool is_transmit_empty(ioport8_t *port) 146 { 147 return (pio_read_8(port + 5) & 0x20) != 0; 213 148 } 214 149 … … 218 153 * @param c The character to be written to the serial port device. 219 154 */ 220 static void ns8250_write_8( ns8250_regs_t *regs, uint8_t c)221 { 222 while (!is_transmit_empty( regs))155 static void ns8250_write_8(ioport8_t *port, uint8_t c) 156 { 157 while (!is_transmit_empty(port)) 223 158 ; 224 159 225 pio_write_8( ®s->data, c);160 pio_write_8(port, c); 226 161 } 227 162 … … 258 193 { 259 194 fibril_mutex_lock(&ns->mutex); 260 ns8250_write_8(ns-> regs, c);195 ns8250_write_8(ns->port, c); 261 196 fibril_mutex_unlock(&ns->mutex); 262 197 } … … 277 212 ns8250_putchar(ns, (uint8_t) buf[idx]); 278 213 279 return count;214 return 0; 280 215 } 281 216 … … 331 266 return false; 332 267 } 333 334 ns->regs = (ns8250_regs_t *)ns->port;335 268 336 269 return true; … … 346 279 ddf_msg(LVL_DEBUG, "ns8250_dev_probe %s", ns->dev->name); 347 280 281 ioport8_t *port_addr = ns->port; 348 282 bool res = true; 349 283 uint8_t olddata; 350 284 351 olddata = pio_read_8( &ns->regs->mcr);352 353 pio_write_8( &ns->regs->mcr, NS8250_MCR_LOOPBACK);354 if (pio_read_8( &ns->regs->msr) & NS8250_MSR_SIGNALS)285 olddata = pio_read_8(port_addr + 4); 286 287 pio_write_8(port_addr + 4, 0x10); 288 if (pio_read_8(port_addr + 6) & 0xf0) 355 289 res = false; 356 290 357 pio_write_8(&ns->regs->mcr, NS8250_MCR_ALL); 358 if ((pio_read_8(&ns->regs->msr) & NS8250_MSR_SIGNALS) 359 != NS8250_MSR_SIGNALS) 291 pio_write_8(port_addr + 4, 0x1f); 292 if ((pio_read_8(port_addr + 6) & 0xf0) != 0xf0) 360 293 res = false; 361 294 362 pio_write_8( &ns->regs->mcr, olddata);295 pio_write_8(port_addr + 4, olddata); 363 296 364 297 if (!res) { … … 457 390 * @param port The base address of the serial port device's ports. 458 391 */ 459 static inline void ns8250_port_interrupts_enable(ns8250_regs_t *regs) 460 { 461 /* Interrupt when data received. */ 462 pio_write_8(®s->ier, NS8250_IER_RXREADY); 463 pio_write_8(®s->mcr, NS8250_MCR_DTR | NS8250_MCR_RTS 464 | NS8250_MCR_OUT2); 392 static inline void ns8250_port_interrupts_enable(ioport8_t *port) 393 { 394 pio_write_8(port + 1, 0x1); /* Interrupt when data received. */ 395 pio_write_8(port + 4, 0xB); 465 396 } 466 397 … … 469 400 * @param port The base address of the serial port device's ports 470 401 */ 471 static inline void ns8250_port_interrupts_disable( ns8250_regs_t *regs)472 { 473 pio_write_8( ®s->ier, 0x0); /* Disable all interrupts. */402 static inline void ns8250_port_interrupts_disable(ioport8_t *port) 403 { 404 pio_write_8(port + 1, 0x0); /* Disable all interrupts. */ 474 405 } 475 406 … … 500 431 501 432 /* Enable interrupt on the serial port. */ 502 ns8250_port_interrupts_enable(ns-> regs);433 ns8250_port_interrupts_enable(ns->port); 503 434 504 435 return EOK; … … 512 443 * @param port The base address of the serial port device's ports. 513 444 */ 514 static inline void enable_dlab( ns8250_regs_t *regs)515 { 516 uint8_t val = pio_read_8( ®s->lcr);517 pio_write_8( ®s->lcr, val | NS8250_LCR_DLAB);445 static inline void enable_dlab(ioport8_t *port) 446 { 447 uint8_t val = pio_read_8(port + 3); 448 pio_write_8(port + 3, val | DLAB_MASK); 518 449 } 519 450 … … 522 453 * @param port The base address of the serial port device's ports. 523 454 */ 524 static inline void clear_dlab( ns8250_regs_t *regs)525 { 526 uint8_t val = pio_read_8( ®s->lcr);527 pio_write_8( ®s->lcr, val & (~NS8250_LCR_DLAB));455 static inline void clear_dlab(ioport8_t *port) 456 { 457 uint8_t val = pio_read_8(port + 3); 458 pio_write_8(port + 3, val & (~DLAB_MASK)); 528 459 } 529 460 … … 535 466 * if the specified baud_rate is not valid). 536 467 */ 537 static int ns8250_port_set_baud_rate( ns8250_regs_t *regs, unsigned int baud_rate)468 static int ns8250_port_set_baud_rate(ioport8_t *port, unsigned int baud_rate) 538 469 { 539 470 uint16_t divisor; … … 551 482 552 483 /* Enable DLAB to be able to access baud rate divisor. */ 553 enable_dlab( regs);484 enable_dlab(port); 554 485 555 486 /* Set divisor low byte. */ 556 pio_write_8( ®s->data, div_low);487 pio_write_8(port + 0, div_low); 557 488 /* Set divisor high byte. */ 558 pio_write_8( ®s->ier, div_high);559 560 clear_dlab( regs);489 pio_write_8(port + 1, div_high); 490 491 clear_dlab(port); 561 492 562 493 return EOK; … … 568 499 * @param baud_rate The ouput parameter to which the baud rate is stored. 569 500 */ 570 static unsigned int ns8250_port_get_baud_rate( ns8250_regs_t *regs)501 static unsigned int ns8250_port_get_baud_rate(ioport8_t *port) 571 502 { 572 503 uint16_t divisor; … … 574 505 575 506 /* Enable DLAB to be able to access baud rate divisor. */ 576 enable_dlab( regs);507 enable_dlab(port); 577 508 578 509 /* Get divisor low byte. */ 579 div_low = pio_read_8( ®s->data);510 div_low = pio_read_8(port + 0); 580 511 /* Get divisor high byte. */ 581 div_high = pio_read_8( ®s->ier);582 583 clear_dlab( regs);512 div_high = pio_read_8(port + 1); 513 514 clear_dlab(port); 584 515 585 516 divisor = (div_high << 8) | div_low; … … 594 525 * @param stop_bits The number of stop bits used (one or two). 595 526 */ 596 static void ns8250_port_get_com_props( ns8250_regs_t *regs, unsigned int *parity,527 static void ns8250_port_get_com_props(ioport8_t *port, unsigned int *parity, 597 528 unsigned int *word_length, unsigned int *stop_bits) 598 529 { 599 530 uint8_t val; 600 531 601 val = pio_read_8( ®s->lcr);602 *parity = ((val >> NS8250_LCR_PARITY) & 7);532 val = pio_read_8(port + 3); 533 *parity = ((val >> 3) & 7); 603 534 604 535 switch (val & 3) { … … 617 548 } 618 549 619 if ((val >> NS8250_LCR_STOPBITS) & 1)550 if ((val >> 2) & 1) 620 551 *stop_bits = 2; 621 552 else … … 631 562 * is invalid. 632 563 */ 633 static int ns8250_port_set_com_props( ns8250_regs_t *regs, unsigned int parity,564 static int ns8250_port_set_com_props(ioport8_t *port, unsigned int parity, 634 565 unsigned int word_length, unsigned int stop_bits) 635 566 { … … 655 586 switch (stop_bits) { 656 587 case 1: 657 val |= ONE_STOP_BIT << NS8250_LCR_STOPBITS;588 val |= ONE_STOP_BIT << 2; 658 589 break; 659 590 case 2: 660 val |= TWO_STOP_BITS << NS8250_LCR_STOPBITS;591 val |= TWO_STOP_BITS << 2; 661 592 break; 662 593 default: … … 670 601 case SERIAL_MARK_PARITY: 671 602 case SERIAL_SPACE_PARITY: 672 val |= parity << NS8250_LCR_PARITY;603 val |= parity << 3; 673 604 break; 674 605 default: … … 676 607 } 677 608 678 pio_write_8( ®s->lcr, val);609 pio_write_8(port + 3, val); 679 610 680 611 return EOK; … … 689 620 static void ns8250_initialize_port(ns8250_t *ns) 690 621 { 622 ioport8_t *port = ns->port; 623 691 624 /* Disable interrupts. */ 692 ns8250_port_interrupts_disable( ns->regs);625 ns8250_port_interrupts_disable(port); 693 626 /* Set baud rate. */ 694 ns8250_port_set_baud_rate( ns->regs, 38400);627 ns8250_port_set_baud_rate(port, 38400); 695 628 /* 8 bits, no parity, two stop bits. */ 696 ns8250_port_set_com_props( ns->regs, SERIAL_NO_PARITY, 8, 2);629 ns8250_port_set_com_props(port, SERIAL_NO_PARITY, 8, 2); 697 630 /* Enable FIFO, clear them, with 14-byte threshold. */ 698 pio_write_8(&ns->regs->iid, NS8250_FCR_FIFOENABLE 699 | NS8250_FCR_RXFIFORESET | NS8250_FCR_TXFIFORESET 700 | NS8250_FCR_RXTRIGGERLOW | NS8250_FCR_RXTRIGGERHI); 631 pio_write_8(port + 2, 0xC7); 701 632 /* 702 633 * RTS/DSR set (Request to Send and Data Terminal Ready lines enabled), 703 634 * Aux Output2 set - needed for interrupts. 704 635 */ 705 pio_write_8(&ns->regs->mcr, NS8250_MCR_DTR | NS8250_MCR_RTS 706 | NS8250_MCR_OUT2); 636 pio_write_8(port + 4, 0x0B); 707 637 } 708 638 … … 714 644 { 715 645 /* Disable FIFO */ 716 pio_write_8( &ns->regs->iid, 0x00);646 pio_write_8(ns->port + 2, 0x00); 717 647 /* Disable DTR, RTS, OUT1, OUT2 (int. enable) */ 718 pio_write_8( &ns->regs->mcr, 0x00);648 pio_write_8(ns->port + 4, 0x00); 719 649 /* Disable all interrupts from the port */ 720 ns8250_port_interrupts_disable(ns-> regs);650 ns8250_port_interrupts_disable(ns->port); 721 651 } 722 652 … … 728 658 static void ns8250_read_from_device(ns8250_t *ns) 729 659 { 730 ns8250_regs_t *regs = ns->regs;660 ioport8_t *port = ns->port; 731 661 bool cont = true; 732 662 … … 734 664 fibril_mutex_lock(&ns->mutex); 735 665 736 cont = ns8250_received( regs);666 cont = ns8250_received(port); 737 667 if (cont) { 738 uint8_t val = ns8250_read_8( regs);668 uint8_t val = ns8250_read_8(port); 739 669 740 670 if (ns->client_connected) { … … 966 896 { 967 897 ns8250_t *data = (ns8250_t *) dev->driver_data; 968 ns8250_regs_t *regs = data->regs;898 ioport8_t *port = data->port; 969 899 970 900 fibril_mutex_lock(&data->mutex); 971 ns8250_port_interrupts_disable( regs);972 *baud_rate = ns8250_port_get_baud_rate( regs);973 ns8250_port_get_com_props( regs, parity, word_length, stop_bits);974 ns8250_port_interrupts_enable( regs);901 ns8250_port_interrupts_disable(port); 902 *baud_rate = ns8250_port_get_baud_rate(port); 903 ns8250_port_get_com_props(port, parity, word_length, stop_bits); 904 ns8250_port_interrupts_enable(port); 975 905 fibril_mutex_unlock(&data->mutex); 976 906 … … 997 927 998 928 ns8250_t *data = (ns8250_t *) dev->driver_data; 999 ns8250_regs_t *regs = data->regs;929 ioport8_t *port = data->port; 1000 930 int ret; 1001 931 1002 932 fibril_mutex_lock(&data->mutex); 1003 ns8250_port_interrupts_disable( regs);1004 ret = ns8250_port_set_baud_rate( regs, baud_rate);933 ns8250_port_interrupts_disable(port); 934 ret = ns8250_port_set_baud_rate(port, baud_rate); 1005 935 if (ret == EOK) 1006 ret = ns8250_port_set_com_props( regs, parity, word_length, stop_bits);1007 ns8250_port_interrupts_enable( regs);936 ret = ns8250_port_set_com_props(port, parity, word_length, stop_bits); 937 ns8250_port_interrupts_enable(port); 1008 938 fibril_mutex_unlock(&data->mutex); 1009 939 -
uspace/drv/char/ps2mouse/main.c
r85d2fe2e rec351c3 35 35 #include <libarch/inttypes.h> 36 36 #include <ddf/driver.h> 37 #include <devman.h> 37 38 #include <device/hw_res_parsed.h> 38 39 #include <errno.h> -
uspace/drv/char/xtkbd/main.c
r85d2fe2e rec351c3 35 35 #include <libarch/inttypes.h> 36 36 #include <ddf/driver.h> 37 #include <devman.h> 37 38 #include <device/hw_res_parsed.h> 38 39 #include <errno.h> -
uspace/drv/infrastructure/root/root.c
r85d2fe2e rec351c3 53 53 #include <ddf/driver.h> 54 54 #include <ddf/log.h> 55 #include <devman.h> 56 #include <ipc/devman.h> 55 57 56 58 #define NAME "root" -
uspace/drv/infrastructure/rootpc/rootpc.c
r85d2fe2e rec351c3 48 48 #include <ddf/driver.h> 49 49 #include <ddf/log.h> 50 #include <devman.h> 51 #include <ipc/devman.h> 50 52 #include <ipc/dev_iface.h> 51 53 #include <ops/hw_res.h> -
uspace/drv/nic/e1k/e1k.c
r85d2fe2e rec351c3 46 46 #include <ddf/log.h> 47 47 #include <ddf/interrupt.h> 48 #include <devman.h> 48 49 #include <device/hw_res_parsed.h> 49 50 #include <device/pci.h> -
uspace/lib/net/generic/net_remote.c
r85d2fe2e rec351c3 40 40 #include <malloc.h> 41 41 #include <async.h> 42 #include <devman.h> 42 43 #include <generic.h> 43 44 #include <net/modules.h> -
uspace/lib/usb/src/ddfiface.c
r85d2fe2e rec351c3 33 33 * Implementations of DDF interfaces functions (actual implementation). 34 34 */ 35 #include <ipc/devman.h> 35 36 #include <devman.h> 36 37 #include <async.h> -
uspace/lib/usbvirt/src/ipc_dev.c
r85d2fe2e rec351c3 38 38 #include <assert.h> 39 39 #include <async.h> 40 #include <devman.h> 40 41 #include <usbvirt/device.h> 41 42 #include <usbvirt/ipc.h> -
uspace/lib/usbvirt/src/ipc_hc.c
r85d2fe2e rec351c3 38 38 #include <assert.h> 39 39 #include <async.h> 40 #include <devman.h> 40 41 #include <usbvirt/device.h> 41 42 #include <usbvirt/ipc.h> -
version
r85d2fe2e rec351c3 46 46 47 47 NAME = Sashimi 48 COPYRIGHT = Copyright (c) 2001-2012 HelenOS project
Note:
See TracChangeset
for help on using the changeset viewer.