Units
Translation components API.
See the Weblate's Web API documentation for detailed description of the API.
GET /api/translations/documentation/booksarch-handbookpci_index/zh_TW/units/?format=api&page=2
https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_TW/units/?format=api", "results": [ { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_TW/?format=api", "source": [ "If you place the above source file and [.filename]#Makefile# into a directory, you may run `make` to compile the sample driver. Additionally, you may run `make load` to load the driver into the currently running kernel and `make unload` to unload the driver after it is loaded." ], "previous_source": "", "target": [ "" ], "id_hash": -7099536478630949237, "content_hash": -7099536478630949237, "location": "documentation/content/en/books/arch-handbook/pci/_index.adoc:282", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 51, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 47, "source_unit": "https://translate-dev.freebsd.org/api/units/1129726/?format=api", "priority": 100, "id": 1130450, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_TW/?checksum=1d79613009464e8b", "url": "https://translate-dev.freebsd.org/api/units/1130450/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:30.084468Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_TW/?format=api", "source": [ "Additional Resources" ], "previous_source": "", "target": [ "其他資源" ], "id_hash": 4179957802809114289, "content_hash": 4179957802809114289, "location": "documentation/content/en/books/arch-handbook/pci/_index.adoc:283", "context": "", "note": "type: Title ===", "flags": "no-wrap", "labels": [], "state": 20, "fuzzy": false, "translated": true, "approved": false, "position": 52, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 2, "source_unit": "https://translate-dev.freebsd.org/api/units/1129728/?format=api", "priority": 100, "id": 1130451, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_TW/?checksum=ba023179ac8f3eb1", "url": "https://translate-dev.freebsd.org/api/units/1130451/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:30.092683Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_TW/?format=api", "source": [ "http://www.pcisig.org/[PCI Special Interest Group]" ], "previous_source": "", "target": [ "" ], "id_hash": 1663998764448494718, "content_hash": 1663998764448494718, "location": "documentation/content/en/books/arch-handbook/pci/_index.adoc:286", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 53, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 4, "source_unit": "https://translate-dev.freebsd.org/api/units/1129730/?format=api", "priority": 100, "id": 1130452, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_TW/?checksum=9717b60f5da4347e", "url": "https://translate-dev.freebsd.org/api/units/1130452/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:30.099737Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_TW/?format=api", "source": [ "PCI System Architecture, Fourth Edition by Tom Shanley, et al." ], "previous_source": "", "target": [ "" ], "id_hash": -1454631280952065051, "content_hash": -1454631280952065051, "location": "documentation/content/en/books/arch-handbook/pci/_index.adoc:287", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 54, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 10, "source_unit": "https://translate-dev.freebsd.org/api/units/1129732/?format=api", "priority": 100, "id": 1130453, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_TW/?checksum=6bd01c8e93ae43e5", "url": "https://translate-dev.freebsd.org/api/units/1130453/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:30.106480Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_TW/?format=api", "source": [ "Bus Resources" ], "previous_source": "", "target": [ "" ], "id_hash": 6474778008086669952, "content_hash": 6474778008086669952, "location": "documentation/content/en/books/arch-handbook/pci/_index.adoc:289", "context": "", "note": "type: Title ==", "flags": "no-wrap", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 55, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 2, "source_unit": "https://translate-dev.freebsd.org/api/units/1129734/?format=api", "priority": 100, "id": 1130454, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_TW/?checksum=d9db084b23846a80", "url": "https://translate-dev.freebsd.org/api/units/1130454/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:30.112222Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_TW/?format=api", "source": [ "FreeBSD provides an object-oriented mechanism for requesting resources from a parent bus. Almost all devices will be a child member of some sort of bus (PCI, ISA, USB, SCSI, etc) and these devices need to acquire resources from their parent bus (such as memory segments, interrupt lines, or DMA channels)." ], "previous_source": "", "target": [ "" ], "id_hash": -1459293850244644638, "content_hash": -1459293850244644638, "location": "documentation/content/en/books/arch-handbook/pci/_index.adoc:292", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 56, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 50, "source_unit": "https://translate-dev.freebsd.org/api/units/1129736/?format=api", "priority": 100, "id": 1130455, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_TW/?checksum=6bbf8bf9914180e2", "url": "https://translate-dev.freebsd.org/api/units/1130455/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:30.118075Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_TW/?format=api", "source": [ "Base Address Registers" ], "previous_source": "", "target": [ "" ], "id_hash": -6273060512486327044, "content_hash": -6273060512486327044, "location": "documentation/content/en/books/arch-handbook/pci/_index.adoc:293", "context": "", "note": "type: Title ===", "flags": "no-wrap", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 57, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 3, "source_unit": "https://translate-dev.freebsd.org/api/units/1129738/?format=api", "priority": 100, "id": 1130456, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_TW/?checksum=28f19cb332b8fcfc", "url": "https://translate-dev.freebsd.org/api/units/1130456/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:30.123535Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_TW/?format=api", "source": [ "To do anything particularly useful with a PCI device you will need to obtain the _Base Address Registers_ (BARs) from the PCI Configuration space. The PCI-specific details of obtaining the BAR are abstracted in the `bus_alloc_resource()` function." ], "previous_source": "", "target": [ "" ], "id_hash": 2298597324416259985, "content_hash": 2298597324416259985, "location": "documentation/content/en/books/arch-handbook/pci/_index.adoc:296", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 58, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 37, "source_unit": "https://translate-dev.freebsd.org/api/units/1129740/?format=api", "priority": 100, "id": 1130457, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_TW/?checksum=9fe642168b7e9791", "url": "https://translate-dev.freebsd.org/api/units/1130457/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:30.128748Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_TW/?format=api", "source": [ "For example, a typical driver might have something similar to this in the `attach()` function:" ], "previous_source": "", "target": [ "" ], "id_hash": 8002623316696028336, "content_hash": 8002623316696028336, "location": "documentation/content/en/books/arch-handbook/pci/_index.adoc:298", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 59, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 15, "source_unit": "https://translate-dev.freebsd.org/api/units/1129742/?format=api", "priority": 100, "id": 1130458, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_TW/?checksum=ef0f0781beecd4b0", "url": "https://translate-dev.freebsd.org/api/units/1130458/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:30.133427Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_TW/?format=api", "source": [ " sc->bar0id = PCIR_BAR(0);\n sc->bar0res = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->bar0id,\n\t\t\t\t 0, ~0, 1, RF_ACTIVE);\n if (sc->bar0res == NULL) {\n printf(\"Memory allocation of PCI base register 0 failed!\\n\");\n error = ENXIO;\n goto fail1;\n }\n" ], "previous_source": "", "target": [ "" ], "id_hash": 7563779662022398588, "content_hash": 7563779662022398588, "location": "documentation/content/en/books/arch-handbook/pci/_index.adoc:309", "context": "", "note": "type: delimited block . 4", "flags": "no-wrap", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 60, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 31, "source_unit": "https://translate-dev.freebsd.org/api/units/1129744/?format=api", "priority": 100, "id": 1130459, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_TW/?checksum=e8f7f1872a2b527c", "url": "https://translate-dev.freebsd.org/api/units/1130459/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:30.138762Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_TW/?format=api", "source": [ " sc->bar1id = PCIR_BAR(1);\n sc->bar1res = bus_alloc_resource(dev, SYS_RES_MEMORY, &sc->bar1id,\n\t\t\t\t 0, ~0, 1, RF_ACTIVE);\n if (sc->bar1res == NULL) {\n printf(\"Memory allocation of PCI base register 1 failed!\\n\");\n error = ENXIO;\n goto fail2;\n }\n sc->bar0_bt = rman_get_bustag(sc->bar0res);\n sc->bar0_bh = rman_get_bushandle(sc->bar0res);\n sc->bar1_bt = rman_get_bustag(sc->bar1res);\n sc->bar1_bh = rman_get_bushandle(sc->bar1res);\n" ], "previous_source": "", "target": [ "" ], "id_hash": 5133509776506667431, "content_hash": 5133509776506667431, "location": "documentation/content/en/books/arch-handbook/pci/_index.adoc:322", "context": "", "note": "type: delimited block . 4", "flags": "no-wrap", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 61, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 43, "source_unit": "https://translate-dev.freebsd.org/api/units/1129746/?format=api", "priority": 100, "id": 1130460, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_TW/?checksum=c73de3f177acc1a7", "url": "https://translate-dev.freebsd.org/api/units/1130460/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:30.180045Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_TW/?format=api", "source": [ "Handles for each base address register are kept in the `softc` structure so that they can be used to write to the device later." ], "previous_source": "", "target": [ "" ], "id_hash": 1395273226398414871, "content_hash": 1395273226398414871, "location": "documentation/content/en/books/arch-handbook/pci/_index.adoc:325", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 62, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 24, "source_unit": "https://translate-dev.freebsd.org/api/units/1129748/?format=api", "priority": 100, "id": 1130461, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_TW/?checksum=935d019b60173817", "url": "https://translate-dev.freebsd.org/api/units/1130461/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:30.186811Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_TW/?format=api", "source": [ "These handles can then be used to read or write from the device registers with the `bus_space_*` functions. For example, a driver might contain a shorthand function to read from a board specific register like this:" ], "previous_source": "", "target": [ "" ], "id_hash": 4753573090179229662, "content_hash": 4753573090179229662, "location": "documentation/content/en/books/arch-handbook/pci/_index.adoc:327", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 63, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 36, "source_unit": "https://translate-dev.freebsd.org/api/units/1129750/?format=api", "priority": 100, "id": 1130462, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_TW/?checksum=c1f8158a3dfd27de", "url": "https://translate-dev.freebsd.org/api/units/1130462/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:30.192852Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_TW/?format=api", "source": [ "uint16_t\nboard_read(struct ni_softc *sc, uint16_t address)\n{\n return bus_space_read_2(sc->bar1_bt, sc->bar1_bh, address);\n}\n" ], "previous_source": "", "target": [ "" ], "id_hash": -1881631713957041687, "content_hash": -1881631713957041687, "location": "documentation/content/en/books/arch-handbook/pci/_index.adoc:335", "context": "", "note": "type: delimited block . 4", "flags": "no-wrap", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 64, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 12, "source_unit": "https://translate-dev.freebsd.org/api/units/1129752/?format=api", "priority": 100, "id": 1130463, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_TW/?checksum=65e319eceb7b29e9", "url": "https://translate-dev.freebsd.org/api/units/1130463/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:30.199020Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_TW/?format=api", "source": [ "Similarly, one could write to the registers with:" ], "previous_source": "", "target": [ "" ], "id_hash": -1642376599329064125, "content_hash": -1642376599329064125, "location": "documentation/content/en/books/arch-handbook/pci/_index.adoc:338", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 65, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 8, "source_unit": "https://translate-dev.freebsd.org/api/units/1129754/?format=api", "priority": 100, "id": 1130464, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_TW/?checksum=69351b2f4193bb43", "url": "https://translate-dev.freebsd.org/api/units/1130464/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:30.204274Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_TW/?format=api", "source": [ "void\nboard_write(struct ni_softc *sc, uint16_t address, uint16_t value)\n{\n bus_space_write_2(sc->bar1_bt, sc->bar1_bh, address, value);\n}\n" ], "previous_source": "", "target": [ "" ], "id_hash": 7155397246767281952, "content_hash": 7155397246767281952, "location": "documentation/content/en/books/arch-handbook/pci/_index.adoc:346", "context": "", "note": "type: delimited block . 4", "flags": "no-wrap", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 66, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 14, "source_unit": "https://translate-dev.freebsd.org/api/units/1129756/?format=api", "priority": 100, "id": 1130465, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_TW/?checksum=e34d13e2905f3720", "url": "https://translate-dev.freebsd.org/api/units/1130465/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:30.210187Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_TW/?format=api", "source": [ "These functions exist in 8bit, 16bit, and 32bit versions and you should use `bus_space_{read|write}_{1|2|4}` accordingly." ], "previous_source": "", "target": [ "" ], "id_hash": -8282821802144077829, "content_hash": -8282821802144077829, "location": "documentation/content/en/books/arch-handbook/pci/_index.adoc:349", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 67, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 15, "source_unit": "https://translate-dev.freebsd.org/api/units/1129758/?format=api", "priority": 100, "id": 1130466, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_TW/?checksum=0d0d8174895767fb", "url": "https://translate-dev.freebsd.org/api/units/1130466/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:30.216306Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_TW/?format=api", "source": [ "In FreeBSD 7.0 and later, you can use the `bus_*` functions instead of `bus_space_*`. The `bus_*` functions take a struct resource * pointer instead of a bus tag and handle. Thus, you could drop the bus tag and bus handle members from the `softc` and rewrite the `board_read()` function as:" ], "previous_source": "", "target": [ "" ], "id_hash": -1326596572561154466, "content_hash": -1326596572561154466, "location": "documentation/content/en/books/arch-handbook/pci/_index.adoc:353", "context": "", "note": "type: delimited block = 4", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 68, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 50, "source_unit": "https://translate-dev.freebsd.org/api/units/1129760/?format=api", "priority": 100, "id": 1130467, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_TW/?checksum=6d96fb72243dde5e", "url": "https://translate-dev.freebsd.org/api/units/1130467/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:30.275036Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_TW/?format=api", "source": [ "uint16_t\nboard_read(struct ni_softc *sc, uint16_t address)\n{\n\treturn (bus_read(sc->bar1res, address));\n}\n" ], "previous_source": "", "target": [ "" ], "id_hash": -3397348066565614653, "content_hash": -3397348066565614653, "location": "documentation/content/en/books/arch-handbook/pci/_index.adoc:361", "context": "", "note": "type: delimited block . 4", "flags": "no-wrap", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 69, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 11, "source_unit": "https://translate-dev.freebsd.org/api/units/1129762/?format=api", "priority": 100, "id": 1130468, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_TW/?checksum=50da31eef1ff13c3", "url": "https://translate-dev.freebsd.org/api/units/1130468/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:30.281977Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_TW/?format=api", "source": [ "Interrupts" ], "previous_source": "", "target": [ "" ], "id_hash": 4548500038881723789, "content_hash": 4548500038881723789, "location": "documentation/content/en/books/arch-handbook/pci/_index.adoc:365", "context": "", "note": "type: Title ===", "flags": "no-wrap", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 70, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 1, "source_unit": "https://translate-dev.freebsd.org/api/units/1129764/?format=api", "priority": 100, "id": 1130469, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_TW/?checksum=bf1f84afb665458d", "url": "https://translate-dev.freebsd.org/api/units/1130469/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:30.289592Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_TW/?format=api", "source": [ "Interrupts are allocated from the object-oriented bus code in a way similar to the memory resources. First an IRQ resource must be allocated from the parent bus, and then the interrupt handler must be set up to deal with this IRQ." ], "previous_source": "", "target": [ "" ], "id_hash": 4112065784920741423, "content_hash": 4112065784920741423, "location": "documentation/content/en/books/arch-handbook/pci/_index.adoc:368", "context": "", "note": "type: delimited block = 4", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 71, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 41, "source_unit": "https://translate-dev.freebsd.org/api/units/1129766/?format=api", "priority": 100, "id": 1130470, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_TW/?checksum=b910fe0b733d162f", "url": "https://translate-dev.freebsd.org/api/units/1130470/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:30.296627Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_TW/?format=api", "source": [ "Again, a sample from a device `attach()` function says more than words." ], "previous_source": "", "target": [ "" ], "id_hash": 3765428998798586830, "content_hash": 3765428998798586830, "location": "documentation/content/en/books/arch-handbook/pci/_index.adoc:370", "context": "", "note": "type: delimited block = 4", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 72, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 12, "source_unit": "https://translate-dev.freebsd.org/api/units/1129768/?format=api", "priority": 100, "id": 1130471, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_TW/?checksum=b4417db96c5833ce", "url": "https://translate-dev.freebsd.org/api/units/1130471/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:30.303078Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_TW/?format=api", "source": [ "/* Get the IRQ resource */\n" ], "previous_source": "", "target": [ "" ], "id_hash": -3673797461047135011, "content_hash": -3673797461047135011, "location": "documentation/content/en/books/arch-handbook/pci/_index.adoc:374", "context": "", "note": "type: delimited block . 4", "flags": "no-wrap", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 73, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 6, "source_unit": "https://translate-dev.freebsd.org/api/units/1129770/?format=api", "priority": 100, "id": 1130472, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_TW/?checksum=4d040cac7d8db4dd", "url": "https://translate-dev.freebsd.org/api/units/1130472/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:30.310480Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_TW/?format=api", "source": [ " sc->irqid = 0x0;\n sc->irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &(sc->irqid),\n\t\t\t\t 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE);\n if (sc->irqres == NULL) {\n\tprintf(\"IRQ allocation failed!\\n\");\n\terror = ENXIO;\n\tgoto fail3;\n }\n" ], "previous_source": "", "target": [ "" ], "id_hash": 6613747448976308755, "content_hash": 6613747448976308755, "location": "documentation/content/en/books/arch-handbook/pci/_index.adoc:383", "context": "", "note": "type: delimited block . 4", "flags": "no-wrap", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 74, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 28, "source_unit": "https://translate-dev.freebsd.org/api/units/1129772/?format=api", "priority": 100, "id": 1130473, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_TW/?checksum=dbc8c0438260fa13", "url": "https://translate-dev.freebsd.org/api/units/1130473/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:30.317318Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_TW/?format=api", "source": [ " /* Now we should set up the interrupt handler */\n" ], "previous_source": "", "target": [ "" ], "id_hash": -4543295520966690718, "content_hash": -4543295520966690718, "location": "documentation/content/en/books/arch-handbook/pci/_index.adoc:385", "context": "", "note": "type: delimited block . 4", "flags": "no-wrap", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 75, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 10, "source_unit": "https://translate-dev.freebsd.org/api/units/1129774/?format=api", "priority": 100, "id": 1130474, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_TW/?checksum=40f2f8cb8b283862", "url": "https://translate-dev.freebsd.org/api/units/1130474/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:30.324149Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_TW/?format=api", "source": [ " error = bus_setup_intr(dev, sc->irqres, INTR_TYPE_MISC,\n\t\t\t my_handler, sc, &(sc->handler));\n if (error) {\n\tprintf(\"Couldn't set up irq\\n\");\n\tgoto fail4;\n }\n" ], "previous_source": "", "target": [ "" ], "id_hash": -7790109340676383347, "content_hash": -7790109340676383347, "location": "documentation/content/en/books/arch-handbook/pci/_index.adoc:392", "context": "", "note": "type: delimited block . 4", "flags": "no-wrap", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 76, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 18, "source_unit": "https://translate-dev.freebsd.org/api/units/1129776/?format=api", "priority": 100, "id": 1130475, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_TW/?checksum=13e3f8d413881d8d", "url": "https://translate-dev.freebsd.org/api/units/1130475/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:30.381657Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_TW/?format=api", "source": [ "Some care must be taken in the detach routine of the driver. You must quiesce the device's interrupt stream, and remove the interrupt handler. Once `bus_teardown_intr()` has returned, you know that your interrupt handler will no longer be called and that all threads that might have been executing this interrupt handler have returned. Since this function can sleep, you must not hold any mutexes when calling this function." ], "previous_source": "", "target": [ "" ], "id_hash": 6897904909905045999, "content_hash": 6897904909905045999, "location": "documentation/content/en/books/arch-handbook/pci/_index.adoc:395", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 77, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 68, "source_unit": "https://translate-dev.freebsd.org/api/units/1129778/?format=api", "priority": 100, "id": 1130476, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_TW/?checksum=dfba47f8095029ef", "url": "https://translate-dev.freebsd.org/api/units/1130476/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:30.388690Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_TW/?format=api", "source": [ "DMA" ], "previous_source": "", "target": [ "" ], "id_hash": 2285541035077318466, "content_hash": 2285541035077318466, "location": "documentation/content/en/books/arch-handbook/pci/_index.adoc:396", "context": "", "note": "type: Title ===", "flags": "no-wrap", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 78, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 1, "source_unit": "https://translate-dev.freebsd.org/api/units/1129780/?format=api", "priority": 100, "id": 1130477, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_TW/?checksum=9fb7df764b5cb742", "url": "https://translate-dev.freebsd.org/api/units/1130477/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:30.395570Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_TW/?format=api", "source": [ "This section is obsolete, and present only for historical reasons. The proper methods for dealing with these issues is to use the `bus_space_dma*()` functions instead. This paragraph can be removed when this section is updated to reflect that usage. However, at the moment, the API is in a bit of flux, so once that settles down, it would be good to update this section to reflect that." ], "previous_source": "", "target": [ "" ], "id_hash": -959609704791182836, "content_hash": -959609704791182836, "location": "documentation/content/en/books/arch-handbook/pci/_index.adoc:399", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 79, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 67, "source_unit": "https://translate-dev.freebsd.org/api/units/1129782/?format=api", "priority": 100, "id": 1130478, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_TW/?checksum=72aec80ec6e7720c", "url": "https://translate-dev.freebsd.org/api/units/1130478/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:30.401347Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_TW/?format=api", "source": [ "On the PC, peripherals that want to do bus-mastering DMA must deal with physical addresses. This is a problem since FreeBSD uses virtual memory and deals almost exclusively with virtual addresses. Fortunately, there is a function, `vtophys()` to help." ], "previous_source": "", "target": [ "" ], "id_hash": -4505542813747033974, "content_hash": -4505542813747033974, "location": "documentation/content/en/books/arch-handbook/pci/_index.adoc:401", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 80, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 39, "source_unit": "https://translate-dev.freebsd.org/api/units/1129784/?format=api", "priority": 100, "id": 1130479, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_TW/?checksum=417918aeaa4b488a", "url": "https://translate-dev.freebsd.org/api/units/1130479/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:30.484946Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_TW/?format=api", "source": [ "#include <vm/vm.h>\n#include <vm/pmap.h>\n" ], "previous_source": "", "target": [ "" ], "id_hash": -5633610065317403412, "content_hash": -5633610065317403412, "location": "documentation/content/en/books/arch-handbook/pci/_index.adoc:406", "context": "", "note": "type: delimited block . 4", "flags": "no-wrap", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 81, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 4, "source_unit": "https://translate-dev.freebsd.org/api/units/1129786/?format=api", "priority": 100, "id": 1130480, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_TW/?checksum=31d1657e65b0e4ec", "url": "https://translate-dev.freebsd.org/api/units/1130480/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:30.491536Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_TW/?format=api", "source": [ "#define vtophys(virtual_address) (...)\n" ], "previous_source": "", "target": [ "" ], "id_hash": 2832117704313281761, "content_hash": 2832117704313281761, "location": "documentation/content/en/books/arch-handbook/pci/_index.adoc:408", "context": "", "note": "type: delimited block . 4", "flags": "no-wrap", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 82, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 3, "source_unit": "https://translate-dev.freebsd.org/api/units/1129788/?format=api", "priority": 100, "id": 1130481, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_TW/?checksum=a74db40bffb01ce1", "url": "https://translate-dev.freebsd.org/api/units/1130481/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:30.499097Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_TW/?format=api", "source": [ "The solution is a bit different on the alpha however, and what we really want is a function called `vtobus()`." ], "previous_source": "", "target": [ "" ], "id_hash": -5556038995601555399, "content_hash": -5556038995601555399, "location": "documentation/content/en/books/arch-handbook/pci/_index.adoc:411", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 83, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 20, "source_unit": "https://translate-dev.freebsd.org/api/units/1129790/?format=api", "priority": 100, "id": 1130482, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_TW/?checksum=32e4fbf87cf38039", "url": "https://translate-dev.freebsd.org/api/units/1130482/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:30.508284Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_TW/?format=api", "source": [ "#if defined(__alpha__)\n#define vtobus(va) alpha_XXX_dmamap((vm_offset_t)va)\n#else\n#define vtobus(va) vtophys(va)\n#endif\n" ], "previous_source": "", "target": [ "" ], "id_hash": -3299689832399566146, "content_hash": -3299689832399566146, "location": "documentation/content/en/books/arch-handbook/pci/_index.adoc:419", "context": "", "note": "type: delimited block . 4", "flags": "no-wrap", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 84, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 10, "source_unit": "https://translate-dev.freebsd.org/api/units/1129792/?format=api", "priority": 100, "id": 1130483, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_TW/?checksum=5235259476db0abe", "url": "https://translate-dev.freebsd.org/api/units/1130483/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:30.516353Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_TW/?format=api", "source": [ "Deallocating Resources" ], "previous_source": "", "target": [ "" ], "id_hash": 8211303612089306340, "content_hash": 8211303612089306340, "location": "documentation/content/en/books/arch-handbook/pci/_index.adoc:421", "context": "", "note": "type: Title ===", "flags": "no-wrap", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 85, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 2, "source_unit": "https://translate-dev.freebsd.org/api/units/1129794/?format=api", "priority": 100, "id": 1130484, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_TW/?checksum=f1f469213d770ce4", "url": "https://translate-dev.freebsd.org/api/units/1130484/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:30.576467Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_TW/?format=api", "source": [ "It is very important to deallocate all of the resources that were allocated during `attach()`. Care must be taken to deallocate the correct stuff even on a failure condition so that the system will remain usable while your driver dies." ], "previous_source": "", "target": [ "" ], "id_hash": -6291558940050731992, "content_hash": -6291558940050731992, "location": "documentation/content/en/books/arch-handbook/pci/_index.adoc:423", "context": "", "note": "type: Plain text", "flags": "", "labels": [], "state": 0, "fuzzy": false, "translated": false, "approved": false, "position": 86, "has_suggestion": false, "has_comment": false, "has_failing_check": false, "num_words": 40, "source_unit": "https://translate-dev.freebsd.org/api/units/1129796/?format=api", "priority": 100, "id": 1130485, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_TW/?checksum=28afe47a66d7cc28", "url": "https://translate-dev.freebsd.org/api/units/1130485/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:30.581781Z" } ] }{ "count": 86, "next": null, "previous": "