type
stringclasses
5 values
content
stringlengths
9
163k
includes
#include <linux/mfd/syscon.h>
includes
#include <linux/regmap.h>
defines
#define to_artpec6_pcie(x) container_of(x, struct artpec6_pcie, pp)
defines
#define PL_OFFSET 0x700
defines
#define PCIE_PHY_DEBUG_R0 (PL_OFFSET + 0x28)
defines
#define PCIE_PHY_DEBUG_R1 (PL_OFFSET + 0x2c)
defines
#define MISC_CONTROL_1_OFF (PL_OFFSET + 0x1bc)
defines
#define DBI_RO_WR_EN 1
defines
#define PCIECFG 0x18
defines
#define PCIECFG_DBG_OEN (1 << 24)
defines
#define PCIECFG_CORE_RESET_REQ (1 << 21)
defines
#define PCIECFG_LTSSM_ENABLE (1 << 20)
defines
#define PCIECFG_CLKREQ_B (1 << 11)
defines
#define PCIECFG_REFCLK_ENABLE (1 << 10)
defines
#define PCIECFG_PLL_ENABLE (1 << 9)
defines
#define PCIECFG_PCLK_ENABLE (1 << 8)
defines
#define PCIECFG_RISRCREN (1 << 4)
defines
#define PCIECFG_MODE_TX_DRV_EN (1 << 3)
defines
#define PCIECFG_CISRREN (1 << 2)
defines
#define PCIECFG_MACRO_ENABLE (1 << 0)
defines
#define NOCCFG 0x40
defines
#define NOCCFG_ENABLE_CLK_PCIE (1 << 4)
defines
#define NOCCFG_POWER_PCIE_IDLEACK (1 << 3)
defines
#define NOCCFG_POWER_PCIE_IDLE (1 << 2)
defines
#define NOCCFG_POWER_PCIE_IDLEREQ (1 << 1)
defines
#define PHY_STATUS 0x118
defines
#define PHY_COSPLLLOCK (1 << 0)
defines
#define ARTPEC6_CPU_TO_BUS_ADDR 0x0fffffff
structs
struct artpec6_pcie { struct pcie_port pp; /* pp.dbi_base is DT dbi */ struct regmap *regmap; /* DT axis,syscon-pcie */ void __iomem *phy_base; /* DT phy */ };
functions
u32 artpec6_pcie_readl(struct artpec6_pcie *artpec6_pcie, u32 offset) { u32 val; regmap_read(artpec6_pcie->regmap, offset, &val); return val; }
functions
void artpec6_pcie_writel(struct artpec6_pcie *artpec6_pcie, u32 offset, u32 val) { regmap_write(artpec6_pcie->regmap, offset, val); }
functions
int artpec6_pcie_establish_link(struct artpec6_pcie *artpec6_pcie) { struct pcie_port *pp = &artpec6_pcie->pp; u32 val; unsigned int retries; /* Hold DW core in reset */ val = artpec6_pcie_readl(artpec6_pcie, PCIECFG); val |= PCIECFG_CORE_RESET_REQ; artpec6_pcie_writel(artpec6_pcie, PCIECFG, val); val = artpe...
functions
void artpec6_pcie_enable_interrupts(struct artpec6_pcie *artpec6_pcie) { struct pcie_port *pp = &artpec6_pcie->pp; if (IS_ENABLED(CONFIG_PCI_MSI)) { dw_pcie_msi_init(pp); }
functions
void artpec6_pcie_host_init(struct pcie_port *pp) { struct artpec6_pcie *artpec6_pcie = to_artpec6_pcie(pp); artpec6_pcie_establish_link(artpec6_pcie); artpec6_pcie_enable_interrupts(artpec6_pcie); }
functions
irqreturn_t artpec6_pcie_msi_handler(int irq, void *arg) { struct artpec6_pcie *artpec6_pcie = arg; struct pcie_port *pp = &artpec6_pcie->pp; return dw_handle_msi_irq(pp); }
functions
int artpec6_add_pcie_port(struct artpec6_pcie *artpec6_pcie, struct platform_device *pdev) { struct pcie_port *pp = &artpec6_pcie->pp; struct device *dev = pp->dev; int ret; if (IS_ENABLED(CONFIG_PCI_MSI)) { pp->msi_irq = platform_get_irq_byname(pdev, "msi"); if (pp->msi_irq <= 0) { dev_err(dev...
functions
int artpec6_pcie_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct artpec6_pcie *artpec6_pcie; struct pcie_port *pp; struct resource *dbi_base; struct resource *phy_base; int ret; artpec6_pcie = devm_kzalloc(dev, sizeof(*artpec6_pcie), GFP_KERNEL); if (!artpec6_pcie) { return -E...
includes
#include <element.h>
functions
int update_SLTW(UPDATE_FUNC_ARGS) { int r, rx, ry; for (rx=-2; rx<3; rx++) for (ry=-2; ry<3; ry++) if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry)) { r = pmap[y+ry][x+rx]; if (!r) continue; if ((r&0xFF)==PT_SALT && 1>(rand()%10000)) part_change_type(r>>8,x+rx,y+ry,PT_SLTW);...
includes
#include <glib.h>
includes
#include <sys/time.h>
includes
#include <string.h>
functions
void ldapctl_set_host( LdapControl* ctl, const gchar *value ) { ctl->hostName = mgu_replace_string( ctl->hostName, value ); if ( ctl->hostName == NULL ) return; g_strstrip( ctl->hostName ); debug_print("setting hostname: %s\n", ctl->hostName); }
functions
void ldapctl_set_port( LdapControl* ctl, const gint value ) { if( value > 0 ) { ctl->port = value; }
functions
void ldapctl_set_base_dn( LdapControl* ctl, const gchar *value ) { ctl->baseDN = mgu_replace_string( ctl->baseDN, value ); if ( ctl->baseDN == NULL ) return; g_strstrip( ctl->baseDN ); debug_print("setting baseDN: %s\n", ctl->baseDN); }
functions
void ldapctl_set_bind_dn( LdapControl* ctl, const gchar *value ) { ctl->bindDN = mgu_replace_string( ctl->bindDN, value ); if ( ctl->bindDN == NULL ) return; g_strstrip( ctl->bindDN ); debug_print("setting bindDN: %s\n", ctl->bindDN); }
functions
void ldapctl_set_bind_password( LdapControl* ctl, const gchar *value, gboolean encrypt, gboolean change ) { gchar *buf, *tmp; ctl->bindPass = mgu_replace_string( ctl->bindPass, value ); if ( ctl->bindPass == NULL ) return; g_strstrip( ctl->bindPass ); buf = tmp = NULL; if ( encrypt ) { /* If first char...
functions
void ldapctl_set_max_entries( LdapControl* ctl, const gint value ) { if( value > 0 ) { ctl->maxEntries = value; }
functions
void ldapctl_set_timeout( LdapControl* ctl, const gint value ) { if( value > 0 ) { ctl->timeOut = value; }
functions
void ldapctl_set_max_query_age( LdapControl* ctl, const gint value ) { if( value > LDAPCTL_MAX_QUERY_AGE ) { ctl->maxQueryAge = LDAPCTL_MAX_QUERY_AGE; }
functions
else if( value < 1 ) { ctl->maxQueryAge = LDAPCTL_DFL_QUERY_AGE; }
functions
void ldapctl_set_matching_option( LdapControl* ctl, const gint value ) { if( value < LDAPCTL_MATCH_BEGINWITH ) { ctl->matchingOption = LDAPCTL_MATCH_BEGINWITH; }
functions
else if( value > LDAPCTL_MATCH_CONTAINS ) { ctl->matchingOption = LDAPCTL_MATCH_BEGINWITH; }
functions
void ldapctl_set_tls( LdapControl* ctl, const gboolean value ) { #ifdef USE_LDAP_TLS ctl->enableTLS = value; debug_print("setting TLS: %d\n", ctl->enableTLS); #endif }
functions
void ldapctl_set_ssl( LdapControl* ctl, const gboolean value ) { #ifdef USE_LDAP_TLS ctl->enableSSL = value; debug_print("setting SSL: %d\n", ctl->enableSSL); #endif }
functions
void ldapctl_criteria_list_clear( LdapControl *ctl ) { cm_return_if_fail( ctl != NULL ); mgu_free_dlist( ctl->listCriteria ); ctl->listCriteria = NULL; }
functions
void ldapctl_criteria_list_add( LdapControl *ctl, gchar *attr ) { cm_return_if_fail( ctl != NULL ); if( attr != NULL ) { if( mgu_list_test_unq_nc( ctl->listCriteria, attr ) ) { debug_print("adding to criteria list: %s\n", attr); ctl->listCriteria = g_list_append( ctl->listCriteria, g_strdup( attr ) ); }
functions
void ldapctl_clear( LdapControl *ctl ) { cm_return_if_fail( ctl != NULL ); debug_print("clearing ldap controller members\n"); /* Free internal stuff */ g_free( ctl->hostName ); g_free( ctl->baseDN ); g_free( ctl->bindDN ); g_free( ctl->bindPass ); g_free( ctl->attribEMail ); g_free( ctl->attribCName ); g_fre...
functions
void ldapctl_free( LdapControl *ctl ) { cm_return_if_fail( ctl != NULL ); debug_print("releasing requested memory for ldap controller\n"); /* Free internal stuff */ ldapctl_clear( ctl ); /* Free the mutex */ pthread_mutex_destroy( ctl->mutexCtl ); g_free( ctl->mutexCtl ); ctl->mutexCtl = NULL; /* Now releas...
functions
void ldapctl_print( const LdapControl *ctl, FILE *stream ) { cm_return_if_fail( ctl != NULL ); gchar *pwd; pthread_mutex_lock( ctl->mutexCtl ); fprintf( stream, "LdapControl:\n" ); fprintf( stream, "host name: '%s'\n", ctl->hostName?ctl->hostName:"null" ); fprintf( stream, " port: %d\n", ctl->port ); fpri...
functions
void ldapctl_copy( const LdapControl *ctlFrom, LdapControl *ctlTo ) { GList *node; cm_return_if_fail( ctlFrom != NULL ); cm_return_if_fail( ctlTo != NULL ); debug_print("ldap controller copy\n"); /* Lock both objects */ pthread_mutex_lock( ctlFrom->mutexCtl ); pthread_mutex_lock( ctlTo->mutexCtl ); /* Clear ...
functions
void ldapctl_free_attribute_array( char **ptrArray ) { gint i; /* Clear array to NULL's */ for( i = 0; ptrArray[i] != NULL; i++ ) { ptrArray[i] = NULL; }
functions
void ldapctl_parse_ldap_search( LdapControl *ctl, gchar *criteria ) { gchar *ptr; gchar *pFrom; gchar *attrib; gint iLen; cm_return_if_fail( ctl != NULL ); ldapctl_criteria_list_clear( ctl ); if( criteria == NULL ) return; pFrom = NULL; ptr = criteria; while( *ptr ) { if( *ptr == '(' ) { pFrom = 1 +...
functions
gboolean ldapctl_compare_list(GList *l1, GList *l2) { gchar *first, *second; if (! l1 && ! l2) return TRUE; if ((! l1 && l2) || (l1 && ! l2)) return FALSE; while (l1 && l2) { first = (gchar *) l1->data; second = (gchar *) l2->data; /*debug_print("comparing: %s = %s\n", first, second);*/ if ( ! (first &&...
includes
#include <zlib.h>
functions
void flipHFSPlusDecmpfs(HFSPlusDecmpfs *compressData) { FLIPENDIANLE(compressData->magic); FLIPENDIANLE(compressData->flags); FLIPENDIANLE(compressData->size); }
functions
void flipRsrcHead(HFSPlusCmpfRsrcHead *data) { FLIPENDIAN(data->headerSize); FLIPENDIAN(data->totalSize); FLIPENDIAN(data->dataSize); FLIPENDIAN(data->flags); }
functions
void flipRsrcBlockHead(HFSPlusCmpfRsrcBlockHead *data) { FLIPENDIAN(data->dataSize); FLIPENDIANLE(data->numBlocks); }
functions
void flipRsrcBlock(HFSPlusCmpfRsrcBlock *data) { FLIPENDIANLE(data->offset); FLIPENDIANLE(data->size); }
functions
void flipHFSPlusCmpfEnd(HFSPlusCmpfEnd *data) { FLIPENDIAN(data->unk1); FLIPENDIAN(data->unk2); FLIPENDIAN(data->unk3); FLIPENDIAN(data->magic); FLIPENDIAN(data->flags); FLIPENDIANLE(data->size); FLIPENDIANLE(data->unk4); }
functions
int compressedRead(io_func *io, off_t location, size_t size, void *buffer) { HFSPlusCompressed *data = (HFSPlusCompressed *)io->data; size_t toRead; while (size > 0) { if (data->cached && location >= data->cachedStart && location < data->cachedEnd) { if ((data->cachedE...
functions
int compressedWrite(io_func *io, off_t location, size_t size, void *buffer) { HFSPlusCompressed *data = (HFSPlusCompressed *)io->data; if (data->cachedStart != 0 || data->cachedEnd != data->decmpfs->size) { // Cache entire file uint8_t *newCache = (uint8_t *)malloc(data->decmpfs-...
functions
void closeHFSPlusCompressed(io_func *io) { HFSPlusCompressed *data = (HFSPlusCompressed *)io->data; if (data->io) CLOSE(data->io); if (data->dirty) { if (data->blocks) free(data->blocks); data->decmpfs->magic = CMPFS_MAGIC; data->decmpfs->flags = 0x4; data->decmpfsSize = sizeof(HFSPlu...
defines
#define MAX_DWT_LEVELS 5
defines
#define MAX_REFERENCE_FRAMES 8
defines
#define MAX_DELAY 5 /* limit for main profile for frame coding (TODO: field coding) */
defines
#define MAX_FRAMES (MAX_REFERENCE_FRAMES + MAX_DELAY + 1)
defines
#define MAX_QUANT 68 /* max quant for VC-2 */
defines
#define MAX_BLOCKSIZE 32 /* maximum xblen/yblen we support */
defines
#define DIRAC_REF_MASK_REF1 1
defines
#define DIRAC_REF_MASK_REF2 2
defines
#define DIRAC_REF_MASK_GLOBAL 4
defines
#define DELAYED_PIC_REF 4
defines
#define CALC_PADDING(size, depth) \
defines
#define DIVRNDUP(a, b) (((a) + (b) - 1) / (b))
defines
#define SIGN_CTX(x) (CTX_SIGN_ZERO + ((x) > 0) - ((x) < 0))
defines
#define CHECKEDREAD(dst, cond, errmsg) \
defines
#define ROLLOFF(i) offset == 1 ? ((i) ? 5 : 3) : \
defines
#define DATA_UNIT_HEADER_SIZE 13
structs
struct lowdelay_slice { GetBitContext gb; int slice_x; int slice_y; int bytes; };
functions
int divide3(int x) { return ((x+1)*21845 + 10922) >> 16; }
functions
int add_frame(DiracFrame *framelist[], int maxframes, DiracFrame *frame) { int i; for (i = 0; i < maxframes; i++) if (!framelist[i]) { framelist[i] = frame; return 0; }
functions
int alloc_sequence_buffers(DiracContext *s) { int sbwidth = DIVRNDUP(s->source.width, 4); int sbheight = DIVRNDUP(s->source.height, 4); int i, w, h, top_padding; /* todo: think more about this / use or set Plane here */ for (i = 0; i < 3; i++) { int max_xblen = MAX_BLOCKSIZE >> (i ? s->ch...
functions
int alloc_buffers(DiracContext *s, int stride) { int w = s->source.width; int h = s->source.height; av_assert0(stride >= w); stride += 64; if (s->buffer_stride >= stride) return 0; s->buffer_stride = 0; av_freep(&s->edge_emu_buffer_base); memset(s->edge_emu_buffer, 0, sizeof(s...
functions
void free_sequence_buffers(DiracContext *s) { int i, j, k; for (i = 0; i < MAX_FRAMES; i++) { if (s->all_frames[i].avframe->data[0]) { av_frame_unref(s->all_frames[i].avframe); memset(s->all_frames[i].interpolated, 0, sizeof(s->all_frames[i].interpolated)); }
functions
int dirac_decode_init(AVCodecContext *avctx) { DiracContext *s = avctx->priv_data; int i; s->avctx = avctx; s->frame_number = -1; ff_diracdsp_init(&s->diracdsp); ff_mpegvideoencdsp_init(&s->mpvencdsp, avctx); ff_videodsp_init(&s->vdsp, 8); for (i = 0; i < MAX_FRAMES; i++) { s-...
functions
void dirac_decode_flush(AVCodecContext *avctx) { DiracContext *s = avctx->priv_data; free_sequence_buffers(s); s->seen_sequence_header = 0; s->frame_number = -1; }
functions
int dirac_decode_end(AVCodecContext *avctx) { DiracContext *s = avctx->priv_data; int i; dirac_decode_flush(avctx); for (i = 0; i < MAX_FRAMES; i++) av_frame_free(&s->all_frames[i].avframe); return 0; }
functions
void coeff_unpack_arith(DiracArith *c, int qfactor, int qoffset, SubBand *b, IDWTELEM *buf, int x, int y) { int coeff, sign; int sign_pred = 0; int pred_ctx = CTX_ZPZN_F1; /* Check if the parent subband has a 0 in the corresponding position */ if (b->parent) ...
functions
int coeff_unpack_golomb(GetBitContext *gb, int qfactor, int qoffset) { int sign, coeff; coeff = svq3_get_ue_golomb(gb); if (coeff) { coeff = (coeff * qfactor + qoffset + 2) >> 2; sign = get_bits1(gb); coeff = (coeff ^ -sign) + sign; }