drivers/video/fbdev/atafb_utils.h
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/atafb_utils.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/atafb_utils.h- Extension
.h- Size
- 11274 bytes
- Lines
- 402
- Domain
- Driver Families
- Bucket
- drivers/video
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
function fast_memmovefunction expand8_col2maskfunction expand8_2col2maskfunction fill8_colfunction fill8_2colfunction expand16_col2maskfunction expand16_2col2maskfunction memmove32_col
Annotated Snippet
if (count < 16) {
asm volatile ("\n"
" lsr.l #1,%2 ; jcc 1f ; move.b (%1)+,(%0)+\n"
"1: lsr.l #1,%2 ; jcc 1f ; move.w (%1)+,(%0)+\n"
"1: lsr.l #1,%2 ; jcc 1f ; move.l (%1)+,(%0)+\n"
"1: lsr.l #1,%2 ; jcc 1f ; move.l (%1)+,(%0)+ ; move.l (%1)+,(%0)+\n"
"1:"
: "=a" (d), "=a" (s), "=d" (count)
: "0" (d), "1" (s), "2" (count));
} else {
long tmp;
asm volatile ("\n"
" move.l %0,%3\n"
" lsr.l #1,%3 ; jcc 1f ; move.b (%1)+,(%0)+ ; subqw #1,%2\n"
" lsr.l #1,%3 ; jcs 2f\n" /* %0 increased=>bit 2 switched*/
" move.w (%1)+,(%0)+ ; subqw #2,%2 ; jra 2f\n"
"1: lsr.l #1,%3 ; jcc 2f\n"
" move.w (%1)+,(%0)+ ; subqw #2,%2\n"
"2: move.w %2,%-; lsr.l #2,%2 ; jeq 6f\n"
" lsr.l #1,%2 ; jcc 3f ; move.l (%1)+,(%0)+\n"
"3: lsr.l #1,%2 ; jcc 4f ; move.l (%1)+,(%0)+ ; move.l (%1)+,(%0)+\n"
"4: subq.l #1,%2 ; jcs 6f\n"
"5: move.l (%1)+,(%0)+; move.l (%1)+,(%0)+\n"
" move.l (%1)+,(%0)+; move.l (%1)+,(%0)+\n"
" dbra %2,5b ; clr.w %2; subq.l #1,%2; jcc 5b\n"
"6: move.w %+,%2; btst #1,%2 ; jeq 7f ; move.w (%1)+,(%0)+\n"
"7: btst #0,%2 ; jeq 8f ; move.b (%1)+,(%0)+\n"
"8:"
: "=a" (d), "=a" (s), "=d" (count), "=d" (tmp)
: "0" (d), "1" (s), "2" (count));
}
} else {
if (count < 16) {
asm volatile ("\n"
" lsr.l #1,%2 ; jcc 1f ; move.b -(%1),-(%0)\n"
"1: lsr.l #1,%2 ; jcc 1f ; move.w -(%1),-(%0)\n"
"1: lsr.l #1,%2 ; jcc 1f ; move.l -(%1),-(%0)\n"
"1: lsr.l #1,%2 ; jcc 1f ; move.l -(%1),-(%0) ; move.l -(%1),-(%0)\n"
"1:"
: "=a" (d), "=a" (s), "=d" (count)
: "0" ((char *) d + count), "1" ((char *) s + count), "2" (count));
} else {
long tmp;
asm volatile ("\n"
" move.l %0,%3\n"
" lsr.l #1,%3 ; jcc 1f ; move.b -(%1),-(%0) ; subqw #1,%2\n"
" lsr.l #1,%3 ; jcs 2f\n" /* %0 increased=>bit 2 switched*/
" move.w -(%1),-(%0) ; subqw #2,%2 ; jra 2f\n"
"1: lsr.l #1,%3 ; jcc 2f\n"
" move.w -(%1),-(%0) ; subqw #2,%2\n"
"2: move.w %2,%-; lsr.l #2,%2 ; jeq 6f\n"
" lsr.l #1,%2 ; jcc 3f ; move.l -(%1),-(%0)\n"
"3: lsr.l #1,%2 ; jcc 4f ; move.l -(%1),-(%0) ; move.l -(%1),-(%0)\n"
"4: subq.l #1,%2 ; jcs 6f\n"
"5: move.l -(%1),-(%0); move.l -(%1),-(%0)\n"
" move.l -(%1),-(%0); move.l -(%1),-(%0)\n"
" dbra %2,5b ; clr.w %2; subq.l #1,%2; jcc 5b\n"
"6: move.w %+,%2; btst #1,%2 ; jeq 7f ; move.w -(%1),-(%0)\n"
"7: btst #0,%2 ; jeq 8f ; move.b -(%1),-(%0)\n"
"8:"
: "=a" (d), "=a" (s), "=d" (count), "=d" (tmp)
: "0" ((char *) d + count), "1" ((char *) s + count), "2" (count));
}
}
return 0;
}
/* ++andreas: Simple and fast version of memmove, assumes size is
divisible by 16, suitable for moving the whole screen bitplane */
static inline void fast_memmove(char *dst, const char *src, size_t size)
{
if (!size)
return;
if (dst < src)
asm volatile ("\n"
"1: movem.l (%0)+,%%d0/%%d1/%%a0/%%a1\n"
" movem.l %%d0/%%d1/%%a0/%%a1,%1@\n"
" addq.l #8,%1; addq.l #8,%1\n"
" dbra %2,1b\n"
" clr.w %2; subq.l #1,%2\n"
" jcc 1b"
: "=a" (src), "=a" (dst), "=d" (size)
: "0" (src), "1" (dst), "2" (size / 16 - 1)
: "d0", "d1", "a0", "a1", "memory");
else
asm volatile ("\n"
"1: subq.l #8,%0; subq.l #8,%0\n"
Annotation
- Detected declarations: `function fast_memmove`, `function expand8_col2mask`, `function expand8_2col2mask`, `function fill8_col`, `function fill8_2col`, `function expand16_col2mask`, `function expand16_2col2mask`, `function memmove32_col`.
- Atlas domain: Driver Families / drivers/video.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.