about summary refs log tree commit diff stats
path: root/src/xmpp/stanza.h
Commit message (Expand)AuthorAgeFilesLines
* Tidy xmpp headersJames Booth2016-05-041-4/+0
* Add /blocked commandJames Booth2016-05-011-0/+6
* Define stanza's attributes as const char*Dmitry Podgorny2016-04-271-3/+3
* Implement XEP-0363: HTTP File UploadDominik Heidler2016-04-261-0/+13
* Removed #AX_PREFIX_CONFIG_HJames Booth2016-03-311-3/+3
* Merge branch 'master' into plugins-cJames Booth2016-02-141-1/+1
|\
| * Updated copyrightJames Booth2016-02-141-1/+1
* | Added C plugin code from plugins branchJames Booth2016-02-141-3/+3
|/
* Applied coding style to src/xmpp/James Booth2015-10-261-80/+69
* WIP: Added last activity request and responseJames Booth2015-09-291-0/+3
* Check for libmesode, fall back to libstropheJames Booth2015-09-211-0/+8
* Add no-copy and no-store hints to OTR messagesSam Whited2015-07-011-0/+3
* WIP fix for #516, needs memory cleanupJames Booth2015-06-291-1/+1
* Merge branch 'master' into pgpJames Booth2015-03-291-1/+2
|\
| * Added password to direct invitesJames Booth2015-03-291-1/+2
* | Merge branch 'master' into pgpJames Booth2015-03-291-0/+2
|\|
| * Added check members only room to send mediated invitesJames Booth2015-03-281-0/+2
* | Send encrypted messagesJames Booth2015-03-241-0/+1
* | Added pgpkeyid account setting, send signed presenceJames Booth2015-03-231-0/+1
|/
* Show message received text for receiptsJames Booth2015-03-111-1/+1
* Added basic delivery receiptsJames Booth2015-03-111-2/+6
* Send private carbons element with message when encryptedJames Booth2015-03-101-1/+1
* Merge remote-tracking branch 'oliverlemoal/xep-0280' into xep-0280James Booth2015-03-081-0/+8
|\
| * Add XEP-0280 supportOlivier LE MOAL2015-02-101-0/+8
* | Updated copyrightJames Booth2015-02-101-1/+1
|/
* Use resource in chat sessionsJames Booth2015-01-041-1/+1
* Refactored parsing capsJames Booth2014-11-261-4/+9
* Refactored available presence handlerJames Booth2014-11-261-0/+17
* Show occupants role/affiliation changesJames Booth2014-10-181-2/+2
* Added jid autocomplete for affiliation commandsJames Booth2014-10-061-2/+2
* Implemented setting and listing rolesJames Booth2014-10-061-0/+4
* Implemented /room kick commandJames Booth2014-10-051-0/+9
* Added /room kick commandJames Booth2014-10-051-0/+2
* Added /room subject commandJames Booth2014-10-051-0/+1
* Implemented setting affiliation and listing affiliationsJames Booth2014-10-041-4/+4
* Allow adding and removing room ownersJames Booth2014-10-041-0/+5
* wip - refactoring capabilitiesJames Booth2014-09-191-0/+2
* Implemented /room config submit for saving room configurationJames Booth2014-09-101-0/+2
* Parse data form for room configurationJames Booth2014-09-041-10/+1
* Added /room config edit and /room config cancelJames Booth2014-09-041-0/+4
* Added /ping commandJames Booth2014-09-041-1/+1
* Send room destroy iq on /room config cancelJames Booth2014-09-031-0/+3
* Send instant room requestJames Booth2014-09-031-0/+3
* Show message when room requires configJames Booth2014-09-031-0/+1
* Added license exemption for OpenSSL to source headersJames Booth2014-08-241-0/+12
* Refactored bookmarks to use option parser, allow bookmarking rooms with passw...James Booth2014-05-101-0/+1
* Fixed cppcheck warningsJames Booth2014-04-261-3/+0
* Chat room windows now created only after successful joinJames Booth2014-04-211-0/+1
* Implemented "/bookmark add" for private storageJames Booth2014-04-131-1/+1
* Updated copyrightJames Booth2014-03-091-1/+1
artik/mu/commit/subx/053new-segment.subx?h=hlt&id=cdfb2dbfcf18cd2f23bf74199082392c3692a599'>cdfb2dbf ^
33352536 ^

7a583220 ^
33352536 ^

6030d7e2 ^
871d2227 ^

