//儒略日 int JD(int y,int m,int d,int h,int min,int sec,int zone,int calType) { double ifG=ifGr(y,m,d,calType); double jt=(h+(min+sec/60)/60)/24-0.5-zone/24; double jd=(ifG)?(SD(y,m,d,calType)+1721425+jt):(SD(y,m,d,calType)+1721423+jt);//儒略日 return (int)jd; }
/* * eata_proc_info * inout : decides on the direction of the dataflow and the meaning of the * variables * buffer: If inout==FALSE data is being written to it else read from it * *start: If inout==FALSE start of the valid data in the buffer * offset: If inout==FALSE offset from the beginning of the imaginary file * from which we start writing into the buffer * length: If inout==FALSE max number of bytes to be written into the buffer * else number of bytes in the buffer */ static int eata_pio_proc_info(struct Scsi_Host *shost, char *buffer, char **start, off_t offset, int length, int rw) { static u8 buff[512]; int size, len = 0; off_t begin = 0, pos = 0; if (rw) return -ENOSYS; if (offset == 0) memset(buff, 0, sizeof(buff)); size = sprintf(buffer+len, "EATA (Extended Attachment) PIO driver version: " "%d.%d%s\n",VER_MAJOR, VER_MINOR, VER_SUB); len += size; pos = begin + len; size = sprintf(buffer + len, "queued commands: %10ld\n" "processed interrupts:%10ld\n", queue_counter, int_counter); len += size; pos = begin + len; size = sprintf(buffer + len, "\nscsi%-2d: HBA %.10s\n", shost->host_no, SD(shost)->name); len += size; pos = begin + len; size = sprintf(buffer + len, "Firmware revision: v%s\n", SD(shost)->revision); len += size; pos = begin + len; size = sprintf(buffer + len, "IO: PIO\n"); len += size; pos = begin + len; size = sprintf(buffer + len, "Base IO : %#.4x\n", (u32) shost->base); len += size; pos = begin + len; size = sprintf(buffer + len, "Host Bus: %s\n", (SD(shost)->bustype == 'P')?"PCI ": (SD(shost)->bustype == 'E')?"EISA":"ISA "); len += size; pos = begin + len; if (pos < offset) { len = 0; begin = pos; } if (pos > offset + length) goto stop_output; stop_output: DBG(DBG_PROC, printk("2pos: %ld offset: %ld len: %d\n", pos, offset, len)); *start=buffer+(offset-begin); /* Start of wanted data */ len-=(offset-begin); /* Start slop */ if(len>length) len = length; /* Ending slop */ DBG(DBG_PROC, printk("3pos: %ld offset: %ld len: %d\n", pos, offset, len)); return (len); }
VOID FatSwapFatXDirEntry(PFATX_DIRENTRY Obj) { SD(Obj, StartCluster); SD(Obj, Size); SW(Obj, Time); SW(Obj, Date); SW(Obj, CreateTime); SW(Obj, CreateDate); SW(Obj, LastAccessTime); SW(Obj, LastAccessDate); }
static void mbloop_filter_horizontal_edge_uv_msa(uint8_t *src_u, uint8_t *src_v, int32_t pitch, const uint8_t b_limit_in, const uint8_t limit_in, const uint8_t thresh_in) { uint8_t *temp_src; uint64_t p2_d, p1_d, p0_d, q0_d, q1_d, q2_d; v16u8 p3, p2, p1, p0, q3, q2, q1, q0; v16u8 mask, hev, flat, thresh, limit, b_limit; v16u8 p3_u, p2_u, p1_u, p0_u, q3_u, q2_u, q1_u, q0_u; v16u8 p3_v, p2_v, p1_v, p0_v, q3_v, q2_v, q1_v, q0_v; b_limit = (v16u8)__msa_fill_b(b_limit_in); limit = (v16u8)__msa_fill_b(limit_in); thresh = (v16u8)__msa_fill_b(thresh_in); temp_src = src_u - (pitch << 2); LD_UB8(temp_src, pitch, p3_u, p2_u, p1_u, p0_u, q0_u, q1_u, q2_u, q3_u); temp_src = src_v - (pitch << 2); LD_UB8(temp_src, pitch, p3_v, p2_v, p1_v, p0_v, q0_v, q1_v, q2_v, q3_v); ILVR_D4_UB(p3_v, p3_u, p2_v, p2_u, p1_v, p1_u, p0_v, p0_u, p3, p2, p1, p0); ILVR_D4_UB(q0_v, q0_u, q1_v, q1_u, q2_v, q2_u, q3_v, q3_u, q0, q1, q2, q3); LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh, hev, mask, flat); VP8_MBFILTER(p2, p1, p0, q0, q1, q2, mask, hev); p2_d = __msa_copy_u_d((v2i64)p2, 0); p1_d = __msa_copy_u_d((v2i64)p1, 0); p0_d = __msa_copy_u_d((v2i64)p0, 0); q0_d = __msa_copy_u_d((v2i64)q0, 0); q1_d = __msa_copy_u_d((v2i64)q1, 0); q2_d = __msa_copy_u_d((v2i64)q2, 0); src_u -= (pitch * 3); SD4(p2_d, p1_d, p0_d, q0_d, src_u, pitch); src_u += 4 * pitch; SD(q1_d, src_u); src_u += pitch; SD(q2_d, src_u); p2_d = __msa_copy_u_d((v2i64)p2, 1); p1_d = __msa_copy_u_d((v2i64)p1, 1); p0_d = __msa_copy_u_d((v2i64)p0, 1); q0_d = __msa_copy_u_d((v2i64)q0, 1); q1_d = __msa_copy_u_d((v2i64)q1, 1); q2_d = __msa_copy_u_d((v2i64)q2, 1); src_v -= (pitch * 3); SD4(p2_d, p1_d, p0_d, q0_d, src_v, pitch); src_v += 4 * pitch; SD(q1_d, src_v); src_v += pitch; SD(q2_d, src_v); }
//等效标准天数(Equivalent Standard Days)(y年m月d日距该历制的1年1月0日的天数) int ESD(int y,int m,int d,int calType) { if(ifGr(y,m,d,calType)==-1) return Infinity; if(ifGr(y,m,d,calType)==1) return SD(y,m,d,calType); //Gregorian的标准天数 else return SD(y,m,d,calType)-2; //Julian的标准天数 }
void ff_vp8_v_loop_filter8uv_msa(uint8_t *src_u, uint8_t *src_v, ptrdiff_t pitch, int b_limit_in, int limit_in, int thresh_in) { uint8_t *temp_src; uint64_t p2_d, p1_d, p0_d, q0_d, q1_d, q2_d; v16u8 p3, p2, p1, p0, q3, q2, q1, q0; v16u8 mask, hev, flat, thresh, limit, b_limit; v16u8 p3_u, p2_u, p1_u, p0_u, q3_u, q2_u, q1_u, q0_u; v16u8 p3_v, p2_v, p1_v, p0_v, q3_v, q2_v, q1_v, q0_v; b_limit = (v16u8) __msa_fill_b(b_limit_in); limit = (v16u8) __msa_fill_b(limit_in); thresh = (v16u8) __msa_fill_b(thresh_in); temp_src = src_u - (pitch << 2); LD_UB8(temp_src, pitch, p3_u, p2_u, p1_u, p0_u, q0_u, q1_u, q2_u, q3_u); temp_src = src_v - (pitch << 2); LD_UB8(temp_src, pitch, p3_v, p2_v, p1_v, p0_v, q0_v, q1_v, q2_v, q3_v); /* rht 8 element of p3 are u pixel and left 8 element of p3 are v pixel */ ILVR_D4_UB(p3_v, p3_u, p2_v, p2_u, p1_v, p1_u, p0_v, p0_u, p3, p2, p1, p0); ILVR_D4_UB(q0_v, q0_u, q1_v, q1_u, q2_v, q2_u, q3_v, q3_u, q0, q1, q2, q3); LPF_MASK_HEV(p3, p2, p1, p0, q0, q1, q2, q3, limit, b_limit, thresh, hev, mask, flat); VP8_MBFILTER(p2, p1, p0, q0, q1, q2, mask, hev); p2_d = __msa_copy_u_d((v2i64) p2, 0); p1_d = __msa_copy_u_d((v2i64) p1, 0); p0_d = __msa_copy_u_d((v2i64) p0, 0); q0_d = __msa_copy_u_d((v2i64) q0, 0); q1_d = __msa_copy_u_d((v2i64) q1, 0); q2_d = __msa_copy_u_d((v2i64) q2, 0); src_u -= (pitch * 3); SD4(p2_d, p1_d, p0_d, q0_d, src_u, pitch); src_u += 4 * pitch; SD(q1_d, src_u); src_u += pitch; SD(q2_d, src_u); p2_d = __msa_copy_u_d((v2i64) p2, 1); p1_d = __msa_copy_u_d((v2i64) p1, 1); p0_d = __msa_copy_u_d((v2i64) p0, 1); q0_d = __msa_copy_u_d((v2i64) q0, 1); q1_d = __msa_copy_u_d((v2i64) q1, 1); q2_d = __msa_copy_u_d((v2i64) q2, 1); src_v -= (pitch * 3); SD4(p2_d, p1_d, p0_d, q0_d, src_v, pitch); src_v += 4 * pitch; SD(q1_d, src_v); src_v += pitch; SD(q2_d, src_v); }
void control(SD(sd), const Signals& OpCode, const Signals& Out) { Signal bits(WORDSIZE, "ROM Output"); loadRom(controlRom, ROMSIZE * WORDSIZE, "controlUnitRom.txt"); Rom(SD(sd, "1a"), OpCode, bits, ROMSIZE, WORDSIZE, controlRom); for (int ndx = 0; ndx < NUM_BITS; ++ndx) Or(SD(sd, "1a"), (bits[ndx], Zero), Out[ndx]); }
VOID FatSwapFatBootSector(PFAT_BOOTSECTOR Obj) { SW(Obj, BytesPerSector); SW(Obj, ReservedSectors); SW(Obj, RootDirEntries); SW(Obj, TotalSectors); SW(Obj, SectorsPerFat); SW(Obj, SectorsPerTrack); SW(Obj, NumberOfHeads); SD(Obj, HiddenSectors); SD(Obj, TotalSectorsBig); SD(Obj, VolumeSerialNumber); SW(Obj, BootSectorMagic); }
static int eata_pio_release(struct Scsi_Host *sh) { hostdata *hd = SD(sh); if (sh->irq && reg_IRQ[sh->irq] == 1) free_irq(sh->irq, NULL); else reg_IRQ[sh->irq]--; if (SD(sh)->channel == 0) { if (sh->io_port && sh->n_io_port) release_region(sh->io_port, sh->n_io_port); } /* At this point the PCI reference can go */ if (hd->pdev) pci_dev_put(hd->pdev); return 1; }
void simnet() { Signal muxIn(4); Signal muxOut(1, "muxOut"); Signal select(2); Space(SD("1b", "Note input/select line order: Incorrect order is a common mistake!")); // Input lines Switch("1a", muxIn[3], '3'); Space(SD("1a", "input[3]")); Switch("1a", muxIn[2], '2'); Space(SD("1a", "input[2]")); Switch("1a", muxIn[1], '1'); Space(SD("1a", "input[1]")); Switch("1a", muxIn[0], '0'); Space(SD("1a", "input[0]")); // Select lines Switch("2b.1a", select[1], 'a'); Space(SD("2b.2a", "select[1]")); Switch("2b.1b", select[0], 'b'); Space(SD("2b.2b", "select[0]")); // select and muxIn are specified in MSB down to LSB order Mux("1b", select, muxIn, muxOut); Probe("1c", muxOut); }
VOID FatSwapFat32BootSector(PFAT32_BOOTSECTOR Obj) { SW(Obj, BytesPerSector); SW(Obj, ReservedSectors); SW(Obj, RootDirEntries); SW(Obj, TotalSectors); SW(Obj, SectorsPerFat); SW(Obj, NumberOfHeads); SD(Obj, HiddenSectors); SD(Obj, TotalSectorsBig); SD(Obj, SectorsPerFatBig); SW(Obj, ExtendedFlags); SW(Obj, FileSystemVersion); SD(Obj, RootDirStartCluster); SW(Obj, FsInfo); SW(Obj, BackupBootSector); SD(Obj, VolumeSerialNumber); SW(Obj, BootSectorMagic); }
int eata_pio_release(struct Scsi_Host *sh) { if (sh->irq && reg_IRQ[sh->irq] == 1) free_irq(sh->irq, NULL); else reg_IRQ[sh->irq]--; if (SD(sh)->channel == 0) { if (sh->io_port && sh->n_io_port) release_region(sh->io_port, sh->n_io_port); } return(TRUE); }
VOID FatSwapDirEntry(PDIRENTRY Obj) { SW(Obj, CreateTime); SW(Obj, CreateDate); SW(Obj, LastAccessDate); SW(Obj, ClusterHigh); SW(Obj, Time); SW(Obj, Date); SW(Obj, ClusterLow); SD(Obj, Size); }
void simnet() { Signal Strobe (1); // Counter strobe input Signal ResetA (1); // Counter reset signal (before complemented) Signal ResetB (1); // Counter reset signal (after complemented) Signal Output (4); // Counter output // A pulser is used to generate a temporary value of "One" on a specified // signal line (signal value: Zero ==> One ==> Zero) Pulser ((SD("1a"), "r -- Reset counter"), ResetA, 'r', 10000); Pulser ((SD("2a"), "s -- Strobe counter"), Strobe, 's', 10000); // Complement the reset signal (counter reset is active low) Not (SD("1b"), ResetA, ResetB); Counter ((SD("1c-2c"), "4-bit counter"), (ResetB, Strobe), Output); Probe ((SD("1d-2d"), "Output"), Output); }
void fullAdder(SD(sd), // Inputs: const Signal& A, const Signal& B, const Signal& Cin, // Outputs: const Signal& Sum, const Signal& Cout) { // This is a Module constructor. // The first argument is the display name for the module. // The second argument lists all of the input Signals. // The third argument lists all of the output Signals. // If fullAdder() is called directly by simnet(), this will put a "black box" // named "Full Adder" with three input leads and two output leads in the // simulation window. Module((sd, "Full Adder"), (A, B, Cin), (Sum, Cout) ); // Intermediate signals Signal AxorB; Signal AandB; Signal CandAxorB; // Because these components are inside a Module, they will not be visible in // the simulation. Xor(SD(sd, "1b"), (A, B), AxorB); And(SD(sd, "1b"), (A, B), AandB); And(SD(sd, "1b"), (AxorB, Cin), CandAxorB); Or (SD(sd, "1b"), (AandB, CandAxorB), Cout); Xor(SD(sd, "1b"), (Cin, AxorB), Sum); }
void METHOD(INTELI2C, Hidd_I2C, GetBits) { struct g45staticdata *sd = SD(cl); uint32_t val; /* release SCL and SDA lines */ // writel(/*G45_GPIO_CLOCK_DIR_MASK |*/ G45_GPIO_DATA_DIR_MASK, sd->Card.MMIO + G45_GPIOA); // writel(0, sd->Card.MMIO + G45_GPIOA); val = readl(sd->Card.MMIO + sd->DDCPort); //D(bug("[GMA_I2C] Get: %08x <- %08x\n", val, sd->Card.MMIO + G45_GPIOA)); *msg->scl = (val & G45_GPIO_CLOCK_DATA_IN) != 0; *msg->sda = (val & G45_GPIO_DATA_IN) != 0; }
inline vec3f HeterogeneousVolume::lookUpSubSurfaceVolumeData(const vec3f &worldPos, LOOK_UP_TYPE type) const{ if(!checkIn(worldPos, objID)) return vec3f(0.f); mat4f inverseTransform = inverse(this->transform); const vec3f localPos = vec3f(inverseTransform * vec4f(worldPos, 1)); if(localPos.x > mBBox.p1.x || localPos.x < mBBox.p0.x || localPos.y > mBBox.p1.y || localPos.y < mBBox.p0.y || localPos.z > mBBox.p1.z || localPos.z < mBBox.p0.z) { return vec3f(0.f); } float boundX = mBBox.p1.x - mBBox.p0.x, boundY = mBBox.p1.y - mBBox.p0.y, boundZ = mBBox.p1.z - mBBox.p0.z; float pToMinX = localPos.x - mBBox.p0.x, pToMinY = localPos.y - mBBox.p0.y, pToMinZ = localPos.z - mBBox.p0.z; int indexX = std::floor(mBBox.nx * pToMinX/boundX), indexY = std::floor(mBBox.ny * pToMinY/boundY), indexZ = std::floor(mBBox.nz * pToMinZ/boundZ); if(indexX < 0 || indexX >= mBBox.nx || indexY < 0 || indexY >= mBBox.ny || indexZ < 0 || indexZ >= mBBox.nz) { return vec3f(0.f); } float dx = mBBox.nx * pToMinX/boundX - indexX, dy = mBBox.ny * pToMinY/boundY - indexY, dz = mBBox.nz * pToMinZ/boundZ - indexZ; // Trilinearly interpolate density values to compute local density vec3f sd00 = Lerp(dx, SD(indexX, indexY, indexZ, type), SD(indexX+1, indexY, indexZ, type)); vec3f sd10 = Lerp(dx, SD(indexX, indexY+1, indexZ, type), SD(indexX+1, indexY+1, indexZ, type)); vec3f sd01 = Lerp(dx, SD(indexX, indexY, indexZ+1, type), SD(indexX+1, indexY, indexZ+1, type)); vec3f sd11 = Lerp(dx, SD(indexX, indexY+1, indexZ+1, type), SD(indexX+1, indexY+1, indexZ+1, type)); vec3f sd0 = Lerp(dy, sd00, sd10); vec3f sd1 = Lerp(dy, sd01, sd11); return Lerp(dz, sd0, sd1); }
void simnet() { Signal a, b, c, d, F; // Switch and output objects Switch ( SD("1a"), a, 'a' ); // Switch a controlled by 'a' key Switch ( SD("2a"), b, 'b' ); // Switch b controlled by 'b' key Switch ( SD("3a"), c, 'c' ); // Switch c controlled by 'c' key Switch ( SD("4a"), d, 'd' ); // Switch d controlled by 'd' key circuit( SD("1c-4c"), a, b, c, d, F ); Probe ( (SD("2e"), "F"), F ); // Probe }
void simnet() { Signal Init, Clock, w, x, y, z; // Insert your Pulsers here Pulser ((SD("2a"), "i -- Initialization"), Init, 'i', 10000); Pulser ((SD("3a"), "c -- Clock"), Clock, 'c', 10000); circuits( SD("1b-4b"), Init, Clock, w, x, y, z ); // Insert your Probes here Probe ((SD("1c"), "w"), w); Probe ((SD("2c"), "x"), x); Probe ((SD("3c"), "y"), y); Probe ((SD("4c"), "z"), z); }
void simnet() { // Input and output signals and buses Signal A(8); Signal B(8); Signal Sum(8, "Sum"); Signal Carry(1, "C"); Signal Overflow(1, "V"); // A bus input switches Switch("1a", A[7], '7'); Switch("1a", A[6], '6'); Switch("1a", A[5], '5'); Switch("1a", A[4], '4'); Switch("1a", A[3], '3'); Switch("1a", A[2], '2'); Switch("1a", A[1], '1'); Switch("1a", A[0], '0'); Space(SD("1a", "A Bus")); // B bus input switches Switch("3a", B[7], '&'); Switch("3a", B[6], '^'); Switch("3a", B[5], '%'); Switch("3a", B[4], '$'); Switch("3a", B[3], '#'); Switch("3a", B[2], '@'); Switch("3a", B[1], '!'); Switch("3a", B[0], ')'); Space(SD("3a", "B Bus")); Add8("2b", //inputs: A, B, //outputs: Sum, Carry, Overflow ); int parts[] = {4}; Probe("1c-2c.1a", Sum, 1, parts ); Space(SD("3c", "Sum")); Space(SD("3b")); Probe("3b", Overflow); Space(SD("3b", "Overflow")); Probe("3c", Carry); Space(SD("3c", "Carry")); }
/** @brief 説明、引数、戻り値はMonapi2リファレンス参照。 @date 2005/08/20 junjunn 作成 */ void IniManager::toString(String* pstrOut) { pstrOut->empty(); int iCount=m_strstrmap.getCount(); if (iCount==0) return; //ソートするため配列に置き換える CDirKeyValue* paDKV=new CDirKeyValue[iCount]; int i=0; mapposition pos = m_strstrmap.getStartPosition(); String strKey,strValue; while(pos) { m_strstrmap.getNext(&pos,&strKey,&strValue); StringDivide SD(strKey,"/"); paDKV[i].m_strDir=SD.getAt(0); paDKV[i].m_strKey=SD.getAt(1); paDKV[i].m_strValue=strValue; i++; } //ソート quicksort(paDKV,iCount,sizeof(CDirKeyValue),compareDirKeyValue); //文字列に出力 String strLine; cpchar1 cszLastDir=""; for (i=0;i<iCount;i++) { //新しいディレクトリになったらディレクトリセクションを挿入。 if (! StringFn::isEqual(cszLastDir,paDKV[i].m_strDir)) { strLine.format("[%s]\n",paDKV[i].m_strDir.getString()); *pstrOut+=strLine; cszLastDir = paDKV[i].m_strDir; } strLine.format("%s=%s\n",paDKV[i].m_strKey.getString(),paDKV[i].m_strValue.getString()); *pstrOut+=strLine; } delete[] paDKV; }
void simnet() { Signal Init, Clock, w, x, y, z; // Insert your Pulsers here // A pulser is used to generate a temporary value of "One" on a specified // signal line (signal value: Zero ==> One ==> Zero) Pulser ((SD("ba"), "v -- Init"), ResetA, 'v', 10001); Pulser ((SD("ca"), "c -- Clock"), clock_Strobe, 'c', 10000); circuits( SD("1b-4b"), Init, Clock, w, x, y, z ); // Insert your Probes here Probe ((SD("bh"), "w"), w_probe); Probe ((SD("ch"), "x"), x_probe); Probe ((SD("dh"), "y"), y_probe); Probe ((SD("eh"), "z"), z_probe); }
void simnet() { Signal Init, Clock, w, x, y, z; Pulser ((SD("1a"), "Init"), Init, 'i', 1000); Pulser ((SD("4a"), "Clock"), Clock, 'c', 1000); // Insert your Pulsers here circuits( SD("1b-4b"), Init, Clock, w, x, y, z); Probe ( (SD("1e-1f"), "w"), w); Probe ( (SD("2e-2f"), "x"), x); Probe ( (SD("3e-3f"), "y"), y); Probe ( (SD("4e-4f"), "z"), z); // Insert your Probes here }
void circuit( SD sd, Signal a, Signal b, Signal c, Signal d, Signal F ) { Module( (sd, "circuit"), (a, b, c, d), (F) ); Signal notb, notc, notd; Signal and1, and2; // Intermediate objects Not ( SD(sd,"2a"), b, notb ); // NOT gates Not ( SD(sd,"3a"), c, notc ); Not ( SD(sd,"4a"), d, notd ); And ( SD(sd,"2c"), (a, notb), and1 ); // AND gates And ( SD(sd,"3c"), (b, notc, notd), and2 ); Or ( SD(sd,"2e"), (and1, and2), F ); // OR gate }
bool TraceSD( const PSECURITY_DESCRIPTOR pSD ) { CSecurityDesc SD(*reinterpret_cast<SECURITY_DESCRIPTOR *>(pSD )); CDacl Dacl; bool bDaclPresent = false; if(!SD.GetDacl(&Dacl, &bDaclPresent)) { wprintf(L"Error: SD.GetDacl() 0X%08x\n", GetLastError()); return false; } if(!bDaclPresent) { wprintf(L"DACL отсутствует в SD\n"); return false; } // Получаем АСЕ CSid::CSidArray daclSids; CAcl::CAccessMaskArray daclAccessMasks; CAcl::CAceTypeArray daclTypes; CAcl::CAceFlagArray daclFlags; Dacl.GetAclEntries(&daclSids, &daclAccessMasks, &daclTypes, &daclFlags); // Ищем разрешение для пользователя for(size_t i = 0; i < daclTypes.GetCount(); ++i) { TraceAceType(daclTypes[i]); TraceAceSid(daclSids[i]); wprintf(L"Access mask: %08X\n", daclAccessMasks[i]); wprintf(L"Flag: %08X\n", daclFlags[i]); wprintf(L"\n\n"); } return true; }
void simnet() { Signal Init, Clock, w, x, y, z; // Insert your Pulsers here Pulser ((SD("1a"), "c - Clock"), Clock, 'c', 10000); Pulser ((SD("2a"), "i - Init"), Init, 'i', 10000); circuits( SD("5b-8b"), Init, Clock, w, x, y, z ); // Insert your Probes here Probe ((SD("2d"), "w"), w); Probe ((SD("3d"), "x"), x); Probe ((SD("4d"), "y"), y); Probe ((SD("5d"), "z"), z); }
void METHOD(INTELI2C, Hidd_I2C, PutBits) { struct g45staticdata *sd = SD(cl); uint32_t val = 0; #if 0 /* SCL as output */ val = G45_GPIO_CLOCK_DIR_MASK | G45_GPIO_CLOCK_DIR_VAL; /* update SCL value */ val |= G45_GPIO_CLOCK_DATA_MASK; /* SDA as output */ val |= G45_GPIO_DATA_DIR_MASK | G45_GPIO_DATA_DIR_VAL; /* update SDA value */ val |= G45_GPIO_DATA_MASK; /* set SCL */ if (msg->scl) val |= G45_GPIO_CLOCK_DATA_VAL; if (msg->sda) val |= G45_GPIO_DATA_VAL; #endif if (msg->scl) val |= G45_GPIO_CLOCK_DIR_MASK; else val |= G45_GPIO_CLOCK_DIR_MASK | G45_GPIO_CLOCK_DIR_VAL | G45_GPIO_CLOCK_DATA_MASK; if (msg->sda) val |= G45_GPIO_DATA_DIR_MASK; else val |= G45_GPIO_DATA_DIR_MASK | G45_GPIO_DATA_DIR_VAL | G45_GPIO_DATA_MASK; //D(bug("[GMA_I2C] Put: %08x -> %08x\n", val, sd->Card.MMIO + G45_GPIOA)); writel(val, sd->Card.MMIO + sd->DDCPort); val = readl(sd->Card.MMIO + sd->DDCPort); }
double SizeCalculator::consection_x(double y, double z) { DEBUG_START; int i; double x; bool ifConsect; SortedDouble SD(20); for (i = 0; i < polyhedron->numVertices; ++i) { ifConsect = polyhedron->facets[i].consect_x(y, z, x); if (ifConsect == true) { DEBUG_PRINT("SD.add(%lf) y = %lf, z = %lf\n", x, y, z); SD.add(x); } } DEBUG_END; return SD.calclulate(); }
static irqreturn_t eata_pio_int_handler(int irq, void *dev_id) { unsigned int eata_stat = 0xfffff; struct scsi_cmnd *cmd; hostdata *hd; struct eata_ccb *cp; unsigned long base; unsigned int x, z; struct Scsi_Host *sh; unsigned short zwickel = 0; unsigned char stat, odd; irqreturn_t ret = IRQ_NONE; for (x = 1, sh = first_HBA; x <= registered_HBAs; x++, sh = SD(sh)->prev) { if (sh->irq != irq) continue; if (inb(sh->base + HA_RSTATUS) & HA_SBUSY) continue; int_counter++; ret = IRQ_HANDLED; hd = SD(sh); cp = &hd->ccb[0]; cmd = cp->cmd; base = cmd->device->host->base; do { stat = inb(base + HA_RSTATUS); if (stat & HA_SDRQ) { if (cp->DataIn) { z = 256; odd = 0; while ((cmd->SCp.Status) && ((z > 0) || (odd))) { if (odd) { *(cmd->SCp.ptr) = zwickel >> 8; IncStat(&cmd->SCp, 1); odd = 0; } x = min_t(unsigned int, z, cmd->SCp.this_residual / 2); insw(base + HA_RDATA, cmd->SCp.ptr, x); z -= x; IncStat(&cmd->SCp, 2 * x); if ((z > 0) && (cmd->SCp.this_residual == 1)) { zwickel = inw(base + HA_RDATA); *(cmd->SCp.ptr) = zwickel & 0xff; IncStat(&cmd->SCp, 1); z--; odd = 1; } } while (z > 0) { zwickel = inw(base + HA_RDATA); z--; } } else { /* cp->DataOut */ odd = 0; z = 256; while ((cmd->SCp.Status) && ((z > 0) || (odd))) { if (odd) { zwickel += *(cmd->SCp.ptr) << 8; IncStat(&cmd->SCp, 1); outw(zwickel, base + HA_RDATA); z--; odd = 0; } x = min_t(unsigned int, z, cmd->SCp.this_residual / 2); outsw(base + HA_RDATA, cmd->SCp.ptr, x); z -= x; IncStat(&cmd->SCp, 2 * x); if ((z > 0) && (cmd->SCp.this_residual == 1)) { zwickel = *(cmd->SCp.ptr); zwickel &= 0xff; IncStat(&cmd->SCp, 1); odd = 1; } } while (z > 0 || odd) { outw(zwickel, base + HA_RDATA); z--; odd = 0; } } } }
void eata_pio_int_handler(int irq, void *dev_id, struct pt_regs * regs) { uint eata_stat = 0xfffff; Scsi_Cmnd *cmd; hostdata *hd; struct eata_ccb *cp; uint base; ulong flags; uint x,z; struct Scsi_Host *sh; ushort zwickel=0; unchar stat,odd; save_flags(flags); cli(); for (x = 1, sh = first_HBA; x <= registered_HBAs; x++, sh = SD(sh)->prev) { if (sh->irq != irq) continue; if (inb((uint)sh->base + HA_RSTATUS) & HA_SBUSY) continue; int_counter++; hd=SD(sh); cp = &hd->ccb[0]; cmd = cp->cmd; base = (uint) cmd->host->base; do { stat=inb(base+HA_RSTATUS); if (stat&HA_SDRQ) { if (cp->DataIn) { z=256; odd=FALSE; while ((cmd->SCp.Status)&&((z>0)||(odd))) { if (odd) { *(cmd->SCp.ptr)=zwickel>>8; IncStat(&cmd->SCp,1); odd=FALSE; } x=min(z,cmd->SCp.this_residual/2); insw(base+HA_RDATA,cmd->SCp.ptr,x); z-=x; IncStat(&cmd->SCp,2*x); if ((z>0)&&(cmd->SCp.this_residual==1)) { zwickel=inw(base+HA_RDATA); *(cmd->SCp.ptr)=zwickel&0xff; IncStat(&cmd->SCp,1); z--; odd=TRUE; } } while (z>0) { zwickel=inw(base+HA_RDATA); z--; } } else /* cp->DataOut */ { odd=FALSE; z=256; while ((cmd->SCp.Status)&&((z>0)||(odd))) { if (odd) { zwickel+=*(cmd->SCp.ptr)<<8; IncStat(&cmd->SCp,1); outw(zwickel,base+HA_RDATA); z--; odd=FALSE; } x=min(z,cmd->SCp.this_residual/2); outsw(base+HA_RDATA,cmd->SCp.ptr,x); z-=x; IncStat(&cmd->SCp,2*x); if ((z>0)&&(cmd->SCp.this_residual==1)) { zwickel=*(cmd->SCp.ptr); zwickel&=0xff; IncStat(&cmd->SCp,1); odd=TRUE; } } while (z>0||odd) { outw(zwickel,base+HA_RDATA); z--; odd=FALSE; } } } }