type
stringclasses
5 values
content
stringlengths
9
163k
functions
int generic_writepages(struct address_space *mapping, struct writeback_control *wbc) { struct blk_plug plug; int ret; /* deal with chardevs and other special file */ if (!mapping->a_ops->writepage) return 0; blk_start_plug(&plug); ret = write_cache_pages(mapping, wbc, __writepage, mapping); blk_fini...
functions
int do_writepages(struct address_space *mapping, struct writeback_control *wbc) { int ret; if (wbc->nr_to_write <= 0) return 0; while (1) { if (mapping->a_ops->writepages) ret = mapping->a_ops->writepages(mapping, wbc); else ret = generic_writepages(mapping, wbc); if ((ret != -ENOMEM) || (wbc->sync_mo...
functions
int write_one_page(struct page *page) { struct address_space *mapping = page->mapping; int ret = 0; struct writeback_control wbc = { .sync_mode = WB_SYNC_ALL, .nr_to_write = 1, }
functions
int __set_page_dirty_no_writeback(struct page *page) { if (!PageDirty(page)) return !TestSetPageDirty(page); return 0; }
functions
void account_page_dirtied(struct page *page, struct address_space *mapping) { struct inode *inode = mapping->host; trace_writeback_dirty_page(page, mapping); if (mapping_can_writeback(mapping)) { struct bdi_writeback *wb; inode_attach_wb(inode, page); wb = inode_to_wb(inode); __inc_lruvec_page_state(page...
functions
void account_page_cleaned(struct page *page, struct address_space *mapping, struct bdi_writeback *wb) { if (mapping_can_writeback(mapping)) { dec_lruvec_page_state(page, NR_FILE_DIRTY); dec_zone_page_state(page, NR_ZONE_WRITE_PENDING); dec_wb_stat(wb, WB_RECLAIMABLE); task_io_account_cancelled_write(PAGE_...
functions
int __set_page_dirty_nobuffers(struct page *page) { lock_page_memcg(page); if (!TestSetPageDirty(page)) { struct address_space *mapping = page_mapping(page); unsigned long flags; if (!mapping) { unlock_page_memcg(page); return 1; }
functions
void account_page_redirty(struct page *page) { struct address_space *mapping = page->mapping; if (mapping && mapping_can_writeback(mapping)) { struct inode *inode = mapping->host; struct bdi_writeback *wb; struct wb_lock_cookie cookie = {}
functions
int redirty_page_for_writepage(struct writeback_control *wbc, struct page *page) { int ret; wbc->pages_skipped++; ret = __set_page_dirty_nobuffers(page); account_page_redirty(page); return ret; }
functions
int set_page_dirty(struct page *page) { struct address_space *mapping = page_mapping(page); page = compound_head(page); if (likely(mapping)) { int (*spd)(struct page *) = mapping->a_ops->set_page_dirty; /* * readahead/lru_deactivate_page could remain * PG_readahead/PG_reclaim due to race with end_page_wri...
functions
int set_page_dirty_lock(struct page *page) { int ret; lock_page(page); ret = set_page_dirty(page); unlock_page(page); return ret; }
functions
void __cancel_dirty_page(struct page *page) { struct address_space *mapping = page_mapping(page); if (mapping_can_writeback(mapping)) { struct inode *inode = mapping->host; struct bdi_writeback *wb; struct wb_lock_cookie cookie = {}
functions
int clear_page_dirty_for_io(struct page *page) { struct address_space *mapping = page_mapping(page); int ret = 0; VM_BUG_ON_PAGE(!PageLocked(page), page); if (mapping && mapping_can_writeback(mapping)) { struct inode *inode = mapping->host; struct bdi_writeback *wb; struct wb_lock_cookie cookie = {}
functions
int test_clear_page_writeback(struct page *page) { struct address_space *mapping = page_mapping(page); struct mem_cgroup *memcg; struct lruvec *lruvec; int ret; memcg = lock_page_memcg(page); lruvec = mem_cgroup_page_lruvec(page, page_pgdat(page)); if (mapping && mapping_use_writeback_tags(mapping)) { struct ...
functions
int __test_set_page_writeback(struct page *page, bool keep_write) { struct address_space *mapping = page_mapping(page); int ret, access_ret; lock_page_memcg(page); if (mapping && mapping_use_writeback_tags(mapping)) { XA_STATE(xas, &mapping->i_pages, page_index(page)); struct inode *inode = mapping->host; st...
functions
void wait_on_page_writeback(struct page *page) { if (PageWriteback(page)) { trace_wait_on_page_writeback(page, page_mapping(page)); wait_on_page_bit(page, PG_writeback); }
functions
void wait_for_stable_page(struct page *page) { page = thp_head(page); if (page->mapping->host->i_sb->s_iflags & SB_I_STABLE_WRITES) wait_on_page_writeback(page); }
includes
#include <unistd.h>
includes
#include <stdlib.h>
includes
#include <string.h>
includes
#include <errno.h>
includes
#include <stdio.h>
includes
#include <sys/types.h>
includes
#include <sys/stat.h>
includes
#include <fcntl.h>
includes
#include <sys/ioctl.h>
includes
#include <sys/param.h>
includes
#include <sys/mount.h>
includes
#include <linux/fd.h>
includes
#include <linux/hdreg.h>
defines
#define BLKGETSIZE _IO(0x12,96) /* Get device size in 512-byte blocks. */
defines
#define BLKGETSIZE64 _IOR(0x12,114,size_t) /* Get device size in bytes. */
defines
#define HDIO_GETGEO 0x0301 /* Get device geometry. */
functions
int ntfs_device_free(struct ntfs_device *dev) { if (!dev) { errno = EINVAL; return -1; }
functions
int ntfs_device_sync(struct ntfs_device *dev) { int ret; struct ntfs_device_operations *dops; if (NDevDirty(dev)) { dops = dev->d_ops; ret = dops->sync(dev); }
functions
s64 ntfs_pread(struct ntfs_device *dev, const s64 pos, s64 count, void *b) { s64 br, total; struct ntfs_device_operations *dops; ntfs_log_trace("pos %lld, count %lld\n",(long long)pos,(long long)count); if (!b || count < 0 || pos < 0) { errno = EINVAL; return -1; }
functions
s64 ntfs_pwrite(struct ntfs_device *dev, const s64 pos, s64 count, const void *b) { s64 written, total, ret = -1; struct ntfs_device_operations *dops; ntfs_log_trace("pos %lld, count %lld\n",(long long)pos,(long long)count); if (!b || count < 0 || pos < 0) { errno = EINVAL; goto out; }
functions
s64 ntfs_mst_pread(struct ntfs_device *dev, const s64 pos, s64 count, const u32 bksize, void *b) { s64 br, i; if (bksize & (bksize - 1) || bksize % NTFS_BLOCK_SIZE) { errno = EINVAL; return -1; }
functions
s64 ntfs_mst_pwrite(struct ntfs_device *dev, const s64 pos, s64 count, const u32 bksize, void *b) { s64 written, i; if (count < 0 || bksize % NTFS_BLOCK_SIZE) { errno = EINVAL; return -1; }
functions
s64 ntfs_cluster_read(const ntfs_volume *vol, const s64 lcn, const s64 count, void *b) { s64 br; if (!vol || lcn < 0 || count < 0) { errno = EINVAL; return -1; }
functions
s64 ntfs_cluster_write(const ntfs_volume *vol, const s64 lcn, const s64 count, const void *b) { s64 bw; if (!vol || lcn < 0 || count < 0) { errno = EINVAL; return -1; }
functions
int ntfs_device_offset_valid(struct ntfs_device *dev, s64 ofs) { char ch; if (dev->d_ops->seek(dev, ofs, SEEK_SET) >= 0 && dev->d_ops->read(dev, &ch, 1) == 1) return 0; return -1; }
functions
s64 ntfs_device_size_get(struct ntfs_device *dev, int block_size) { s64 high, low; if (!dev || block_size <= 0 || (block_size - 1) & block_size) { errno = EINVAL; return -1; }
functions
s64 ntfs_device_partition_start_sector_get(struct ntfs_device *dev) { if (!dev) { errno = EINVAL; return -1; }
functions
int ntfs_device_heads_get(struct ntfs_device *dev) { if (!dev) { errno = EINVAL; return -1; }
functions
int ntfs_device_sectors_per_track_get(struct ntfs_device *dev) { if (!dev) { errno = EINVAL; return -1; }
functions
int ntfs_device_sector_size_get(struct ntfs_device *dev) { if (!dev) { errno = EINVAL; return -1; }
includes
#include <stdbool.h>
functions
void analogin_init(analogin_t *obj, PinName pin) { static bool adc_hsi_inited = false; RCC_OscInitTypeDef RCC_OscInitStruct; uint32_t function = (uint32_t)NC; // ADC Internal Channels "pins" (Temperature, Vref, Vbat, ...) // are described in PinNames.h and PeripheralPins.c // Pin value mus...
functions
once if (!adc_hsi_inited) { adc_hsi_inited = true; // Enable the HSI (to clock the ADC) RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI; RCC_OscInitStruct.HSIState = RCC_HSI_ON; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; RCC_OscInitStruct.HSICali...
functions
uint16_t adc_read(analogin_t *obj) { ADC_ChannelConfTypeDef sConfig = {0}
functions
channel switch (obj->channel) { case 0: sConfig.Channel = ADC_CHANNEL_0; break; case 1: sConfig.Channel = ADC_CHANNEL_1; break; case 2: sConfig.Channel = ADC_CHANNEL_2; break; case 3: sConfig.Channel ...
defines
#define NR_WTROUTES 6
defines
#define NR_WTBLOCKS 2
defines
#define NR_WTBLOCKS 1
functions
void vortex_wt_setstereo(vortex_t * vortex, u32 wt, u32 stereo) { int temp; //temp = hwread(vortex->mmio, 0x80 + ((wt >> 0x5)<< 0xf) + (((wt & 0x1f) >> 1) << 2)); temp = hwread(vortex->mmio, WT_STEREO(wt)); temp = (temp & 0xfe) | (stereo & 1); //hwwrite(vortex->mmio, 0x80 + ((wt >> 0x5)<< 0xf) + (((wt & 0x1f) >> ...
functions
void vortex_wt_setdsout(vortex_t * vortex, u32 wt, int en) { int temp; /* There is one DSREG register for each bank (32 voices each). */ temp = hwread(vortex->mmio, WT_DSREG((wt >= 0x20) ? 1 : 0)); if (en) temp |= (1 << (wt & 0x1f)); else temp &= ~(1 << (wt & 0x1f)); hwwrite(vortex->mmio, WT_DSREG((wt >= 0x2...
functions
int vortex_wt_allocroute(vortex_t * vortex, int wt, int nr_ch) { wt_voice_t *voice = &(vortex->wt_voice[wt]); int temp; //FIXME: WT audio routing. if (nr_ch) { vortex_fifo_wtinitialize(vortex, wt, 1); vortex_fifo_setwtvalid(vortex, wt, 1); vortex_wt_setstereo(vortex, wt, nr_ch - 1); }
functions
void vortex_wt_connect(vortex_t * vortex, int en) { int i, ii, mix; #ifdef CHIP_AU8830 #else #endif for (i = 0; i < NR_WTBLOCKS; i++) { for (ii = 0; ii < NR_WTROUTES; ii++) { mix = vortex_adb_checkinout(vortex, vortex->fixed_res, en, VORTEX_RESOURCE_MIXIN); vortex->mixwt[(i * NR_WTR...
functions
int vortex_wt_GetReg(vortex_t * vortex, char reg, int wt) { //int eax, esi; if (reg == 4) { return hwread(vortex->mmio, WT_PARM(wt, 3)); }
functions
int vortex_wt_SetReg2(vortex_t * vortex, unsigned char reg, int wt, u16 val) { /* int eax, edx; if (wt >= NR_WT) // 0x40 -> NR_WT return 0; if ((reg - 0x20) > 0) { if ((reg - 0x21) != 0) return 0; eax = ((((b & 0xff) << 0xb) + (edx & 0xff)) << 4) + 0x208; // param 2 }
functions
int vortex_wt_SetReg(vortex_t * vortex, unsigned char reg, int wt, u32 val) { int ecx; if ((reg == 5) || ((reg >= 7) && (reg <= 10)) || (reg == 0xc)) { if (wt >= (NR_WT / NR_WT_PB)) { printk ("vortex: WT SetReg: bank out of range. reg=0x%x, wt=%d\n", reg, wt); return 0; }
functions
void vortex_wt_init(vortex_t * vortex) { u32 var4, var8, varc, var10 = 0, edi; var10 &= 0xFFFFFFE3; var10 |= 0x22; var10 &= 0xFFFFFEBF; var10 |= 0x80; var10 |= 0x200; var10 &= 0xfffffffe; var10 &= 0xfffffbff; var10 |= 0x1800; // var10 = 0x1AA2 var4 = 0x10000000; varc = 0x00830000; var8 = 0x00830000; /* ...
functions
void vortex_wt_SetVolume(vortex_t * vortex, int wt, int vol[]) { wt_voice_t *voice = &(vortex->wt_voice[wt]); int ecx = vol[1], eax = vol[0]; /* This is pure guess */ voice->parm0 &= 0xff00ffff; voice->parm0 |= (vol[0] & 0xff) << 0x10; voice->parm1 &= 0xff00ffff; voice->parm1 |= (vol[1] & 0xff) << 0x10; /* Th...
functions
void vortex_wt_SetFrequency(vortex_t * vortex, int wt, unsigned int sr) { wt_voice_t *voice = &(vortex->wt_voice[wt]); u32 eax, edx; //FIXME: 64 bit operation. eax = ((sr << 0xf) * 0x57619F1) & 0xffffffff; edx = (((sr << 0xf) * 0x57619F1)) >> 0x20; edx >>= 0xa; edx <<= 1; if (edx) { if (edx & 0x0FFF80000) ...
includes
#include <linux/module.h>
includes
#include <linux/mm.h>
includes
#include <linux/swap.h>
includes
#include <linux/slab.h>
includes
#include <linux/sysctl.h>
includes
#include <linux/bitmap.h>
includes
#include <linux/signal.h>
includes
#include <linux/printk.h>
includes
#include <linux/proc_fs.h>
includes
#include <linux/security.h>
includes
#include <linux/ctype.h>
includes
#include <linux/kmemcheck.h>
includes
#include <linux/fs.h>
includes
#include <linux/init.h>
includes
#include <linux/kernel.h>
includes
#include <linux/kobject.h>
includes
#include <linux/net.h>
includes
#include <linux/sysrq.h>
includes
#include <linux/highuid.h>
includes
#include <linux/writeback.h>
includes
#include <linux/ratelimit.h>
includes
#include <linux/compaction.h>
includes
#include <linux/hugetlb.h>
includes
#include <linux/initrd.h>
includes
#include <linux/key.h>
includes
#include <linux/times.h>
includes
#include <linux/limits.h>
includes
#include <linux/dcache.h>
includes
#include <linux/dnotify.h>
includes
#include <linux/syscalls.h>
includes
#include <linux/vmstat.h>
includes
#include <linux/nfs_fs.h>
includes
#include <linux/acpi.h>
includes
#include <linux/reboot.h>
includes
#include <linux/ftrace.h>