type
stringclasses
5 values
content
stringlengths
9
163k
includes
#include <linux/device.h>
includes
#include <linux/slab.h>
includes
#include <linux/notifier.h>
includes
#include <mach/viv_gpu.h>
includes
#include <linux/pm_runtime.h>
includes
#include <mach/busfreq.h>
defines
#define _GC_OBJ_ZONE gcvZONE_DRIVER
functions
int task_notify_func(struct notifier_block *self, unsigned long val, void *data) { struct task_struct *task = data; if (task == lowmem_deathpending) lowmem_deathpending = NULL; return NOTIFY_OK; }
functions
size_t viv_gpu_resmem_query(struct task_struct *p, struct reserved_memory_account *m) { gcuDATABASE_INFO info; unsigned int processid = p->pid; gckKERNEL gpukernel = m->data; /* ignore error happens in this api. */ if (gckKERNEL_QueryProcessDB(gpukernel, processid, false, gcvDB_VIDEO_MEMORY, &info)...
functions
int drv_open( struct inode* inode, struct file* filp ) { gceSTATUS status; gctBOOL attached = gcvFALSE; gcsHAL_PRIVATE_DATA_PTR data = gcvNULL; gctINT i; gcmkHEADER_ARG("inode=0x%08X filp=0x%08X", inode, filp); if (filp == gcvNULL) { gcmkTRACE_ZONE( gcvLEVEL...
functions
int drv_release( struct inode* inode, struct file* filp ) { gceSTATUS status; gcsHAL_PRIVATE_DATA_PTR data; gckGALDEVICE device; gctINT i; gcmkHEADER_ARG("inode=0x%08X filp=0x%08X", inode, filp); if (filp == gcvNULL) { gcmkTRACE_ZONE( gcvLEVEL_ERROR, gcvZONE...
functions
long drv_ioctl( struct file* filp, unsigned int ioctlCode, unsigned long arg ) { gceSTATUS status; gcsHAL_INTERFACE iface; gctUINT32 copyLen; DRIVER_ARGS drvArgs; gckGALDEVICE device; gcsHAL_PRIVATE_DATA_PTR data; gctINT32 i, count; gcmkHEADER_ARG( "filp=0x%08X i...
functions
gcdENABLE_VG if (i == gcvCORE_VG) { iface.u.ChipInfo.types[count] = gcvHARDWARE_VG; }
functions
gcdENABLE_VG if (device->coreMapping[iface.hardwareType] == gcvCORE_VG) { status = gckVGKERNEL_Dispatch(device->kernels[gcvCORE_VG], (ioctlCode == IOCTL_GCHAL_INTERFACE), &iface); }
functions
int drv_mmap( struct file* filp, struct vm_area_struct* vma ) { gceSTATUS status = gcvSTATUS_OK; gcsHAL_PRIVATE_DATA_PTR data; gckGALDEVICE device; gcmkHEADER_ARG("filp=0x%08X vma=0x%08X", filp, vma); if (filp == gcvNULL) { gcmkTRACE_ZONE( gcvLEVEL_ERROR, gcvZON...
functions
endif if (showArgs) { printk("galcore options:\n"); printk(" irqLine = %d\n", irqLine); printk(" registerMemBase = 0x%08lX\n", registerMemBase); printk(" registerMemSize = 0x%08lX\n", registerMemSize); if (irqLine2D != -1) { pri...
functions
int thermal_hot_pm_notify(struct notifier_block *nb, unsigned long event, void *dummy) { static gctUINT orgFscale, minFscale, maxFscale; static gctBOOL bAlreadyTooHot = gcvFALSE; gckHARDWARE hardware = galDevice->kernels[gcvCORE_MAJOR]->hardware; if (event && !bAlreadyTooHot) { gckHARDWARE_Get...
functions
else if (!event && bAlreadyTooHot) { gckHARDWARE_SetFscaleValue(hardware, orgFscale); gckOS_Print("Hot alarm is canceled. GPU3D clock will return to %d/64\n", orgFscale); bAlreadyTooHot = gcvFALSE; }
functions
__devinit gpu_probe(struct platform_device *pdev) { int ret = -ENODEV; struct resource* res; #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0) struct device_node *dn =pdev->dev.of_node; const u32 *prop; #else struct viv_gpu_platform_data *pdata; #endif gcmkHEADER(); res = platform_get_resource_byname(...
functions
__devexit gpu_remove(struct platform_device *pdev) { gcmkHEADER(); #if gcdENABLE_FSCALE_VAL_ADJUST if(galDevice->kernels[gcvCORE_MAJOR]) unregister_thermal_notifier(&thermal_hot_pm_notifier); #endif drv_exit(); gcmkFOOTER_NO(); return 0; }
functions
int gpu_suspend(struct platform_device *dev, pm_message_t state) { gceSTATUS status; gckGALDEVICE device; gctINT i; device = platform_get_drvdata(dev); for (i = 0; i < gcdMAX_GPU_COUNT; i++) { if (device->kernels[i] != gcvNULL) { /* Store states. */ #if gcdENABLE_VG...
functions
gcdENABLE_VG if (i == gcvCORE_VG) { status = gckVGHARDWARE_SetPowerManagementState(device->kernels[i]->vg->hardware, gcvPOWER_OFF); }
functions
int gpu_resume(struct platform_device *dev) { gceSTATUS status; gckGALDEVICE device; gctINT i; gceCHIPPOWERSTATE statesStored; device = platform_get_drvdata(dev); for (i = 0; i < gcdMAX_GPU_COUNT; i++) { if (device->kernels[i] != gcvNULL) { #if gcdENABLE_VG if...
functions
gcdENABLE_VG if (i == gcvCORE_VG) { status = gckVGHARDWARE_SetPowerManagementState(device->kernels[i]->vg->hardware, statesStored); }
functions
int gpu_runtime_suspend(struct device *dev) { release_bus_freq(BUS_FREQ_HIGH); return 0; }
functions
int gpu_runtime_resume(struct device *dev) { request_bus_freq(BUS_FREQ_HIGH); return 0; }
functions
int gpu_system_suspend(struct device *dev) { pm_message_t state={0}
functions
int gpu_system_resume(struct device *dev) { return gpu_resume(to_platform_device(dev)); }
functions
__init gpu_init(void) { int ret = 0; #if 0 /*ndef CONFIG_DOVE_GPU*/ gpu_resources[0].start = gpu_resources[0].end = irqLine; gpu_resources[1].start = registerMemBase; gpu_resources[1].end = registerMemBase + registerMemSize - 1; gpu_resources[2].start = contiguousBase; gpu_resources[2].end ...
functions
__exit gpu_exit(void) { platform_driver_unregister(&gpu_driver); #if 0 /*ndef CONFIG_DOVE_GPU*/ platform_device_unregister(gpu_device); #endif }
includes
#include <linux/init.h>
includes
#include <linux/platform_device.h>
includes
#include <linux/mm.h>
includes
#include <linux/console.h>
includes
#include <linux/delay.h>
includes
#include <linux/gpio.h>
includes
#include <linux/pwm_backlight.h>
includes
#include <linux/digital_pulse_backlight.h>
includes
#include <mach/jzfb.h>
includes
#include <mach/fb_hdmi_modes.h>
includes
#include <linux/kfm701a21_1a.h>
functions
int backlight_init(struct device *dev) { int ret; ret = gpio_request(GPIO_LCD_PWM, "Backlight"); if (ret) { printk(KERN_ERR "failed to request GPF for PWM-OUT1\n"); return ret; }
functions
void backlight_exit(struct device *dev) { gpio_free(GPIO_LCD_PWM); }
functions
int init_backlight(struct device *dev) { return 0; }
functions
void exit_backlight(struct device *dev) { }
includes
#include <linux/kernel.h>
includes
#include <linux/interrupt.h>
includes
#include <linux/spinlock_types.h>
includes
#include <linux/scatterlist.h>
includes
#include <linux/crypto.h>
includes
#include <linux/hash.h>
includes
#include <crypto/internal/hash.h>
includes
#include <linux/dma-mapping.h>
includes
#include <crypto/algapi.h>
includes
#include <crypto/aes.h>
includes
#include <crypto/sha.h>
functions
void set_dynamic_sa_command_0(struct dynamic_sa_ctl *sa, u32 save_h, u32 save_iv, u32 ld_h, u32 ld_iv, u32 hdr_proc, u32 h, u32 c, u32 pad_type, u32 op_grp, u32 op, u32 dir) { sa->sa_command_0.w = 0; sa->sa_command_0.bf.save_hash_state = save_h; sa->sa_command_0.bf.save_iv = save_iv; s...
functions
void set_dynamic_sa_command_1(struct dynamic_sa_ctl *sa, u32 cm, u32 hmac_mc, u32 cfb, u32 esn, u32 sn_mask, u32 mute, u32 cp_pad, u32 cp_pay, u32 cp_hdr) { sa->sa_command_1.w = 0; sa->sa_command_1.bf.crypto_mode31 = (cm & 4) >> 2; sa->sa_command_1.bf.crypto_mode9_8 = cm & 3; sa->sa_co...
functions
int crypto4xx_encrypt(struct ablkcipher_request *req) { struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); ctx->direction = DIR_OUTBOUND; ctx->hash_final = 0; ctx->is_hash = 0; ctx->pd_ctl = 0x1; return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, req->nbytes, req->info, get...
functions
int crypto4xx_decrypt(struct ablkcipher_request *req) { struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); ctx->direction = DIR_INBOUND; ctx->hash_final = 0; ctx->is_hash = 0; ctx->pd_ctl = 1; return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, req->nbytes, req->info, get_dy...
functions
int crypto4xx_setkey_aes(struct crypto_ablkcipher *cipher, const u8 *key, unsigned int keylen, unsigned char cm, u8 fb) { struct crypto_tfm *tfm = crypto_ablkcipher_tfm(cipher); struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm); struct dynamic_sa_ctl *sa; int rc; if (keylen != AES...
functions
int crypto4xx_setkey_aes_cbc(struct crypto_ablkcipher *cipher, const u8 *key, unsigned int keylen) { return crypto4xx_setkey_aes(cipher, key, keylen, CRYPTO_MODE_CBC, CRYPTO_FEEDBACK_MODE_NO_FB); }
functions
int crypto4xx_hash_alg_init(struct crypto_tfm *tfm, unsigned int sa_len, unsigned char ha, unsigned char hm) { struct crypto_alg *alg = tfm->__crt_alg; struct crypto4xx_alg *my_alg = crypto_alg_to_crypto4xx_alg(alg); struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm); struct dynamic_sa...
functions
int crypto4xx_hash_init(struct ahash_request *req) { struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); int ds; struct dynamic_sa_ctl *sa; sa = (struct dynamic_sa_ctl *) ctx->sa_in; ds = crypto_ahash_digestsize( __crypto_ahash_cast(req->base.tfm)); sa->sa_command_0.bf.digest_len = ds >> 2; sa->sa_co...
functions
int crypto4xx_hash_update(struct ahash_request *req) { struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); ctx->is_hash = 1; ctx->hash_final = 0; ctx->pd_ctl = 0x11; ctx->direction = DIR_INBOUND; return crypto4xx_build_pd(&req->base, ctx, req->src, (struct scatterlist *) req->result, re...
functions
int crypto4xx_hash_final(struct ahash_request *req) { return 0; }
functions
int crypto4xx_hash_digest(struct ahash_request *req) { struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); ctx->hash_final = 1; ctx->pd_ctl = 0x11; ctx->direction = DIR_INBOUND; return crypto4xx_build_pd(&req->base, ctx, req->src, (struct scatterlist *) req->result, req->nbytes, NULL, 0)...
functions
int crypto4xx_sha1_alg_init(struct crypto_tfm *tfm) { return crypto4xx_hash_alg_init(tfm, SA_HASH160_LEN, SA_HASH_ALG_SHA1, SA_HASH_MODE_HASH); }
includes
#include <sys/types.h>
includes
#include <sys/param.h>
includes
#include <netinet/in.h>
includes
#include <arpa/inet.h>
includes
#include <arpa/nameser.h>
includes
#include <stdio.h>
includes
#include <netdb.h>
includes
#include <resolv.h>
includes
#include <ctype.h>
includes
#include <errno.h>
includes
#include <stdlib.h>
includes
#include <string.h>
includes
#include <unistd.h>
defines
#define MAXPACKET PACKETSZ
defines
#define MAXPACKET 1024
functions
endif switch (hp->rcode) { case NXDOMAIN: h_errno = HOST_NOT_FOUND; break; case SERVFAIL: h_errno = TRY_AGAIN; break; case NOERROR: h_errno = NO_DATA; break; case FORMERR: case NOTIMP: case REFUSED: default: h_errno = NO_RECOVERY; break; }
functions
endif if (domain == NULL) { /* * Check for trailing '.'; * copy without '.' if present. */ n = strlen(name) - 1; if (n != (0 - 1) && name[n] == '.' && n < sizeof(nbuf) - 1) { bcopy(name, nbuf, n); nbuf[n] = '\0'; }
functions
else if (!node[i]->content) { merror(XML_VALUENULL, __local_name, node[i]->element); return (OS_INVALID); }
functions
int Read_Global(XML_NODE node, void *configp, void *mailp) { int i = 0; /* Whitelist size */ unsigned int white_size = 1; unsigned int hostname_white_size = 1; unsigned int mailto_size = 1; /* XML definitions */ const char *xml_mailnotify = "email_notification"; const char *xml_logall ...
functions
else if (!node[i]->content) { merror(XML_VALUENULL, __local_name, node[i]->element); return (OS_INVALID); }
functions
else if (Config) { hostname_white_size++; Config->hostname_white_list = (OSMatch **) realloc(Config->hostname_white_list, sizeof(OSMatch *)*hostname_white_size); if (!Conf...
functions
endif if (Mail) { mailto_size++; Mail->to = (char **) realloc(Mail->to, sizeof(char *)*mailto_size); if (!Mail->to) { merror(MEM_ERROR, __local_name, errno, strerror(errno)); return (OS_INVALID); }
defines
#define APA102_BRIGHTNESS 31 /* overall brightness level, 0 to 31 */
functions
void apa102_put_pixels(u8* buffer, u16 count, pixel* pixels) { int i; pixel* p; u8* d; u8 flag; d = buffer; *d++ = 0; *d++ = 0; *d++ = 0; *d++ = 0; for (i = 0, p = pixels; i < count; i++, p++) { *d++ = 0xe0 + APA102_BRIGHTNESS; *d++ = p->b; *d++ = p->g; *d++ = p->r; }
main
int main(int argc, char** argv) { u16 port = OPC_DEFAULT_PORT; u32 spi_speed_hz = 8000000; char* spi_device_path = "/dev/spidev1.0"; get_speed_and_port(&spi_speed_hz, &port, argc, argv); if (argc > 3) { spi_device_path = argv[3]; }
includes
#include <linux/fs.h>
includes
#include <linux/blkdev.h>
includes
#include <linux/interrupt.h>
includes
#include <linux/completion.h>
includes
#include <linux/kthread.h>
includes
#include <linux/buffer_head.h>
includes
#include <linux/bio.h>