e5cbbea4 ^
871d2227 ^
f1eade72 ^
6030d7e2 ^
9b16f190 ^
686a52bd ^
6030d7e2 ^
9b16f190 ^
6030d7e2 ^
9b16f190 ^
6030d7e2 ^
9b16f190 ^
6030d7e2 ^
9b16f190 ^
6030d7e2 ^
9b16f190 ^
871d2227 ^
ee9a9237 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88






                                                                               

                 


                                                                           

       


                                                                                                                                                 
 
                      
                                       

                          
                                                                                                                                                                       
                             
                   
               
                         
              
                               
                      
                                                                                                                                                                  
                                  




                                                                                                                                                                        
                                
 
                                                          
                

                                                                                                                                                                       
                      

               
                                        
                                                                                                                                                                            
                                                                                                                                                                                           
                             
                                           
                                


                                                                                                                                                                             
                      
                                                                                                                                                                        
                         

                                                                                                                                                                            
                 
                         

                 
                

                                                                                                                                                                       
             

       
 
                                                                                             
                                     
          
           
                       
         
           
                      
                                     
                   
                                             
        
                                                
            
                                               
 
                            
# Create a new segment (pool of memory for allocating chunks from) in the form
# of an *allocation descriptor* that can be passed to the memory allocator
# (defined in a later layer).
#
# Currently an allocation descriptor consists of just the bounds of the pool of
# available memory:
#
#   curr: address
#   end: address
#
# This isn't enough information to reclaim individual allocations. We can't
# support arbitrary reclamation yet.

== code
#   instruction                     effective address                                                   register    displacement    immediate
# . op          subop               mod             rm32          base        index         scale       r32
# . 1-3 bytes   3 bits              2 bits          3 bits        3 bits      3 bits        2 bits      2 bits      0/1/2/4 bytes   0/1/2/4 bytes

Entry:   # manual test
    # var ad/ecx: allocation-descriptor
    68/push  0/imm32/limit
    68/push  0/imm32/curr
    89/copy                         3/mod/direct    1/rm32/ecx    .           .             .           4/r32/esp   .               .                 # copy esp to ecx
    # new-segment(0x1000, ad)
    # . . push args
    51/push-ecx
    68/push  0x1000/imm32
    # . . call
    e8/call  new-segment/disp32
    # . . discard args
    81          0/subop/add         3/mod/direct    4/rm32/esp    .           .             .           .           .               8/imm32           # add to esp
    # var eax: (addr _) = ad->curr
    8b/copy                         0/mod/indirect  1/rm32/ecx    .           .             .           0/r32/eax   .               .                 # copy *ecx to eax
    # write to *eax to check that we have access to the newly-allocated segment
    c7          0/subop/copy        0/mod/direct    0/rm32/eax    .           .             .           .           .               0x34/imm32        # copy to *eax
    # syscall(exit, eax)
    89/copy                         3/mod/direct    3/rm32/ebx    .           .             .           0/r32/eax   .               .                 # copy eax to ebx
    e8/call  syscall_exit/disp32

new-segment:  # len: int, ad: (addr allocation-descriptor)
    # . prologue
    55/push-ebp
    89/copy                         3/mod/direct    5/rm32/ebp    .           .             .           4/r32/esp   .               .                 # copy esp to ebp
    # . save registers
    50/push-eax
    53/push-ebx
    # copy len to _mmap-new-segment->len
    8b/copy                         1/mod/*+disp8   5/rm32/ebp    .           .             .           0/r32/eax   8/disp8         .                 # copy *(ebp+8) to eax
    89/copy                         0/mod/indirect  5/rm32/.disp32            .             .           0/r32/eax   $_mmap-new-segment:len/disp32     # copy eax to *$_mmap-new-segment:len
    # mmap(_mmap-new-segment)
    bb/copy-to-ebx  _mmap-new-segment/imm32
    e8/call  syscall_mmap/disp32
    # copy {eax, eax+len} to *ad
    # . ebx = ad
    8b/copy                         1/mod/*+disp8   5/rm32/ebp    .           .             .           3/r32/ebx   0xc/disp8       .                 # copy *(ebp+12) to ebx
    # . ad->curr = eax
    89/copy                         0/mod/indirect  3/rm32/ebx    .           .             .           0/r32/eax   .               .                 # copy eax to *ebx
    # . ad->end = eax+len
    03/add                          1/mod/*+disp8   5/rm32/ebp    .           .             .           0/r32/eax   8/disp8         .                 # add *(ebp+8) to eax
    89/copy                         1/mod/*+disp8   3/rm32/ebx    .           .             .           0/r32/eax   4/disp8         .                 # copy eax to *(ebx+4)
$new-segment:end:
    # . restore registers
    5b/pop-to-ebx
    58/pop-to-eax
    # . epilogue
    89/copy                         3/mod/direct    4/rm32/esp    .           .             .           5/r32/ebp   .               .                 # copy ebp to esp
    5d/pop-to-ebp
    c3/return

== data

# various constants used here were found in the Linux sources (search for file mman-common.h)
_mmap-new-segment:  # mmap_arg_struct
    # addr
    0/imm32
$_mmap-new-segment:len:
    # len
    0/imm32
    # protection flags
    3/imm32  # PROT_READ | PROT_WRITE
    # sharing flags
    0x22/imm32  # MAP_PRIVATE | MAP_ANONYMOUS
    # fd
    -1/imm32  # since MAP_ANONYMOUS is specified
    # offset
    0/imm32  # since MAP_ANONYMOUS is specified

# . . vim:nowrap:textwidth=0
alt'>