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_CN/units/?format=api&page=2
https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_CN/units/?format=api", "results": [ { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_CN/?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": 1130364, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_CN/?checksum=1d79613009464e8b", "url": "https://translate-dev.freebsd.org/api/units/1130364/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:27.951204Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_CN/?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": 1130365, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_CN/?checksum=ba023179ac8f3eb1", "url": "https://translate-dev.freebsd.org/api/units/1130365/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:27.958688Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_CN/?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": 1130366, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_CN/?checksum=9717b60f5da4347e", "url": "https://translate-dev.freebsd.org/api/units/1130366/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:27.979103Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_CN/?format=api", "source": [ "PCI System Architecture, Fourth Edition by Tom Shanley, et al." ], "previous_source": "", "target": [ "PCI System Architecture, Fourth Edition by Tom Shanley, et al." ], "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": 20, "fuzzy": false, "translated": true, "approved": false, "position": 54, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 10, "source_unit": "https://translate-dev.freebsd.org/api/units/1129732/?format=api", "priority": 100, "id": 1130367, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_CN/?checksum=6bd01c8e93ae43e5", "url": "https://translate-dev.freebsd.org/api/units/1130367/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:27.987855Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_CN/?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": 20, "fuzzy": false, "translated": true, "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": 1130368, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_CN/?checksum=d9db084b23846a80", "url": "https://translate-dev.freebsd.org/api/units/1130368/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:27.995569Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_CN/?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": [ "FreeBSD为从父总线请求资源提供了一种面向对象的机制。几乎所有设备都是某种类型的总线(PCI, ISA, USB, SCSI等等)的孩子成员,并且这些设备需要从他们的父总线获取资源(例如内存段, 中断线, 或者DMA通道)。" ], "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": 20, "fuzzy": false, "translated": true, "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": 1130369, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_CN/?checksum=6bbf8bf9914180e2", "url": "https://translate-dev.freebsd.org/api/units/1130369/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:28.003981Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_CN/?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": 20, "fuzzy": false, "translated": true, "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": 1130370, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_CN/?checksum=28f19cb332b8fcfc", "url": "https://translate-dev.freebsd.org/api/units/1130370/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:28.011343Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_CN/?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": 1130371, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_CN/?checksum=9fe642168b7e9791", "url": "https://translate-dev.freebsd.org/api/units/1130371/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:28.018770Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_CN/?format=api", "source": [ "For example, a typical driver might have something similar to this in the `attach()` function:" ], "previous_source": "", "target": [ "例如,一个典型的驱动程序可能在<function>attach()</function>函数中有些类似下面的东西:" ], "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": 10, "fuzzy": true, "translated": false, "approved": false, "position": 59, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 15, "source_unit": "https://translate-dev.freebsd.org/api/units/1129742/?format=api", "priority": 100, "id": 1130372, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_CN/?checksum=ef0f0781beecd4b0", "url": "https://translate-dev.freebsd.org/api/units/1130372/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:28.025010Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_CN/?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": 1130373, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_CN/?checksum=e8f7f1872a2b527c", "url": "https://translate-dev.freebsd.org/api/units/1130373/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:28.031960Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_CN/?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": 1130374, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_CN/?checksum=c73de3f177acc1a7", "url": "https://translate-dev.freebsd.org/api/units/1130374/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:28.039615Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_CN/?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": 1130375, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_CN/?checksum=935d019b60173817", "url": "https://translate-dev.freebsd.org/api/units/1130375/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:28.046230Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_CN/?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": [ "然后就能使用这些句柄与<function>bus_space_*</function>函数一起读写设备寄存器。例如,驱动程序可能包含如下的快捷函数,用来读取板子特定的寄存器:" ], "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": 10, "fuzzy": true, "translated": false, "approved": false, "position": 63, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 36, "source_unit": "https://translate-dev.freebsd.org/api/units/1129750/?format=api", "priority": 100, "id": 1130376, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_CN/?checksum=c1f8158a3dfd27de", "url": "https://translate-dev.freebsd.org/api/units/1130376/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:28.088445Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_CN/?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": 1130377, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_CN/?checksum=65e319eceb7b29e9", "url": "https://translate-dev.freebsd.org/api/units/1130377/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:28.095756Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_CN/?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": 20, "fuzzy": false, "translated": true, "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": 1130378, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_CN/?checksum=69351b2f4193bb43", "url": "https://translate-dev.freebsd.org/api/units/1130378/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:28.102656Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_CN/?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": 1130379, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_CN/?checksum=e34d13e2905f3720", "url": "https://translate-dev.freebsd.org/api/units/1130379/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:28.108962Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_CN/?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": [ "这些函数以8位,16位和32位的版本存在,你应当相应地使用<function>bus_space_{read|write}_{1|2|4}</function>。" ], "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": 10, "fuzzy": true, "translated": false, "approved": false, "position": 67, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 15, "source_unit": "https://translate-dev.freebsd.org/api/units/1129758/?format=api", "priority": 100, "id": 1130380, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_CN/?checksum=0d0d8174895767fb", "url": "https://translate-dev.freebsd.org/api/units/1130380/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:28.116018Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_CN/?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": 1130381, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_CN/?checksum=6d96fb72243dde5e", "url": "https://translate-dev.freebsd.org/api/units/1130381/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:28.122961Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_CN/?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": 1130382, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_CN/?checksum=50da31eef1ff13c3", "url": "https://translate-dev.freebsd.org/api/units/1130382/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:28.130390Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_CN/?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": 20, "fuzzy": false, "translated": true, "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": 1130383, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_CN/?checksum=bf1f84afb665458d", "url": "https://translate-dev.freebsd.org/api/units/1130383/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:28.137360Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_CN/?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": [ "中断按照和分配内存资源相似的方式从面向对象的总线代码分配。首先,必须从父总线分配IRQ资源,然后必须设置中断处理函数来处理这个IRQ。" ], "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": 20, "fuzzy": false, "translated": true, "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": 1130384, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_CN/?checksum=b910fe0b733d162f", "url": "https://translate-dev.freebsd.org/api/units/1130384/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:28.143797Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_CN/?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": 1130385, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_CN/?checksum=b4417db96c5833ce", "url": "https://translate-dev.freebsd.org/api/units/1130385/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:28.150845Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_CN/?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": 1130386, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_CN/?checksum=4d040cac7d8db4dd", "url": "https://translate-dev.freebsd.org/api/units/1130386/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:28.179203Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_CN/?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": 1130387, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_CN/?checksum=dbc8c0438260fa13", "url": "https://translate-dev.freebsd.org/api/units/1130387/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:28.186433Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_CN/?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": 1130388, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_CN/?checksum=40f2f8cb8b283862", "url": "https://translate-dev.freebsd.org/api/units/1130388/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:28.194266Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_CN/?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": 1130389, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_CN/?checksum=13e3f8d413881d8d", "url": "https://translate-dev.freebsd.org/api/units/1130389/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:28.202310Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_CN/?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": [ "在设备的分离例程中必须注意一些问题。你必须停顿设备的中断流,并移除中断处理函数。一旦<function>bus_teardown_intr()</function>返回,你知道你的中断处理函数不会再被调用,并且所有可能已经执行了这个中断处理函数的线程都已经返回。由于此函数可以睡眠,调用此函数时你必须不能拥有任何互斥体。" ], "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": 10, "fuzzy": true, "translated": false, "approved": false, "position": 77, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 68, "source_unit": "https://translate-dev.freebsd.org/api/units/1129778/?format=api", "priority": 100, "id": 1130390, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_CN/?checksum=dfba47f8095029ef", "url": "https://translate-dev.freebsd.org/api/units/1130390/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:28.211735Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_CN/?format=api", "source": [ "DMA" ], "previous_source": "", "target": [ "DMA" ], "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": 20, "fuzzy": false, "translated": true, "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": 1130391, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_CN/?checksum=9fb7df764b5cb742", "url": "https://translate-dev.freebsd.org/api/units/1130391/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:28.221542Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_CN/?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": 1130392, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_CN/?checksum=72aec80ec6e7720c", "url": "https://translate-dev.freebsd.org/api/units/1130392/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:28.227968Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_CN/?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": 1130393, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_CN/?checksum=417918aeaa4b488a", "url": "https://translate-dev.freebsd.org/api/units/1130393/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:28.234445Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_CN/?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": 1130394, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_CN/?checksum=31d1657e65b0e4ec", "url": "https://translate-dev.freebsd.org/api/units/1130394/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:28.240831Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_CN/?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": 1130395, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_CN/?checksum=a74db40bffb01ce1", "url": "https://translate-dev.freebsd.org/api/units/1130395/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:28.281321Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_CN/?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": 1130396, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_CN/?checksum=32e4fbf87cf38039", "url": "https://translate-dev.freebsd.org/api/units/1130396/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:28.287913Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_CN/?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": 1130397, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_CN/?checksum=5235259476db0abe", "url": "https://translate-dev.freebsd.org/api/units/1130397/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:28.295782Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_CN/?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": 20, "fuzzy": false, "translated": true, "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": 1130398, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_CN/?checksum=f1f469213d770ce4", "url": "https://translate-dev.freebsd.org/api/units/1130398/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:28.302911Z" }, { "translation": "https://translate-dev.freebsd.org/api/translations/documentation/booksarch-handbookpci_index/zh_CN/?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": [ "取消<function>attach()</function>期间分配的所有资源非常重要。必须小心谨慎,即使在失败的条件下也要保证取消分配那些正确的东西,这样当你的驱动程序去掉后系统仍然可以使用。" ], "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": 10, "fuzzy": true, "translated": false, "approved": false, "position": 86, "has_suggestion": false, "has_comment": false, "has_failing_check": true, "num_words": 40, "source_unit": "https://translate-dev.freebsd.org/api/units/1129796/?format=api", "priority": 100, "id": 1130399, "web_url": "https://translate-dev.freebsd.org/translate/documentation/booksarch-handbookpci_index/zh_CN/?checksum=28afe47a66d7cc28", "url": "https://translate-dev.freebsd.org/api/units/1130399/?format=api", "explanation": "", "extra_flags": "", "pending": false, "timestamp": "2021-05-23T13:15:28.309757Z" } ] }{ "count": 86, "next": null, "previous": "