| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | .\" $NetBSD: dmover.9,v 1.12 2007/12/05 04:48:57 ad Exp $ | | 1 | .\" $NetBSD: dmover.9,v 1.13 2009/05/04 19:41:09 wiz Exp $ |
2 | .\" | | 2 | .\" |
3 | .\" Copyright (c) 2002 Wasabi Systems, Inc. | | 3 | .\" Copyright (c) 2002 Wasabi Systems, Inc. |
4 | .\" All rights reserved. | | 4 | .\" All rights reserved. |
5 | .\" | | 5 | .\" |
6 | .\" Written by Jason R. Thorpe for Wasabi Systems, Inc. | | 6 | .\" Written by Jason R. Thorpe for Wasabi Systems, Inc. |
7 | .\" | | 7 | .\" |
8 | .\" Redistribution and use in source and binary forms, with or without | | 8 | .\" Redistribution and use in source and binary forms, with or without |
9 | .\" modification, are permitted provided that the following conditions | | 9 | .\" modification, are permitted provided that the following conditions |
10 | .\" are met: | | 10 | .\" are met: |
11 | .\" 1. Redistributions of source code must retain the above copyright | | 11 | .\" 1. Redistributions of source code must retain the above copyright |
12 | .\" notice, this list of conditions and the following disclaimer. | | 12 | .\" notice, this list of conditions and the following disclaimer. |
13 | .\" 2. Redistributions in binary form must reproduce the above copyright | | 13 | .\" 2. Redistributions in binary form must reproduce the above copyright |
14 | .\" notice, this list of conditions and the following disclaimer in the | | 14 | .\" notice, this list of conditions and the following disclaimer in the |
| @@ -565,46 +565,46 @@ The following is an example of a client | | | @@ -565,46 +565,46 @@ The following is an example of a client |
565 | .Nm dmover | | 565 | .Nm dmover |
566 | to zero-fill a region of memory. | | 566 | to zero-fill a region of memory. |
567 | In this example, the CPU will be able to context switch to another | | 567 | In this example, the CPU will be able to context switch to another |
568 | thread and perform work while the hardware-assisted data mover clears | | 568 | thread and perform work while the hardware-assisted data mover clears |
569 | the specified block of memory. | | 569 | the specified block of memory. |
570 | .Bd -literal | | 570 | .Bd -literal |
571 | int | | 571 | int |
572 | hw_bzero(void *buf, size_t len) | | 572 | hw_bzero(void *buf, size_t len) |
573 | { | | 573 | { |
574 | struct dmover_session *dses; | | 574 | struct dmover_session *dses; |
575 | struct dmover_request *dreq; | | 575 | struct dmover_request *dreq; |
576 | int error; | | 576 | int error; |
577 | | | 577 | |
578 | error = dmover_session_create(DMOVER_FUNC_ZERO, &dses); | | 578 | error = dmover_session_create(DMOVER_FUNC_ZERO, \*[Am]dses); |
579 | if (error) | | 579 | if (error) |
580 | return (error); | | 580 | return (error); |
581 | | | 581 | |
582 | dreq = dmover_request_alloc(dses, NULL); | | 582 | dreq = dmover_request_alloc(dses, NULL); |
583 | if (dreq == NULL) { | | 583 | if (dreq == NULL) { |
584 | dmover_session_destroy(dses); | | 584 | dmover_session_destroy(dses); |
585 | return (ENOMEM); | | 585 | return (ENOMEM); |
586 | } | | 586 | } |
587 | | | 587 | |
588 | dreq->dreq_flags = DMOVER_REQ_WAIT; | | 588 | dreq-\*[Gt]dreq_flags = DMOVER_REQ_WAIT; |
589 | dreq->dreq_callback = NULL; | | 589 | dreq-\*[Gt]dreq_callback = NULL; |
590 | dreq->dreq_outbuf.dreq_outbuf_type = DMOVER_BUF_LINEAR; | | 590 | dreq-\*[Gt]dreq_outbuf.dreq_outbuf_type = DMOVER_BUF_LINEAR; |
591 | dreq->dreq_outbuf.dmbuf_linear.l_addr = buf; | | 591 | dreq-\*[Gt]dreq_outbuf.dmbuf_linear.l_addr = buf; |
592 | dreq->dreq_outbuf.dmbuf_linear.l_len = len; | | 592 | dreq-\*[Gt]dreq_outbuf.dmbuf_linear.l_len = len; |
593 | | | 593 | |
594 | dmover_process(dreq); | | 594 | dmover_process(dreq); |
595 | | | 595 | |
596 | error = (dreq->dreq_flags & DMOVER_REQ_ERROR) ? | | 596 | error = (dreq-\*[Gt]dreq_flags \*[Am] DMOVER_REQ_ERROR) ? |
597 | dreq->dreq_error : 0; | | 597 | dreq-\*[Gt]dreq_error : 0; |
598 | | | 598 | |
599 | dmover_request_free(dreq); | | 599 | dmover_request_free(dreq); |
600 | dmover_session_destroy(dses); | | 600 | dmover_session_destroy(dses); |
601 | | | 601 | |
602 | return (error); | | 602 | return (error); |
603 | } | | 603 | } |
604 | .Ed | | 604 | .Ed |
605 | .Sh SEE ALSO | | 605 | .Sh SEE ALSO |
606 | .Xr queue 3 , | | 606 | .Xr queue 3 , |
607 | .Xr dmoverio 4 | | 607 | .Xr dmoverio 4 |
608 | .Sh HISTORY | | 608 | .Sh HISTORY |
609 | The | | 609 | The |
610 | .Nm dmover | | 610 | .Nm dmover |