From c197a2671fbc08ee04c0abf2b9c9234d1068a3a7 Mon Sep 17 00:00:00 2001 From: Jonathan Matthew Date: Tue, 20 Mar 2018 04:18:41 +0000 Subject: Add hibernate IO path for sdmmc(4). This requires some help from the sdmmc chipset driver, currently only implemented in sdhc(4), but mostly uses the regular path. sdhc(4) also needed the ability to perform IO while cold. ok deraadt@ --- sys/arch/i386/i386/hibernate_machdep.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'sys/arch/i386') diff --git a/sys/arch/i386/i386/hibernate_machdep.c b/sys/arch/i386/i386/hibernate_machdep.c index 5bc05033673..f98d6c5a49e 100644 --- a/sys/arch/i386/i386/hibernate_machdep.c +++ b/sys/arch/i386/i386/hibernate_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hibernate_machdep.c,v 1.50 2018/02/10 05:11:06 jmatthew Exp $ */ +/* $OpenBSD: hibernate_machdep.c,v 1.51 2018/03/20 04:18:40 jmatthew Exp $ */ /* * Copyright (c) 2011 Mike Larkin @@ -45,6 +45,7 @@ #include "ahci.h" #include "softraid.h" #include "sd.h" +#include "sdmmc.h" /* Hibernate support */ void hibernate_enter_resume_4k_pte(vaddr_t, paddr_t); @@ -97,6 +98,8 @@ get_hibernate_io_function(dev_t dev) vaddr_t addr, size_t size, int op, void *page); extern int sr_hibernate_io(dev_t dev, daddr_t blkno, vaddr_t addr, size_t size, int op, void *page); + extern int sdmmc_scsi_hibernate_io(dev_t dev, daddr_t blkno, + vaddr_t addr, size_t size, int op, void *page); struct device *dv = disk_lookup(&sd_cd, DISKUNIT(dev)); struct { const char *driver; @@ -107,6 +110,9 @@ get_hibernate_io_function(dev_t dev) #endif #if NSOFTRAID > 0 { "softraid", sr_hibernate_io }, +#endif +#if SDMMC > 0 + { "sdmmc", sdmmc_scsi_hibernate_io }, #endif }; -- cgit v1.2.3