From 468e8b4fb6a3775e0917f4603e9eb4aec6c1aaad Mon Sep 17 00:00:00 2001 From: AceVest Date: Tue, 8 Dec 2015 20:30:52 +0800 Subject: [PATCH] learn go --- ish/Cmd.cc | 1 + ish/Common.cc | 2 +- ish/Parser.cc | 2 ++ ish/Scanner.cc | 1 + learn/doc/ir.txt | 7 ----- learn/doc/linux | 11 -------- learn/doc/mac | 13 ---------- learn/go/interfaces.go | 47 ++++++++++++++++++++++++++++++++++ learn/go/methods.go | 1 + learn/go/struct.go | 26 ++++++++++++++++--- learn/server/.Building.lock | 0 learn/server/.sconsign.dblite | Bin 3979 -> 0 bytes learn/server/BLADE_ROOT | 0 learn/server/BUILD | 6 ----- learn/server/config.h | 10 -------- learn/server/server.cpp | 16 ------------ tools/comm/cpuid.cc | 42 +++++++++++++++++++++++++----- 17 files changed, 112 insertions(+), 73 deletions(-) delete mode 100644 learn/doc/ir.txt delete mode 100644 learn/doc/linux delete mode 100644 learn/server/.Building.lock delete mode 100644 learn/server/.sconsign.dblite delete mode 100644 learn/server/BLADE_ROOT delete mode 100644 learn/server/BUILD delete mode 100644 learn/server/config.h delete mode 100644 learn/server/server.cpp diff --git a/ish/Cmd.cc b/ish/Cmd.cc index 1f4f481..eb3355f 100644 --- a/ish/Cmd.cc +++ b/ish/Cmd.cc @@ -166,6 +166,7 @@ ExitCode cmd::ExecuteCommand(char **argv) //} + return 0; } #ifdef DEBUG_CMD diff --git a/ish/Common.cc b/ish/Common.cc index b6384d4..bb7ee73 100644 --- a/ish/Common.cc +++ b/ish/Common.cc @@ -4,7 +4,7 @@ void fatal(const char *err_msg, int n) { - fprintf(stderr,"Error: %s,%s\n",err_msg); + fprintf(stderr,"Error: %s\n",err_msg); exit(n); } void *my_malloc(size_t size) diff --git a/ish/Parser.cc b/ish/Parser.cc index 58266c1..2b300aa 100644 --- a/ish/Parser.cc +++ b/ish/Parser.cc @@ -244,7 +244,9 @@ ExitCode Parser::ExecuteCmd() g_redirectInFlag = g_redirectOutFlag = false; + return 0; } + ExitCode Parser::Exp() { /*if(m_token != STRING && m_token != GETVAR) diff --git a/ish/Scanner.cc b/ish/Scanner.cc index bcd6c51..b56fca1 100644 --- a/ish/Scanner.cc +++ b/ish/Scanner.cc @@ -275,6 +275,7 @@ void Scanner::printToken(TokenType t) const case GE: cout<<"GE"<g!73OBZ0wFF2Y%n0(TJOXdp}Egwlk8$G*a!qRs4JVKrc~WM-SoJy#L;D| zHdRxV-;u}sioEPoensB$kROnru+?)BBVa=wcB`^4s@BZ(oUhOMzH`0_VN^k*=)$rGD`<*f+Uo`vuzG^>gU!+X#~wUEGwIvqjx`U~`=n1$uFE>#vQC*^U5PP8 zjK_GMhOnUsnIn2(Ve=;aw>&6j zsQfI1=ZcuE1^-bR5u;`19PV1GN`03YjN86VDYr~)xT;fenM>h?DAeEEeS*=1)ESh} zm!96lSC zTQhu>R(!6)D^aMEu|C1KWR?-x zb_lPBMYa<{ITd#lFE7$J2}ur-)PFaGiXx@G>WR2kV%-B(Y@CQK4>a-81O2~r6(a<5 zIItChod%A(3Mx9-wtP*~eVdxxaBa)948{mob=|Ev6%!m$h?kv_qqgnFgp!;_<|0-_5k<(p^k_Zsg8gfEtw z$A@peK0HhBA0NI+mj`Ei_5I(Uo*l(IuK%AGOM`po(bI4$i}^ltjt?Q6$#cj#oJs{V zs%y;R4rMOmmd|vCP1WL>RFU>~CUo6Q4t@Wc|&P#NYJGXgVEojlYdXCIgMjX*c%c zG#bCp*-qT)Y#&HxI~l^%z}ZfV!K?0ewhu+LDHp=b4QDGWli^i98j%T&=KhBvSxAU9 zAC1bCMhkZX%DCXg7|~J)kFqpc9-`4omPV_0&?s`b0~fq@%LPYHV#oz=c(5tS)Ggn3 zF`3TX_-EV=(CoEYF1LSi#f(2wBCj}y?ro5nV#-GO6BH9xvR@mpI%Ex_;{DjLTg#fn z^*c)c)Ps%d(r==oi*@eWj^jA0W|+*tj$!*1PPIzK@-6Pd)=iUG^x&BoS45(Y=OMgM uL_Y2rvVF|m-#5g3IvamplX#6XHi`MzJ0&RZ^-r(FeB_@Zlh`fy%Rc}}G1wdc diff --git a/learn/server/BLADE_ROOT b/learn/server/BLADE_ROOT deleted file mode 100644 index e69de29..0000000 diff --git a/learn/server/BUILD b/learn/server/BUILD deleted file mode 100644 index 84769a6..0000000 --- a/learn/server/BUILD +++ /dev/null @@ -1,6 +0,0 @@ -cc_binary( - name = 'server', - srcs = [ - 'server.cpp', - ], -) diff --git a/learn/server/config.h b/learn/server/config.h deleted file mode 100644 index 4c67455..0000000 --- a/learn/server/config.h +++ /dev/null @@ -1,10 +0,0 @@ -/* - * ------------------------------------------------------------------------ - * File Name: config.h - * Author: Zhao Yanbai - * Tue May 12 15:31:22 2015 - * Description: none - * ------------------------------------------------------------------------ - */ - -#pragma once diff --git a/learn/server/server.cpp b/learn/server/server.cpp deleted file mode 100644 index 15547bb..0000000 --- a/learn/server/server.cpp +++ /dev/null @@ -1,16 +0,0 @@ -/* - * ------------------------------------------------------------------------ - * File Name: server.cpp - * Author: Zhao Yanbai - * Tue May 12 15:30:58 2015 - * Description: none - * ------------------------------------------------------------------------ - */ -#include -using namespace std; - -int main(int argc, char *argv[]) { - - cout << "Server is Starting ... " << endl; - return 0; -} diff --git a/tools/comm/cpuid.cc b/tools/comm/cpuid.cc index 77bae5c..9ba8ae7 100644 --- a/tools/comm/cpuid.cc +++ b/tools/comm/cpuid.cc @@ -108,17 +108,47 @@ int main() "CR4.OSFXSR is available)") TEST_FEATURE(fv, 25, "SSE: SSE Extensions") TEST_FEATURE(fv, 26, "SSE2: SSE2 Extensions") - //TEST_FEATURE(fv, 27, "Reserved") + TEST_FEATURE(fv, 27, "SS: CPU Cache Supports Self-Snoop") TEST_FEATURE(fv, 28, "Hyper Threading Technology") TEST_FEATURE(fv, 29, "TM: Thermal Monitor") - //TEST_FEATURE(fv, 30, "Reserved") + TEST_FEATURE(fv, 30, "IA64 Processor Emulating X86") TEST_FEATURE(fv, 31, "PBE: Pending Break Enable") - - - - + fv = r.ecx; + printf("-------------\n"); + TEST_FEATURE(fv, 0, "SSE3: Prescott New Instructions-SSE3 (PNI)") + TEST_FEATURE(fv, 1, "PCLMULQDQ Support") + TEST_FEATURE(fv, 2, "64Bit Debug Store (EDX Bit21)") + TEST_FEATURE(fv, 3, "MONITOR and MWAIT Instructions (SSE3)") + TEST_FEATURE(fv, 4, "CPL Qualified Debug Store") + TEST_FEATURE(fv, 5, "VMX: Virtual Machine eXtensions") + TEST_FEATURE(fv, 6, "SMX: Safer Mode Extensions") + TEST_FEATURE(fv, 7, "EST: Enhanced SpeedStep") + TEST_FEATURE(fv, 8, "TM2: Thermal Monitor 2") + TEST_FEATURE(fv, 9, "SSSE3: Supplemental SSE3 Instructions") + TEST_FEATURE(fv, 10, "L1 Context ID") + TEST_FEATURE(fv, 11, "SDBG: Silicon Debug Interface") + TEST_FEATURE(fv, 12, "FMA: Fused Multiply-add (FMA3)") + TEST_FEATURE(fv, 13, "CX16: CMPXCHG16B Instructions") + TEST_FEATURE(fv, 14, "XTPR: Can Disable Sending Task Priority Messages") + TEST_FEATURE(fv, 15, "PDCM: Perfmon & Debug Capability") + //TEST_FEATURE(fv, 16, "Reserved") + TEST_FEATURE(fv, 17, "PCID: Process Context Identifiers (CR4 bit 17)") + TEST_FEATURE(fv, 18, "DCA: Direct Cache Access for DMA Writes") + TEST_FEATURE(fv, 19, "SSE4.1: SSE4.1 Instructions") + TEST_FEATURE(fv, 20, "SSE4.2: SSE4.2 Instructions") + TEST_FEATURE(fv, 21, "X2APIC: x2APIC Support") + TEST_FEATURE(fv, 22, "MOVBE: MOVBE Instruction (big-endian)") + TEST_FEATURE(fv, 23, "POPCNT: POPCNT Instruction") + TEST_FEATURE(fv, 24, "TSC-DEADLINE: APIC Supports One-Shot Operation Using a TSC Deadline Value") + TEST_FEATURE(fv, 25, "AES: AES Instruction Set") + TEST_FEATURE(fv, 26, "XSAVE: XSAVE, XRESTOR, XSETBV, XGETBV") + TEST_FEATURE(fv, 27, "OSXSAVE: XSAVE Enabled by OS") + TEST_FEATURE(fv, 28, "AVX: Advanced Vector Extensions") + TEST_FEATURE(fv, 29, "F16C: F16C (Half-Precision) FP Support") + TEST_FEATURE(fv, 30, "RDRND: RDRAND (On-Chip Random Number Generator) Support") + TEST_FEATURE(fv, 31, "HYPERVISOR: Running on a Hypervisor (Always 0 on a Real CPU, But Also With Some Hypervisors") /**********************Get CPU's SERIAL Number*********************/ -- 2.47.0