Skip to content
Snippets Groups Projects
Commit b84da6e6 authored by Gregory Nutt's avatar Gregory Nutt
Browse files

drivers/loop: Move drivers/loop.c to drivers/loop/losetup.c

parent e665b3db
No related branches found
No related tags found
No related merge requests found
......@@ -27,13 +27,7 @@ config DEV_RANDOM
default n
depends on ARCH_HAVE_RNG
config LOOP
bool "Enable loop device"
default n
---help---
Supports the standard loop device that can be used to export a
file (or character device) as a block device. See losetup() and
loteardown() in include/nuttx/fs/fs.h.
source drivers/loop/Kconfig
menu "Buffering"
......
......@@ -55,6 +55,7 @@ include bch$(DELIM)Make.defs
include input$(DELIM)Make.defs
include discrete$(DELIM)Make.defs
include lcd$(DELIM)Make.defs
include loop$(DELIM)Make.defs
include mmcsd$(DELIM)Make.defs
include mtd$(DELIM)Make.defs
include eeprom$(DELIM)Make.defs
......@@ -76,7 +77,7 @@ ifneq ($(CONFIG_NFILE_DESCRIPTORS),0)
CSRCS += dev_null.c dev_zero.c
ifneq ($(CONFIG_DISABLE_MOUNTPOINT),y)
CSRCS += ramdisk.c loop.c
CSRCS += ramdisk.c
ifeq ($(CONFIG_DRVR_WRITEBUFFER),y)
CSRCS += rwbuffer.c
else
......
......@@ -21,11 +21,6 @@ dev_null.c and dev_zero.c
want to register these devices (devnull_register() and
devzero_register()).
loop.c
Supports the standard loop device that can be used to export a
file (or character device) as a block device. See losetup() and
loteardown() in include/nuttx/fs/fs.h.
pwm.c
Provides the "upper half" of a pulse width modulation (PWM) driver.
The "lower half" of the PWM driver is provided by device-specific
......@@ -36,18 +31,10 @@ ramdisk.c
a block driver that can be mounted as a files system. See
include/nuttx/fs/ramdisk.h.
timer.c
Provides the "upper half" for a generic timer driver. See
include/nuttx/timers/timer.h for more information.
rwbuffer.c
A facility that can be use by any block driver in-order to add
writing buffering and read-ahead buffering.
watchdog.c
Provides the "upper half" for a generic watchdog driver. See
include/nuttx/timers/watchdog.h for more information.
Subdirectories of this directory:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
......@@ -94,6 +81,11 @@ lcd/
Drivers for parallel and serial LCD and OLED type devices. These
drivers support interfaces as defined in include/nuttx/lcd/lcd.h
loop/
Supports the standard loop device that can be used to export a
file (or character device) as a block device. See losetup() and
loteardown() in include/nuttx/fs/fs.h.
mmcsd/
Support for MMC/SD block drivers. MMC/SD block drivers based on
SPI and SDIO/MCI interfaces are supported. See include/nuttx/mmcsd.h
......@@ -153,6 +145,17 @@ spi/
syslog/
System logging devices. See include/syslog.h and include/nuttx/syslog/syslog.h
timers/
Includes support for various timer devices including:
- An "upper half" for a generic timer driver. See
include/nuttx/timers/timer.h for more information.
- An "upper half" for a generic watchdog driver. See
include/nuttx/timers/watchdog.h for more information.
- RTC drivers
usbdev/
USB device drivers. See also include/nuttx/usb/usbdev.h
......
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
config LOOP
bool "Enable loop device"
default n
---help---
Supports the standard loop device that can be used to export a
file (or character device) as a block device.
############################################################################
# drivers/loop/Make.defs
#
# Copyright (C) 2015 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name NuttX nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
# Loop device can only be used with mountpoint support
ifneq ($(CONFIG_DISABLE_MOUNTPOINT),y)
# Include loop device support
ifneq ($(CONFIG_LOOP),y)
# CSRCS += loop.c
endif
CSRCS += losetup.c
# Add loop devicer build support
DEPPATH += --dep-path loop
VPATH += :loop
CFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)drivers$(DELIM)loop}
endif
/****************************************************************************
* drivers/loop.c
* drivers/losetup.c
*
* Copyright (C) 2008-2009, 2011, 2014 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009, 2011, 2014-2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment