From 8db4c483d5e3941c9352ab5caa0808b391adfbfb Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Thu, 18 Nov 2010 14:03:58 +0100 Subject: Add memory handling module --- memory.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 memory.c (limited to 'memory.c') diff --git a/memory.c b/memory.c new file mode 100644 index 0000000..75b041f --- /dev/null +++ b/memory.c @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2010 Tobias Klauser + * + * This file is part of nios2sim-ng. + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + */ + +#include +#include + +#include "nios2sim-ng.h" +#include "nios2.h" +#include "memory.h" + +uint8_t memory_get_byte(struct memory *mem, int32_t offset) +{ + uint8_t *base = (uint8_t *) mem->base; + return base[offset]; +} + +void memory_dump(struct memory *mem, uint32_t offset, size_t count) +{ + size_t i; + + for (i = 0; i < count; i++) { + if ((i + 1) % 4 == 1) + info("%08x: ", (unsigned int) (offset + i)); + info(" %08x", mem->base[offset / 4 + i]); + if ((i + 1) % 4 == 0) + info("\n"); + } +} -- cgit v1.2.3-54-g00ecf on value='packet-loop-back'>packet-loop-back net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Neukum <oneukum@suse.de>2011-03-11 14:51:12 +0100
committerTakashi Iwai <tiwai@suse.de>2011-03-11 14:59:29 +0100
commit88a8516a2128a6d078a106ead48092240e8a138f (patch)
treedc839c85a9b2fc2e17759c5a42368cb8300e42bc /sound/usb/usbaudio.h
parentedf7de31c25ce72f163bf7d1fc0d2711869d073c (diff)
ALSA: usbaudio: implement USB autosuspend
Devices are autosuspended if no pcm nor midi channel is open Mixer devices may be opened. This way they are active when in use to play or record sound, but can be suspended while users have a mixer application running. [Small clean-ups using static inline by tiwai] Signed-off-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/usbaudio.h')