Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/dcons/dcons_os.c
Show First 20 Lines • Show All 303 Lines • ▼ Show 20 Lines | #if defined(__i386__) || defined(__amd64__) | ||||
if (getenv_quad("dcons.addr", &addr) > 0 && | if (getenv_quad("dcons.addr", &addr) > 0 && | ||||
getenv_quad("dcons.size", &size) > 0) { | getenv_quad("dcons.size", &size) > 0) { | ||||
#ifdef __i386__ | #ifdef __i386__ | ||||
vm_paddr_t pa; | vm_paddr_t pa; | ||||
/* | /* | ||||
* Allow read/write access to dcons buffer. | * Allow read/write access to dcons buffer. | ||||
*/ | */ | ||||
for (pa = trunc_page(addr); pa < addr + size; pa += PAGE_SIZE) | for (pa = trunc_page(addr); pa < addr + size; pa += PAGE_SIZE) | ||||
*vtopte(KERNBASE + pa) |= PG_RW; | *vtopte(pa) |= PG_RW; | ||||
invltlb(); | invltlb(); | ||||
#endif | #endif | ||||
/* XXX P to V */ | /* XXX P to V */ | ||||
#ifdef __i386__ | |||||
emaste: not a big deal but prefer consistency - `#if __amd64__ ... #else __i386__` to match above? | |||||
Not Done Inline ActionsI do not understand what do you propose there. kib: I do not understand what do you propose there. | |||||
Done Inline Actionsdcons_crom.c has #ifdef __amd64__ ... #else /* __i386__ */ ... #endif vs here #ifdef __i386__ ... #else /* __amd64__ */ ... #endif Absent a reason where in context one or the other is preferable, it seems we should be consistent and always have one of the two first. emaste: dcons_crom.c has
```
#ifdef __amd64__
...
#else /* __i386__ */
...
#endif
```… | |||||
dg.buf = (struct dcons_buf *)((vm_offset_t)PMAP_MAP_LOW + | |||||
addr); | |||||
#else /* __amd64__ */ | |||||
dg.buf = (struct dcons_buf *)(vm_offset_t)(KERNBASE + addr); | dg.buf = (struct dcons_buf *)(vm_offset_t)(KERNBASE + addr); | ||||
#endif | |||||
dg.size = size; | dg.size = size; | ||||
if (dcons_load_buffer(dg.buf, dg.size, sc) < 0) | if (dcons_load_buffer(dg.buf, dg.size, sc) < 0) | ||||
dg.buf = NULL; | dg.buf = NULL; | ||||
} | } | ||||
#endif | #endif | ||||
if (dg.buf != NULL) | if (dg.buf != NULL) | ||||
goto ok; | goto ok; | ||||
▲ Show 20 Lines • Show All 166 Lines • Show Last 20 Lines |
not a big deal but prefer consistency - #if __amd64__ ... #else __i386__ to match above?