wok rev 20751
Add libsbc
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Feb 12 12:12:36 2019 +0100 (2019-02-12) |
parents | d1aa8d06c7fb |
children | da2364efb6fb |
files | libsbc-dev/receipt libsbc/receipt linld/stuff/src/CRTL.ASM linld/stuff/src/CRTL.H linld/stuff/src/ISO9660.CPP linld/stuff/src/JUMP.ASM linld/stuff/src/LINLD.CPP linld/stuff/src/LOAD.CPP linld/stuff/src/TAZBOOT.CPP linld/stuff/src/VCPI.ASM linld/stuff/src/pipehole.awk |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/libsbc-dev/receipt Tue Feb 12 12:12:36 2019 +0100 1.3 @@ -0,0 +1,21 @@ 1.4 +# SliTaz package receipt. 1.5 + 1.6 +PACKAGE="libsbc-dev" 1.7 +VERSION="1.4" 1.8 +CATEGORY="development" 1.9 +SHORT_DESC="Digital audio encoder and decoder for Bluetooth audio output devices, development files" 1.10 +MAINTAINER="pascal.bellard@slitaz.org" 1.11 +LICENSE="GPL2" 1.12 +WEB_SITE="http://www.bluez.org/" 1.13 +WANTED="libsbc" 1.14 + 1.15 +DEPENDS="libsbc pkg-config" 1.16 + 1.17 +# Rules to gen a SliTaz package suitable for Tazpkg. 1.18 +genpkg_rules() 1.19 +{ 1.20 + mkdir -p $fs/usr/lib 1.21 + cp -a $install/usr/include $fs/usr 1.22 + cp -a $install/usr/lib/*a $fs/usr/lib 1.23 + cp -a $install/usr/lib/pkgconfig $fs/usr/lib 1.24 +}
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/libsbc/receipt Tue Feb 12 12:12:36 2019 +0100 2.3 @@ -0,0 +1,31 @@ 2.4 +# SliTaz package receipt. 2.5 + 2.6 +PACKAGE="libsbc" 2.7 +VERSION="1.4" 2.8 +CATEGORY="multimedia" 2.9 +SHORT_DESC="Digital audio encoder and decoder for Bluetooth audio output devices" 2.10 +MAINTAINER="pascal.bellard@slitaz.org" 2.11 +LICENSE="GPL2" 2.12 +WEB_SITE="http://www.bluez.org/" 2.13 +TARBALL="$PACKAGE-$VERSION.tar.xz" 2.14 +WGET_URL="https://www.kernel.org/pub/linux/bluetooth/sbc-$VERSION.tar.xz" 2.15 + 2.16 +# Rules to configure and make the package. 2.17 +compile_rules() 2.18 +{ 2.19 + ./configure \ 2.20 + --prefix=/usr \ 2.21 + --disable-static \ 2.22 + --disable-tester \ 2.23 + $CONFIGURE_ARGS && 2.24 + make && 2.25 + make DESTDIR=$DESTDIR install 2.26 +} 2.27 + 2.28 +# Rules to gen a SliTaz package suitable for Tazpkg. 2.29 +genpkg_rules() 2.30 +{ 2.31 + mkdir -p $fs/usr/lib 2.32 + cp -a $install/usr/bin $fs/usr 2.33 + cp -a $install/usr/lib/*.so* $fs/usr/lib 2.34 +}
3.1 --- a/linld/stuff/src/CRTL.ASM Mon Feb 11 17:14:38 2019 +0100 3.2 +++ b/linld/stuff/src/CRTL.ASM Tue Feb 12 12:12:36 2019 +0100 3.3 @@ -256,9 +256,15 @@ 3.4 3.5 3.6 ;*************************************************************** 3.7 +;_fastcall int readrm(bx:struct himem *m, ax:int sz); 3.8 ;_fastcall int read(ax:int fd, bx:void* data, dx:int sz); 3.9 ;_fastcall int write(ax:int fd, bx:const void* data, dx:int sz); 3.10 ;*************************************************************** 3.11 + global @readrm$qp11image_himemi:near 3.12 +@readrm$qp11image_himemi: 3.13 + xchg ax,dx ; sz 3.14 + mov ax,[bx] ; fd 3.15 + mov bx,[bx-2] ; data 3.16 global @read$qipvi:near 3.17 proc @read$qipvi near 3.18 3.19 @@ -366,6 +372,81 @@ 3.20 endif 3.21 3.22 3.23 + ifdef USE_ARGSTR 3.24 +;*************************************************************** 3.25 +;_fastcall int argstr(bx:const char *s, ax:const char keywords[], dx:const char **var); 3.26 +;_fastcall int argnum(bx:char *s, ax:const char keywords[], dx:unsigned long *var); 3.27 +;*************************************************************** 3.28 + global @argstr$qpxzcxt1ppxzc:near 3.29 + proc @argstr$qpxzcxt1ppxzc near 3.30 + 3.31 + stc 3.32 + db 73h ; jnc 3.33 + global @argnum$qpzcxpxzcpul:near 3.34 +@argnum$qpzcxpxzcpul: 3.35 + clc 3.36 + 3.37 + xchg ax,bx ; keywords 3.38 + xchg ax,cx ; s 3.39 + xchg ax,dx ; vars 3.40 + sbb dx,dx ; str:-1 num:0 3.41 + sbb dx,-4 ; str:2 num:4 3.42 + push si di 3.43 + xchg ax,di ; vars 3.44 + dec bx 3.45 + mov al,0 3.46 +@@testalt: 3.47 + sub di,dx 3.48 +@@test: 3.49 + cmp al,'=' 3.50 + je @@found 3.51 + mov si,cx ; s 3.52 + add di,dx 3.53 +@@match: 3.54 + inc bx 3.55 + lodsb 3.56 + or al,20h 3.57 + cmp al,[bx] 3.58 + je @@match 3.59 + cmp al,'/' ; 2f 3.60 + jne @@notopt 3.61 + cmp [byte bx],'-' 3.62 + je @@match 3.63 +@@notopt: 3.64 + ifdef EXTRA 3.65 + add di,dx 3.66 + cmp [byte bx],'/' 3.67 + je @@testalt 3.68 + sub di,dx 3.69 + endif 3.70 + cmp [byte bx],'|' 3.71 + je @@test 3.72 + mov al,0 3.73 + inc bx 3.74 + cmp [bx-1],al 3.75 + jne @@notopt 3.76 + stc 3.77 + jmp @@nokeyword 3.78 +@@found: 3.79 + mov [di],si 3.80 + dec dx 3.81 + dec dx 3.82 + je @@done 3.83 + push si 3.84 + call @strtol$qpxzc 3.85 + mov [di],ax 3.86 + mov [di+2],dx 3.87 +@@done: 3.88 + clc 3.89 +@@nokeyword: 3.90 + sbb ax,ax 3.91 + pop di si 3.92 + ret 3.93 + 3.94 + endp @argstr$qpxzcxt1ppxzc 3.95 + 3.96 + else 3.97 + 3.98 ;*************************************************************** 3.99 ;_fastcall int strhead(bx:const char* a, ax:const char* b); 3.100 ;*************************************************************** 3.101 @@ -387,6 +468,7 @@ 3.102 3.103 endp @strhead$qpxzct1 3.104 3.105 + endif 3.106 3.107 ;*************************************************************** 3.108 ;_fastcall char* malloc_or_die(ax:unsigned size); 3.109 @@ -1147,6 +1229,23 @@ 3.110 endp @strtol$qpxzc 3.111 3.112 3.113 + ifdef USE_ARGSTR 3.114 +;*************************************************************** 3.115 +;_fastcall void set_cmdline(bx:const char *filename); 3.116 +;*************************************************************** 3.117 + global @set_cmdline$qpxzc:near 3.118 + proc @set_cmdline$qpxzc near 3.119 + call openargs 3.120 + jc strtol_ret 3.121 + mov cx,4096 3.122 + mov di,[_heap_top] 3.123 + extrn read_cmdline:near 3.124 + jmp near read_cmdline ; read_cmdline(ax,di,cx) 3.125 + 3.126 + endp @set_cmdline$qpxzc 3.127 + endif 3.128 + 3.129 + 3.130 ifdef NO386 3.131 ;*************************************************************** 3.132 ;u16 topseg();
4.1 --- a/linld/stuff/src/CRTL.H Mon Feb 11 17:14:38 2019 +0100 4.2 +++ b/linld/stuff/src/CRTL.H Tue Feb 12 12:12:36 2019 +0100 4.3 @@ -21,11 +21,19 @@ 4.4 4.5 void parse_cmdline(); 4.6 extern _fastcall void strcatb(const char* a,const char* b); 4.7 +#ifdef USE_ARGSTR 4.8 +extern _fastcall int argstr(const char *s, const char keywords[], const char **var); 4.9 +extern _fastcall int argnum(char *s, const char keywords[], unsigned long *var); 4.10 +extern _fastcall void set_cmdline(const char *filename); 4.11 +#define strhead(a,b) (strstr(a,b) != (int) a) 4.12 +#else 4.13 extern _fastcall int strhead(const char* a,const char* head); 4.14 +#endif 4.15 extern _fastcall int fileexist(const char* name); 4.16 //extern "C" int open(const char* name, int flags); 4.17 extern _fastcall int open(const char* name); 4.18 extern _fastcall int close(int fd); 4.19 +extern _fastcall int readrm(struct image_himem *m, int sz); 4.20 extern _fastcall int read(int fd, void* data, int sz); 4.21 extern _fastcall long lseekcur(int fd, int whence); 4.22 extern _fastcall int puts(const char* s); 4.23 @@ -42,4 +50,3 @@ 4.24 //extern "C" unsigned long* malloc_bufv_or_die(struct image_himem *m); 4.25 extern _fastcall int malloc_or_die(unsigned size); 4.26 extern _fastcall int malloc_bufv_or_die(struct image_himem *m); 4.27 -extern _fastcall void set_cmdline(const char *filename);
5.1 --- a/linld/stuff/src/ISO9660.CPP Mon Feb 11 17:14:38 2019 +0100 5.2 +++ b/linld/stuff/src/ISO9660.CPP Tue Feb 12 12:12:36 2019 +0100 5.3 @@ -68,14 +68,17 @@ 5.4 p = x->buffer + 34 + ((p[32] + x->curpos) & -2); 5.5 do { 5.6 int len = p[2]; 5.7 +# if 0 5.8 switch (* (short *) p) { 5.9 - case 0x4D4E: // NM 5.10 - x->filename = p + 5; 5.11 - endname = p + len; 5.12 - break; 5.13 case 0x5850: // PX 5.14 x->filemod = * (short *) (p + 4); 5.15 break; 5.16 + case 0x4D4E: // NM 5.17 +# else 5.18 + if (* (short *) p == 0x4D4E) { 5.19 +# endif 5.20 + x->filename = p + 5; 5.21 + endname = p + len; 5.22 } 5.23 p += len; 5.24 } while (x->buffer + x->curpos + size - p > 2); 5.25 @@ -119,7 +122,8 @@ 5.26 isoreset(NULL); 5.27 } 5.28 next: 5.29 - for (name = s; *s && *s != '/'; s++); 5.30 + name = s; 5.31 + do s++; while (*s != '/' && *s); 5.32 c = *s; 5.33 *s = 0; 5.34 for (x->curdirsize = 0xFFFF; isoreaddir() == 0;) {
6.1 --- a/linld/stuff/src/JUMP.ASM Mon Feb 11 17:14:38 2019 +0100 6.2 +++ b/linld/stuff/src/JUMP.ASM Tue Feb 12 12:12:36 2019 +0100 6.3 @@ -132,9 +132,8 @@ 6.4 push ax ; _csip high 6.5 push [word si-4] ; _csip low 6.6 else 6.7 - extrn _csip:dword; 6.8 - push [dword _csip] ; _csip 6.9 mov si,offset _rm_size ; _rm_size, _pm_high, _rm_buf 6.10 + push [dword si-4] ; _csip 6.11 endif 6.12 lodsw 6.13 xchg ax,cx ; _rm_size
7.1 --- a/linld/stuff/src/LINLD.CPP Mon Feb 11 17:14:38 2019 +0100 7.2 +++ b/linld/stuff/src/LINLD.CPP Tue Feb 12 12:12:36 2019 +0100 7.3 @@ -25,12 +25,20 @@ 7.4 "\tinitrd,vga,root=(void)" NL 7.5 "\tmem=256m" NL 7.6 "\tcl=auto" NL 7.7 +#ifdef USE_ARGSTR 7.8 + "\t-b=1088k" NL 7.9 +#else 7.10 "\t-b 1088k" NL 7.11 +#endif 7.12 "Use quotes: \"cl=...\" if you need spaces in cmdline" NL 7.13 "Use cl=@filename to get it from a file" 7.14 #if 1 7.15 NL NL "Examples:" NL 7.16 +#ifdef USE_ARGSTR 7.17 + "\tLINLD -f -b=64m initrd=rootfs4.gz,rootfs3.gz,rootfs2.gz,rootfs1.gz \"cl=rw root=/dev/null video=-32\"" 7.18 +#else 7.19 "\tLINLD -f -b 64m initrd=rootfs4.gz,rootfs3.gz,rootfs2.gz,rootfs1.gz \"cl=rw root=/dev/null video=-32\"" 7.20 +#endif 7.21 NL NL "\tLINLD image=memtest" 7.22 #endif 7.23 ); 7.24 @@ -46,6 +54,35 @@ 7.25 puts("LINLD v" VERSION_STR "+"); 7.26 7.27 // Parse command line 7.28 +#ifdef USE_ARGSTR 7.29 + if (argv[1]) {for (;;) { 7.30 + const char **clp = &cmdline; 7.31 + next: 7.32 + argv++; 7.33 + if (!*argv) { 7.34 + puts(*clp); 7.35 + set_cmdline(*clp); 7.36 + puts(load_kernel()); 7.37 + load_initrd(); 7.38 + boot_kernel(); 7.39 + } 7.40 + if ((*(u16 *)*argv|0x2002) == 0x662F) { // -F /f 7.41 + skip_alloc++; 7.42 + goto next; 7.43 + } 7.44 + if (argstr(*argv,"cl|image|initrd",clp) == 0); 7.45 + else if (fileexist(*argv) >= 0) 7.46 + kernel_name=*argv; 7.47 + else if (*argv) { 7.48 + argnum(*argv,"root|vga|mem|-b",&root_dev); 7.49 + *clp = (const char *) buf_cmdline + 1; 7.50 + strcatb((const char *) buf_cmdline,*argv); 7.51 + } 7.52 + else 7.53 + break; 7.54 + } 7.55 + } 7.56 +#else 7.57 if (argv[1]) {for (char i=0;;) { 7.58 char *s; 7.59 next: 7.60 @@ -125,6 +162,7 @@ 7.61 break; 7.62 } 7.63 }} 7.64 +#endif 7.65 syntax(); 7.66 7.67 // Let compiler be happy
8.1 --- a/linld/stuff/src/LOAD.CPP Mon Feb 11 17:14:38 2019 +0100 8.2 +++ b/linld/stuff/src/LOAD.CPP Tue Feb 12 12:12:36 2019 +0100 8.3 @@ -112,11 +112,10 @@ 8.4 const u32 HdrS = 'H' + ('d'<<8) + (u32('r')<<16) + (u32('S')<<24); 8.5 8.6 // register value to launch the kernel real mode code 8.7 +static u32 csip; 8.8 #ifdef NO386 8.9 -u32 csip; 8.10 extern "C" u16 topseg(); 8.11 #else 8.12 -u32 csip=0x90200000; 8.13 #define topseg() 0x9000 8.14 #endif 8.15 u16 rm_size; 8.16 @@ -133,25 +132,21 @@ 8.17 #define _rm_buf(m) (((u8**)(m))[-1]) 8.18 #define _pm_high (((u8*)(m))[-3]) 8.19 #define _rm_size (*(u16*)((u8*)(m)-5)) 8.20 -#ifdef NO386 8.21 #define _csip (*(u32*)((u8*)(m)-9)) 8.22 - *((u16 *)&csip+1)=topseg()+0x20; 8.23 -#else 8.24 -#define _csip csip 8.25 -#endif 8.26 - // Open kernel, read first kb, check it 8.27 - m->errmsg = kernel_file_error; 8.28 - open_image(kernel_name, m); 8.29 - 8.30 char *version_string; 8.31 { 8.32 struct kernelparams_t *kernelparams; 8.33 kernelparams = &(((first1k_t*) (_rm_buf(m) = (u8 *)malloc_or_die(_32k)))->params); 8.34 #define first1k ((first1k_t*)((u8 *)kernelparams-0x1F1)) 8.35 8.36 + *((u16 *)&_csip+1)=topseg()|0x20; 8.37 + // Open kernel, read first kb, check it 8.38 + m->errmsg = kernel_file_error; 8.39 + open_image(kernel_name, m); 8.40 + 8.41 do { 8.42 // Do not use malloc below until heap_top adjustment (see <*>) 8.43 - if (read(m->fd, rm_buf, 0x200) == 0x200) { 8.44 + if (readrm(m, 0x200) == 0x200) { 8.45 8.46 lseekcur(m->fd,-0x200); 8.47 if(kernelparams->setup_sects == 0) { 8.48 @@ -171,7 +166,7 @@ 8.49 m->chunk_size -= _rm_size; 8.50 8.51 // Read remaining rm loader 8.52 - if (read(m->fd, rm_buf, _rm_size) == _rm_size) break; 8.53 + if (readrm(m, _rm_size) == _rm_size) break; 8.54 } 8.55 die(kernel_file_error); 8.56 } while (0);
9.1 --- a/linld/stuff/src/TAZBOOT.CPP Mon Feb 11 17:14:38 2019 +0100 9.2 +++ b/linld/stuff/src/TAZBOOT.CPP Tue Feb 12 12:12:36 2019 +0100 9.3 @@ -188,6 +188,19 @@ 9.4 s=*argv; 9.5 i++; 9.6 if (!s) break; 9.7 +#ifdef USE_ARGSTR 9.8 + if ((*(u16 *)s|0x2002) == 0x662F) { // -F /f 9.9 + skip_alloc++; 9.10 + goto next; 9.11 + } 9.12 + if (argstr(s,"kernel/image|initrd|bootfrom/iso",&kernel_name) == 0); 9.13 + else if (argnum(s,"root|vga|mem/-e|-b",&root_dev) == 0); 9.14 + else if(i == 1 && fileexist(s) != -1) { 9.15 + kernel_name = s; 9.16 + } 9.17 + else strcatb(buf_cmdline,*argv); 9.18 + } 9.19 +#else 9.20 if (strhead(s,"kernel=") == 0) { 9.21 s++; 9.22 set_kernel: 9.23 @@ -243,6 +256,7 @@ 9.24 strcatb(buf_cmdline,*argv); 9.25 }} 9.26 } 9.27 +#endif 9.28 if (iso && isoreset(iso) >= 0) { 9.29 char *s = (char *) initrd_name; 9.30 if (isoopen((char *) kernel_name) >= 0) {
10.1 --- a/linld/stuff/src/VCPI.ASM Mon Feb 11 17:14:38 2019 +0100 10.2 +++ b/linld/stuff/src/VCPI.ASM Tue Feb 12 12:12:36 2019 +0100 10.3 @@ -92,7 +92,7 @@ 10.4 ;Note: code/data segs must be flagged use16 (i.e. use ip/sp, not eip/esp) 10.5 ;Note: base addrs will be fixed up in prepare_vcpi() 10.6 descriptor gdt_code,(code_seg+readable),priv0,is_present,0fffffh,(gran_page+use_16),0 10.7 - global gdt_data 10.8 + global gdt_data:descr 10.9 descriptor gdt_data,(data_seg+writable),priv0,is_present,0fffffh,(gran_page+use_16),0 10.10 descriptor gdt_tss ,tss386_avail ,priv0,is_present,0ffh ,gran_byte ,<offset tss> 10.11 SEL_VCPI = (gdt_vcpi - gdt_null)
11.1 --- a/linld/stuff/src/pipehole.awk Mon Feb 11 17:14:38 2019 +0100 11.2 +++ b/linld/stuff/src/pipehole.awk Tue Feb 12 12:12:36 2019 +0100 11.3 @@ -41,6 +41,8 @@ 11.4 hold=0; split($2,args,","); op="" 11.5 if ($1 == "add") op="+" 11.6 if ($1 == "sub") op="-" 11.7 + if ($1 == "inc") { op="+"; args[2]="1"; } 11.8 + if ($1 == "dec") { op="-"; args[2]="1"; } 11.9 if (op != "" && regs[1] == args[1]) { 11.10 if (isnum(args[2])) { 11.11 for (i = kept++; i > 0; i--) line[i] = line[i-1] 11.12 @@ -128,6 +130,18 @@ 11.13 print s; print p; 11.14 } 11.15 else if (hold == 10) { 11.16 + split($2,args,","); op="" 11.17 + if ($1 == "add") op="+" 11.18 + if ($1 == "sub") op="-" 11.19 + if ($1 == "inc") { op="+"; args[2]="1"; } 11.20 + if ($1 == "dec") { op="-"; args[2]="1"; } 11.21 + if (op != "" && isnum(args[2])) { 11.22 + split(line[0],reg,",") 11.23 + if (substr(reg[1],length(reg[1])-1,2) == args[1]) { 11.24 + line[0] = substr(line[0],1,length(line[0])-1) op args[2] "]" 11.25 + next 11.26 + } 11.27 + } 11.28 hold=0 11.29 if (/^ mov [sd]i,ax$/) { 11.30 split($2,args,",")