STRUCT TTM_BO_KMAP_OBJ(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct ttm_bo_kmap_obj(9) πŸ’…

okay so this is a page from the Kernel API Manual β€” yes, the kernel has manuals, and yes, this one is about a struct. a struct, bestie. but she's kind of iconic so stay with me 🫢


✨ NAME ✨

struct ttm_bo_kmap_obj β€” (the name line is literally empty in the original, which is so her: no explanation, just vibes. it's the object that describes a kernel mapping of a TTM buffer object, but the manpage refuses to say it in the NAME section. we respect the mystery πŸ’…)


🌸 SYNOPSIS 🌸

like, the whole shape of her. no cap, here it is exactly:

struct ttm_bo_kmap_obj {
    void *virtual;
    struct page *page;
    enum {
      ttm_bo_map_iomap = 1 | TTM_BO_MAP_IOMEM_MASK,
      ttm_bo_map_vmap = 2,
      ttm_bo_map_kmap = 3,
      ttm_bo_map_premapped = 4 | TTM_BO_MAP_IOMEM_MASK,
    } bo_kmap_type;
    struct ttm_buffer_object *bo;
 };

πŸ¦‹ Members πŸ¦‹

breaking down the cast of characters, main-character style:

  • virtual β€” the current kernel virtual address. that's it, that's the whole description. she's current, she's virtual, she's addressed. ✨
  • page β€” the page when kmap'ing a single page. one (1) page. single-page energy πŸŽ€
  • bo_kmap_type β€” type of bo_kmap, iykyk. and the options are the enum up in the synopsis: ttm_bo_map_iomap, ttm_bo_map_vmap, ttm_bo_map_kmap, ttm_bo_map_premapped πŸ’–
  • bo β€” the TTM BO. short, sweet, to the point. πŸ”₯

πŸ’œ Description πŸ’œ

so here's the lore: this thing is an object describing a kernel mapping. and the reason it has to be flexible is that a TTM bo may live in various memory types with various caching policies β€” so the mapping can be any one of these four:

  • an ioremap
  • a vmap
  • a kmap
  • or part of a premapped region

that's the whole deal. four possible mapping situations, one struct carrying them all. lowkey elegant ngl 🧚


⭐ SEE ALSO ⭐

go read these next, bestie, the whole friend group:


ngl ttm_bo_lru_for_each_reserved_guarded(9) is giving "I have a long name because I do a lot" and honestly? respect. πŸ‘‘

and that's the page!! mwah πŸ’‹ this one came from ./include/drm/ttm, dated October 2026, and it's filed under struct ttm_bo_kmap_obj(9) β€” go off, king πŸŽ€πŸŒˆπŸ’–

πŸ“¦ where this page comes from