int c;
if ((cn_tab == NULL) || cn_mute)
return (-1);
- c = (*cn_tab->cn_getc)(cn_tab->cn_dev);
+ c = (*cn_tab->cn_getc)(cn_tab->cn_private);
if (c == '\r') c = '\n'; /* console input is always ICRNL */
return (c);
}
{
if ((cn_tab == NULL) || cn_mute)
return (-1);
- return ((*cn_tab->cn_checkc)(cn_tab->cn_dev));
+ return ((*cn_tab->cn_checkc)(cn_tab->cn_private));
}
void
return;
if (c) {
if (c == '\n')
- (*cn_tab->cn_putc)(cn_tab->cn_dev, '\r');
- (*cn_tab->cn_putc)(cn_tab->cn_dev, c);
+ (*cn_tab->cn_putc)(cn_tab->cn_private, '\r');
+ (*cn_tab->cn_putc)(cn_tab->cn_private, c);
#ifdef DDB
if (console_pausing && !db_active && (c == '\n')) {
#else
if (console_pausing && (c == '\n')) {
#endif
for(cp=console_pausestr; *cp != '\0'; cp++)
- (*cn_tab->cn_putc)(cn_tab->cn_dev, *cp);
+ (*cn_tab->cn_putc)(cn_tab->cn_private, *cp);
if (cngetc() == '.')
console_pausing = 0;
- (*cn_tab->cn_putc)(cn_tab->cn_dev, '\r');
+ (*cn_tab->cn_putc)(cn_tab->cn_private, '\r');
for(cp=console_pausestr; *cp != '\0'; cp++)
- (*cn_tab->cn_putc)(cn_tab->cn_dev, ' ');
- (*cn_tab->cn_putc)(cn_tab->cn_dev, '\r');
+ (*cn_tab->cn_putc)(cn_tab->cn_private, ' ');
+ (*cn_tab->cn_putc)(cn_tab->cn_private, '\r');
}
}
}
if (!on)
refcount--;
if (refcount == 0 && cn_tab->cn_dbctl != NULL)
- (*cn_tab->cn_dbctl)(cn_tab->cn_dev, on);
+ (*cn_tab->cn_dbctl)(cn_tab->cn_private, on);
if (on)
refcount++;
}
* Handle alignment. For large memory maps it is possible
* that the MMU can optimize the page table so align anything
* that is a multiple of SEG_SIZE to SEG_SIZE.
+ *
+ * Also align any large mapping (bigger than 16x SG_SIZE) to a
+ * SEG_SIZE address boundary.
*/
if (flags & MAP_SIZEALIGN) {
align = size;
lwkt_reltoken(&map->token);
return (EINVAL);
}
- } else if ((flags & MAP_FIXED) == 0 && (size & SEG_MASK) == 0) {
+ } else if ((flags & MAP_FIXED) == 0 &&
+ ((size & SEG_MASK) == 0 || size > SEG_SIZE * 16)) {
align = SEG_SIZE;
} else {
align = PAGE_SIZE;