mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-14 10:09:48 +00:00
Style cleanups, u_intXX -> uintXX.
This commit is contained in:
parent
3e69419a37
commit
c6c9ee90fb
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=128975
@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
|
|
||||||
#include "acpi.h"
|
#include "acpi.h"
|
||||||
|
|
||||||
#include <dev/acpica/acpivar.h>
|
#include <dev/acpica/acpivar.h>
|
||||||
#include <dev/acpica/acpiio.h>
|
#include <dev/acpica/acpiio.h>
|
||||||
|
|
||||||
@ -46,24 +45,17 @@ static device_t acpi_dev;
|
|||||||
* APM driver emulation
|
* APM driver emulation
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if __FreeBSD_version < 500000
|
|
||||||
#include <sys/select.h>
|
|
||||||
#else
|
|
||||||
#include <sys/selinfo.h>
|
#include <sys/selinfo.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <machine/apm_bios.h>
|
#include <machine/apm_bios.h>
|
||||||
#include <machine/pc/bios.h>
|
#include <machine/pc/bios.h>
|
||||||
|
|
||||||
#if __FreeBSD_version < 500000
|
|
||||||
#include <i386/apm/apm.h>
|
|
||||||
#else
|
|
||||||
#include <i386/bios/apm.h>
|
#include <i386/bios/apm.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
u_int32_t acpi_reset_video = 1;
|
uint32_t acpi_reset_video = 1;
|
||||||
TUNABLE_INT("hw.acpi.reset_video", &acpi_reset_video);
|
TUNABLE_INT("hw.acpi.reset_video", &acpi_reset_video);
|
||||||
|
|
||||||
|
static int intr_model = ACPI_INTR_PIC;
|
||||||
static struct apm_softc apm_softc;
|
static struct apm_softc apm_softc;
|
||||||
|
|
||||||
static d_open_t apmopen;
|
static d_open_t apmopen;
|
||||||
@ -83,8 +75,6 @@ static struct cdevsw apm_cdevsw = {
|
|||||||
.d_name = "apm",
|
.d_name = "apm",
|
||||||
};
|
};
|
||||||
|
|
||||||
static int intr_model = ACPI_INTR_PIC;
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
acpi_capm_convert_battstate(struct acpi_battinfo *battp)
|
acpi_capm_convert_battstate(struct acpi_battinfo *battp)
|
||||||
{
|
{
|
||||||
@ -105,11 +95,10 @@ acpi_capm_convert_battstate(struct acpi_battinfo *battp)
|
|||||||
|
|
||||||
/* If still unknown, determine it based on the battery capacity. */
|
/* If still unknown, determine it based on the battery capacity. */
|
||||||
if (state == 0xff) {
|
if (state == 0xff) {
|
||||||
if (battp->cap >= 50) {
|
if (battp->cap >= 50)
|
||||||
state = 0; /* high */
|
state = 0; /* high */
|
||||||
} else {
|
else
|
||||||
state = 1; /* low */
|
state = 1; /* low */
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (state);
|
return (state);
|
||||||
@ -122,9 +111,9 @@ acpi_capm_convert_battflags(struct acpi_battinfo *battp)
|
|||||||
|
|
||||||
flags = 0;
|
flags = 0;
|
||||||
|
|
||||||
if (battp->cap >= 50) {
|
if (battp->cap >= 50)
|
||||||
flags |= APM_BATT_HIGH;
|
flags |= APM_BATT_HIGH;
|
||||||
} else {
|
else {
|
||||||
if (battp->state & ACPI_BATT_STAT_CRITICAL)
|
if (battp->state & ACPI_BATT_STAT_CRITICAL)
|
||||||
flags |= APM_BATT_CRITICAL;
|
flags |= APM_BATT_CRITICAL;
|
||||||
else
|
else
|
||||||
@ -178,9 +167,8 @@ acpi_capm_get_pwstatus(apm_pwstatus_t app)
|
|||||||
struct acpi_battinfo batt;
|
struct acpi_battinfo batt;
|
||||||
|
|
||||||
if (app->ap_device != PMDV_ALLDEV &&
|
if (app->ap_device != PMDV_ALLDEV &&
|
||||||
(app->ap_device < PMDV_BATT0 || app->ap_device > PMDV_BATT_ALL)) {
|
(app->ap_device < PMDV_BATT0 || app->ap_device > PMDV_BATT_ALL))
|
||||||
return (1);
|
return (1);
|
||||||
}
|
|
||||||
|
|
||||||
if (app->ap_device == PMDV_ALLDEV)
|
if (app->ap_device == PMDV_ALLDEV)
|
||||||
batt_unit = -1; /* all units */
|
batt_unit = -1; /* all units */
|
||||||
|
@ -55,22 +55,17 @@ __FBSDID("$FreeBSD$");
|
|||||||
|
|
||||||
#include "acpi_wakecode.h"
|
#include "acpi_wakecode.h"
|
||||||
|
|
||||||
#if __FreeBSD_version < 500000
|
|
||||||
#define vm_page_lock_queues()
|
|
||||||
#define vm_page_unlock_queues()
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern uint32_t acpi_reset_video;
|
extern uint32_t acpi_reset_video;
|
||||||
extern void initializecpu(void);
|
extern void initializecpu(void);
|
||||||
|
|
||||||
static struct region_descriptor r_idt, r_gdt, *p_gdt;
|
static struct region_descriptor r_idt, r_gdt, *p_gdt;
|
||||||
static u_int16_t r_ldt;
|
static uint16_t r_ldt;
|
||||||
|
|
||||||
static u_int32_t r_eax, r_ebx, r_ecx, r_edx, r_ebp, r_esi, r_edi,
|
static uint32_t r_eax, r_ebx, r_ecx, r_edx, r_ebp, r_esi, r_edi,
|
||||||
r_efl, r_cr0, r_cr2, r_cr3, r_cr4, ret_addr;
|
r_efl, r_cr0, r_cr2, r_cr3, r_cr4, ret_addr;
|
||||||
|
|
||||||
static u_int16_t r_cs, r_ds, r_es, r_fs, r_gs, r_ss, r_tr;
|
static uint16_t r_cs, r_ds, r_es, r_fs, r_gs, r_ss, r_tr;
|
||||||
static u_int32_t r_esp = 0;
|
static uint32_t r_esp = 0;
|
||||||
|
|
||||||
static void acpi_printcpu(void);
|
static void acpi_printcpu(void);
|
||||||
static void acpi_realmodeinst(void *arg, bus_dma_segment_t *segs,
|
static void acpi_realmodeinst(void *arg, bus_dma_segment_t *segs,
|
||||||
@ -188,7 +183,7 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state)
|
|||||||
vm_page_t page;
|
vm_page_t page;
|
||||||
static vm_page_t opage = NULL;
|
static vm_page_t opage = NULL;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
u_int32_t cr3;
|
uint32_t cr3;
|
||||||
u_long ef;
|
u_long ef;
|
||||||
struct proc *p;
|
struct proc *p;
|
||||||
|
|
||||||
@ -228,28 +223,28 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state)
|
|||||||
p_gdt->rd_limit = r_gdt.rd_limit;
|
p_gdt->rd_limit = r_gdt.rd_limit;
|
||||||
p_gdt->rd_base = vtophys(r_gdt.rd_base);
|
p_gdt->rd_base = vtophys(r_gdt.rd_base);
|
||||||
|
|
||||||
WAKECODE_FIXUP(physical_esp, u_int32_t, vtophys(r_esp));
|
WAKECODE_FIXUP(physical_esp, uint32_t, vtophys(r_esp));
|
||||||
WAKECODE_FIXUP(previous_cr0, u_int32_t, r_cr0);
|
WAKECODE_FIXUP(previous_cr0, uint32_t, r_cr0);
|
||||||
WAKECODE_FIXUP(previous_cr2, u_int32_t, r_cr2);
|
WAKECODE_FIXUP(previous_cr2, uint32_t, r_cr2);
|
||||||
WAKECODE_FIXUP(previous_cr3, u_int32_t, r_cr3);
|
WAKECODE_FIXUP(previous_cr3, uint32_t, r_cr3);
|
||||||
WAKECODE_FIXUP(previous_cr4, u_int32_t, r_cr4);
|
WAKECODE_FIXUP(previous_cr4, uint32_t, r_cr4);
|
||||||
|
|
||||||
WAKECODE_FIXUP(reset_video, uint32_t, acpi_reset_video);
|
WAKECODE_FIXUP(reset_video, uint32_t, acpi_reset_video);
|
||||||
|
|
||||||
WAKECODE_FIXUP(previous_tr, u_int16_t, r_tr);
|
WAKECODE_FIXUP(previous_tr, uint16_t, r_tr);
|
||||||
WAKECODE_BCOPY(previous_gdt, struct region_descriptor, r_gdt);
|
WAKECODE_BCOPY(previous_gdt, struct region_descriptor, r_gdt);
|
||||||
WAKECODE_FIXUP(previous_ldt, u_int16_t, r_ldt);
|
WAKECODE_FIXUP(previous_ldt, uint16_t, r_ldt);
|
||||||
WAKECODE_BCOPY(previous_idt, struct region_descriptor, r_idt);
|
WAKECODE_BCOPY(previous_idt, struct region_descriptor, r_idt);
|
||||||
|
|
||||||
WAKECODE_FIXUP(where_to_recover, void, acpi_restorecpu);
|
WAKECODE_FIXUP(where_to_recover, void, acpi_restorecpu);
|
||||||
|
|
||||||
WAKECODE_FIXUP(previous_ds, u_int16_t, r_ds);
|
WAKECODE_FIXUP(previous_ds, uint16_t, r_ds);
|
||||||
WAKECODE_FIXUP(previous_es, u_int16_t, r_es);
|
WAKECODE_FIXUP(previous_es, uint16_t, r_es);
|
||||||
WAKECODE_FIXUP(previous_fs, u_int16_t, r_fs);
|
WAKECODE_FIXUP(previous_fs, uint16_t, r_fs);
|
||||||
WAKECODE_FIXUP(previous_gs, u_int16_t, r_gs);
|
WAKECODE_FIXUP(previous_gs, uint16_t, r_gs);
|
||||||
WAKECODE_FIXUP(previous_ss, u_int16_t, r_ss);
|
WAKECODE_FIXUP(previous_ss, uint16_t, r_ss);
|
||||||
|
|
||||||
if (acpi_get_verbose(sc))
|
if (bootverbose)
|
||||||
acpi_printcpu();
|
acpi_printcpu();
|
||||||
|
|
||||||
/* Call ACPICA to enter the desired sleep state */
|
/* Call ACPICA to enter the desired sleep state */
|
||||||
@ -274,7 +269,7 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state)
|
|||||||
#endif
|
#endif
|
||||||
intr_resume();
|
intr_resume();
|
||||||
|
|
||||||
if (acpi_get_verbose(sc)) {
|
if (bootverbose) {
|
||||||
acpi_savecpu();
|
acpi_savecpu();
|
||||||
acpi_printcpu();
|
acpi_printcpu();
|
||||||
}
|
}
|
||||||
@ -328,9 +323,9 @@ static void
|
|||||||
acpi_realmodeinst(void *arg, bus_dma_segment_t *segs, int nsegs, int error)
|
acpi_realmodeinst(void *arg, bus_dma_segment_t *segs, int nsegs, int error)
|
||||||
{
|
{
|
||||||
struct acpi_softc *sc = arg;
|
struct acpi_softc *sc = arg;
|
||||||
u_int32_t *addr;
|
uint32_t *addr;
|
||||||
|
|
||||||
addr = (u_int32_t *)&wakecode[wakeup_sw32 + 2];
|
addr = (uint32_t *)&wakecode[wakeup_sw32 + 2];
|
||||||
*addr = segs[0].ds_addr + wakeup_32;
|
*addr = segs[0].ds_addr + wakeup_32;
|
||||||
bcopy(wakecode, (void *)sc->acpi_wakeaddr, sizeof(wakecode));
|
bcopy(wakecode, (void *)sc->acpi_wakeaddr, sizeof(wakecode));
|
||||||
sc->acpi_wakephys = segs[0].ds_addr;
|
sc->acpi_wakephys = segs[0].ds_addr;
|
||||||
|
Loading…
Reference in New Issue
Block a user